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:

Ads

Tutorials   
Login form in Struts2 version 2.3.16 Struts 2 Login Application Struts 2 Hello World Annotation Example Struts 2 Tutorial: Easy steps to learn Struts 2 Struts2 Application in Eclipse: Running the application in Eclipse IDE Struts 2 Hello World Application using Eclipse Interceptors in Struts 2 Struts 2 Action Tag Struts 2 in Agile Development Environment Struts 2 UI Tags Generic Tags Creating own Interceptor What are Interceptors in Struts 2 and how do they work? Results Value Stack / OGNL Action in Struts 2 Framework Struts 2 Interceptors Struts 2.3.15.1 Maven - How to use Maven dependency of Struts 2.3.15.1? Download Struts 2.3.15.1 How Struts 2 Framework works? Architecture of Struts 2 Framework Features and Enhancements in Struts 2.3.15.1 Struts 2 Tutorials - Struts version 2.3.15.1 Struts Flow Diagram Step By Step Struts Tutorial Struts 2 Login Form Example Struts 2 Hello World Example Introduction to Struts 2 Framework Downloading and Installing Struts 2.3.8 Struts 2.3.8 released with new features Struts 2.3.8 Tutorials and Examples Subset Tag Actionerror Tag Struts 2 Autocompleter,Struts 2 Autocomplete Generator Tag Struts 2 Application Struts 2 zero configuration,Struts 2 zero configuration Example Static Parameter, Static Parameter in Struts 2, Struts 2 Static Parameter Pagination Example Struts 2.2.1 Title Struts2 ElseIf Tag Example Struts2 Else Tag Example Struts2 If,Else,ElseIf Tag Example Struts2 tag refrences and Example How to download, compile and test the tutorials using ant. Struts 2.1.8 Login Form Struts 2.1.8 Hello World Example Download Struts 2.1.8, Downloading and installing Struts 2.1.8 Showcase application
Ads

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 size="5"><b>RoseIndia.net Struts 2 Tutorials</b><br>
&nbsp;&nbsp;&nbsp;</font></td>
</tr>
<tr>
<td><font ><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 >&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:

     

Advertisements

Share on Google+Share on Google+

Rich Editor Example

Posted on: December 18, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: Rich Editor Example   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Nandan
January 9, 2012
where is the pagination?

I dont see pagination? where is it?

Ads

 

Ads