Frameworks| Hibernate| Struts| JSF| JavaFX| Ajax| Spring| DOJO| JDO| iBatis| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Rich Editor Example 
 

In this section, you will learn how to create pagination in struts 2. For creating pagination in your application follows the certain steps:

 

Rich Editor Example

                         

In this section, you will learn how to create pagination in struts 2. For creating pagination in your application follows the certain steps:

Download this code

Step 1: Create index.jsp page

Here is the code to be added in the index.jsp:












<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>RoseIndia.Net Struts 2 Tutorial</title>
</head>

<body>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="400">
<tr>
<td><font color="#000080" size="5"><b>RoseIndia.net Struts 2 Tutorials</b><br>
&nbsp;&nbsp;&nbsp;</font></td>
</tr>
<tr>
<td><font color="#000080"><b>Select the following links to test the
examples</b></font></td>
</tr>
<tr>
<td>

<ul>
<li><a href="roseindia/pagination.action">Pagination Example</a></li>
</ul>


</td>
</tr>
<tr>
<td><font color="#000080">&nbsp;<br>
&nbsp;<br>
&nbsp;<br>
Visit <a href="http://www.roseindia.net">http://www.roseindia.net</a>
for latest tutorials</font></td>
</tr>
</table>
</center>
</div>
<p align="center">&nbsp;</p>
</body>
</html>

Step 2: Create an action mapping in the struts.xml file. 

Here is the code to be added in the struts.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<!-- Rose India Struts 2 Tutorials -->
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />

<package name="roseindia" namespace="/roseindia" extends="struts-default">

<action name="pagination">
<result>/pages/chatQuestion/pagination.jsp</result>
</action>

</package>


<!-- Add packages here -->

</struts>

Step 3: Create a JSP page that contains pagination code:

Here is the code to be added in the pagination.jsp:

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>

<head>
<title>Pagination Example</title>
<s:head theme="ajax" />
</head>

<body>
<s:form>
<s:textarea name="text" label="Paste your text here" theme="ajax" 
cssStyle="background-color: #FCFCFC; border: 1px solid #A0A0A0; min-height:500px; max-height:inherit; "/>
</s:form>


</body>
</html>

Output:

                         

» View all related tutorials
Related Tags: c ajax flex deployment ide plugins dojo struts io tags servlet annotations help sed release test vi port new tag

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

3 comments so far (
post your own) View All Comments Latest 10 Comments:

Pagination

Posted by umesh on Sunday, 09.28.08 @ 22:59pm | #80752

Neither it seems to me...
Too bad, overall this is a pretty good Struts2 tutorial.

Posted by Marius on Thursday, 09.25.08 @ 13:28pm | #80691

Is this the code for pagination???

Posted by Aarthy on Saturday, 02.23.08 @ 04:26am | #49549

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.