<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>s2sgateway &#187; struts</title>
	<atom:link href="http://s2sgateway.com/category/projects-download/j2ee/struts/feed/" rel="self" type="application/rss+xml" />
	<link>http://s2sgateway.com</link>
	<description>Practical Learning of Programming languages such us j2ee,java,jsp</description>
	<lastBuildDate>Sat, 21 Jan 2012 18:55:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Struts hiberanate integration tutorial part2</title>
		<link>http://s2sgateway.com/projects-download/struts-hiberanate-integration-tutorial-part2/</link>
		<comments>http://s2sgateway.com/projects-download/struts-hiberanate-integration-tutorial-part2/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 09:10:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[projects download]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[hibenate tutorials]]></category>
		<category><![CDATA[mini project download]]></category>
		<category><![CDATA[struts complete project download]]></category>
		<category><![CDATA[Struts hiberanate integration tutorial part2]]></category>
		<category><![CDATA[struts hibernate integration examples]]></category>
		<category><![CDATA[struts-hibernate integration how to do it.]]></category>
		<category><![CDATA[struts-hibernate integration project download]]></category>
		<category><![CDATA[struts2 tutorials]]></category>
		<category><![CDATA[struts2 with hibernate tutorial]]></category>
		<category><![CDATA[university project download]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=658</guid>
		<description><![CDATA[Struts hiberanate integration tutorial part2 is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/struts-hiberanate-integration-tutorial-part2/">Struts hiberanate integration tutorial part2</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[Struts hiberanate integration tutorial part2 is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/struts-hiberanate-integration-tutorial-part2/">Struts hiberanate integration tutorial part2</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/projects-download/struts-hiberanate-integration-tutorial-part2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to export data as pdf in struts using displaytags</title>
		<link>http://s2sgateway.com/projects-download/j2ee/struts/how-to-export-data-as-pdf-in-struts-using-displaytags/</link>
		<comments>http://s2sgateway.com/projects-download/j2ee/struts/how-to-export-data-as-pdf-in-struts-using-displaytags/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 11:45:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[struts]]></category>
		<category><![CDATA[displaytag tutorial]]></category>
		<category><![CDATA[export in csv format using struts]]></category>
		<category><![CDATA[export in pdf format using displaytags]]></category>
		<category><![CDATA[export in pdf format using struts]]></category>
		<category><![CDATA[export in xml format using struts]]></category>
		<category><![CDATA[How to export data as pdf in struts using displaytags]]></category>
		<category><![CDATA[jsp free projects download]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=599</guid>
		<description><![CDATA[How to export data as pdf in struts using displaytags is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/j2ee/struts/how-to-export-data-as-pdf-in-struts-using-displaytags/">How to export data as pdf in struts using displaytags</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[How to export data as pdf in struts using displaytags is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/j2ee/struts/how-to-export-data-as-pdf-in-struts-using-displaytags/">How to export data as pdf in struts using displaytags</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/projects-download/j2ee/struts/how-to-export-data-as-pdf-in-struts-using-displaytags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to add .properties/.jar file to classpath in eclipse</title>
		<link>http://s2sgateway.com/projects-download/j2ee/struts/how-to-add-properties-jar-file-to-classpath-in-eclipse/</link>
		<comments>http://s2sgateway.com/projects-download/j2ee/struts/how-to-add-properties-jar-file-to-classpath-in-eclipse/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 10:27:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[struts]]></category>
		<category><![CDATA[add external jar in eclipse]]></category>
		<category><![CDATA[add jar to classpath]]></category>
		<category><![CDATA[add properties file to classpath]]></category>
		<category><![CDATA[add the displaytag.properties file in classpath in eclipse]]></category>
		<category><![CDATA[class not found exception]]></category>
		<category><![CDATA[how to add .properties/.jar file to classpath in eclipse]]></category>
		<category><![CDATA[how to resolve class not found exception]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=597</guid>
		<description><![CDATA[how to add .properties/.jar file to classpath in eclipse is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/j2ee/struts/how-to-add-properties-jar-file-to-classpath-in-eclipse/">how to add .properties/.jar file to classpath in eclipse</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[how to add .properties/.jar file to classpath in eclipse is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/j2ee/struts/how-to-add-properties-jar-file-to-classpath-in-eclipse/">how to add .properties/.jar file to classpath in eclipse</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/projects-download/j2ee/struts/how-to-add-properties-jar-file-to-classpath-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pagination in sturts using Displaytags</title>
		<link>http://s2sgateway.com/jsp/pagination-in-sturts-using-displaytags/</link>
		<comments>http://s2sgateway.com/jsp/pagination-in-sturts-using-displaytags/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 09:59:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Jsp]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[displaytag download]]></category>
		<category><![CDATA[export values in struts]]></category>
		<category><![CDATA[Hibernate tutorial]]></category>
		<category><![CDATA[how to do pagination in struts]]></category>
		<category><![CDATA[pagination in jsp]]></category>
		<category><![CDATA[Pagination in sturts using Displaytags]]></category>
		<category><![CDATA[pagination tutorial]]></category>
		<category><![CDATA[pagination using displaytag]]></category>
		<category><![CDATA[sorting in struts]]></category>
		<category><![CDATA[struts sorting]]></category>
		<category><![CDATA[struts tutorial]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=593</guid>
		<description><![CDATA[Today We are going to learn about How to do Pagination in sturts using Displaytags .As all you know Struts is a MVC Architecture.So that It is easy for us to develop and maintain webapplications.The advantage of java community is the jar files it contains needed tasks combined in a file so that we can [...]<p><a href="http://s2sgateway.com/jsp/pagination-in-sturts-using-displaytags/">Pagination in sturts using Displaytags</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Today We are going to learn about<br />
<h4>How to do Pagination in sturts using Displaytags</h4>
<p>.As all you know Struts is a MVC Architecture.So that It is easy for us to develop and maintain webapplications.The advantage of java community is the jar files it contains needed tasks combined in a file so that we can use it for all the processes.<br />
Here i am using Displaytag-The display tag library is an open source suite of custom tags that provide high-level web presentation patterns which will work in an MVC model. The library provides a significant amount of functionality while still being easy to use.<br />
The Three Jar Files needed for implementing Displaytag are </p>
<pre>
1.displaytag-1.2.jar
2.displaytag-export-poi-1.2.jar
3.displaytag-portlet-1.2.jar
</pre>
<p>These files i have added in lib folder of the example project Download link is at end of this tutorial,so don&#8217;t worry about that.<br />
<br />
The other Jar files needed are listed below you need to add these jars in classpath of your project</p>
<pre>
commons-beanutils.jar,commons-collections.jar,
commons-collections-3.1.jar,commons-digester.jar,
commons-fileupload.jar,commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar,commons-lang-2.3.jar,commons-logging.jar
commons-logging-1.1.jar,commons-validator.jar,dom4j-1.6.1.jar
freemarker-2.3.13.jar,itext-1.3.jar,jakarta-oro.jar
javassist-3.9.0.GA.jar,jta-1.1.jar,junit-3.8.1.jar
junit-3.8.2.jar,log4j-1.2.15.jar
servlet-api.jar,slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar,struts.jar
struts2-convention-plugin-2.1.6.jar,struts2-core-2.1.6.jar
xwork-2.1.2.jar
</pre>
<p>These jar files are part of packages of struts and servlet<br />
Lets Start the Project,The data.java contains the needed data for Pagination</p>
<div style="margin-bottom:2px">
<pre style="margin:0px;padding:6px;border:1px inset;width:420px;max-width:420px;height:120px;text-align:left;overflow:auto"><code>
<pre>
package com.s2sgateway;

import java.util.ArrayList;

public class data {
	private int no;
	private String name;
	private int age;
	private double salary;

	public data() {

	}

	public data(int no, String name, int age, double salary) {
		this.no = no;
		this.name = name;
		this.age = age;
		this.salary = salary;
	}
	public ArrayList<data> loadData() {
		ArrayList<data> userList = new ArrayList<data>();
		userList.add(new data(1, "Akilan", 20, 40000));
		userList.add(new data(2, "Abu", 30, 37000));
		userList.add(new data(3, "Charlos", 49, 35000));
		userList.add(new data(4, "Edwin", 44, 22000));
		userList.add(new data(5, "Gourav", 33, 22500));
		userList.add(new data(6, "Kennady", 51, 21500));
		userList.add(new data(7, "Mani", 27, 29500));
		userList.add(new data(8, "Lal", 58, 19000));
		userList.add(new data(9, "Tawak", 67, 18800));
		userList.add(new data(10, "Ameen", 73, 23000));
		userList.add(new data(11, "jani", 61, 32000));
		userList.add(new data(12, "Iqbal", 28, 17500));
		userList.add(new data(12, "Wasim", 54, 22000));
		userList.add(new data(12, "Asho", 65, 31500));
		userList.add(new data(15, "Arnold", 60, 24000));
		userList.add(new data(16, "Jamal", 24, 100000));
		userList.add(new data(17, "Safiq", 20, 100000));
		userList.add(new data(18, "Li-jing", 61, 27000));
		userList.add(new data(19, "Charles ", 43, 41000));
		userList.add(new data(19, "David", 38, 26000));

		return userList;
	}
	public int getNo() {
		return no;
	}
	public void setNo(int no) {
		this.no = no;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}
}
</pre>
<p></code></pre>
</div>
<p>The FormFile contains the setter and getter method to get the datas from data file in arraylist.</p>
<div style="margin-bottom:2px">
<pre style="margin:0px;padding:6px;border:1px inset;width:420px;max-width:420px;height:120px;text-align:left;overflow:auto"><code>
<pre>
package com.s2sgateway;
import java.util.ArrayList;
import org.apache.struts.action.ActionForm;
public class FormFile extends ActionForm {

	private ArrayList<data> dataList;

	public ArrayList<data> getDataList() {
		return dataList;
	}

	public void setDataList(ArrayList<data> dataList) {
		this.dataList = dataList;
	}
}
</pre>
<p></code></pre>
</div>
<p>The Action File Contains the code to call the method of the formfile and data file to load the data&#8217;s, once the success returns the value is displayed in the user page.</p>
<div style="margin-bottom:2px">
<pre style="margin:0px;padding:6px;border:1px inset;width:420px;max-width:420px;height:120px;text-align:left;overflow:auto"><code>
package com.s2sgateway;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class ActionFile extends Action {

    private final static String SUCCESS = "success";

	public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        FormFile formFile= (FormFile) form;
        data userdata = new data();
        formFile.setDataList(userdata.loadData());
        return mapping.findForward(SUCCESS);
    }

}
</pre>
<p></code></pre>
</div>
<p>The index file &lt;jsp:forward page=&#8221;actionFile.do&#8221;/&gt; forwards the page to struts-config.xml after the success returns the code transferred to the user page to display the data.The user file contains the code to display the data using displaytag.</p>
<div style="margin-bottom:2px">
<pre style="margin:0px;padding:6px;border:1px inset;width:420px;max-width:420px;height:120px;text-align:left;overflow:auto"><code>
&lt;%@page buffer="16kb"%&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;%@taglib uri="http://displaytag.sf.net" prefix="display" %&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
        &lt;title&gt;Struts-pagination tutorial by http://s2sgateway.com&lt;/title&gt;
        &lt;link href="css/style.css" rel="stylesheet" type="text/css" /&gt;
    &lt;/head&gt;
    &lt;body bgcolor="#ff550"&gt;
    &lt;h2&gt;Struts-pagination tutorial by http://s2sgateway.com&lt;/h2&gt;

    &lt;%
    try
    {response.flushBuffer();
    }
    catch(Exception e)
    {}
    finally
    {}
    %&gt;
        &lt;display:table export="true"  id="data"
        			name="sessionScope.FormFile.dataList"
        			requestURI="/actionFile.do" pagesize="10" &gt;
            &lt;display:column property="no" title="No" sortable="true"   /&gt;
            &lt;display:column property="name" title="Name" sortable="true"  /&gt;
            &lt;display:column property="age" title="Age" sortable="true"  /&gt;
            &lt;display:column property="salary" title="Salary"
            		sortable="true"  /&gt;

        &lt;/display:table&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p></code></pre>
</div>
<p>Here in this code the sortable element is set to true to sort the values,Export is set to true to give the options to export in three default types</p>
<pre>
1.Excel
2.xml
3.Csv
</pre>
<p>The pagination is works fine by displaying 10 values per page of 20 values given in data file,When You Click the title links the values is sortable.<br />
So download the complete code here <a href='http://s2sgateway.com/wp-content/uploads/2010/08/strutspagination1.zip'><img src="http://s2sgateway.com/Download.gif">strutspagination</img></a><br />
<br />
After downloading the project import the project in eclipse and add the required jars and run the project,Happy coding</p>
<p></p>
<pre>
Related Posts<br />
<a href="http://s2sgateway.com/my-sql/pagination-in-jspjava/">Pagination in Java/Jsp</a></p>
<p><a href="http://s2sgateway.com/jsp/pagination-in-sturts-using-displaytags/">Pagination in sturts using Displaytags</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/jsp/pagination-in-sturts-using-displaytags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Struts-Hibernate Integration tutorial to insert values</title>
		<link>http://s2sgateway.com/projects-download/simple-struts-hibernate-integration-tutorial-to-insert-values/</link>
		<comments>http://s2sgateway.com/projects-download/simple-struts-hibernate-integration-tutorial-to-insert-values/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 14:55:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[projects download]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[Hibernate tutorial]]></category>
		<category><![CDATA[how to integrate struts with hibernate]]></category>
		<category><![CDATA[insert values in to database using struts and hibernate]]></category>
		<category><![CDATA[insert values using struts and hibernate]]></category>
		<category><![CDATA[Simple Struts-Hibernate Integration tutorial to insert values]]></category>
		<category><![CDATA[simple struts-hibernate tutorial]]></category>
		<category><![CDATA[struts tutorial]]></category>
		<category><![CDATA[struts-hibernate integration guide]]></category>
		<category><![CDATA[struts-hibernate integration project download]]></category>
		<category><![CDATA[struts-hibernate integration tutorial]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=559</guid>
		<description><![CDATA[Simple Struts-Hibernate Integration tutorial to insert values is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/simple-struts-hibernate-integration-tutorial-to-insert-values/">Simple Struts-Hibernate Integration tutorial to insert values</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[Simple Struts-Hibernate Integration tutorial to insert values is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/simple-struts-hibernate-integration-tutorial-to-insert-values/">Simple Struts-Hibernate Integration tutorial to insert values</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/projects-download/simple-struts-hibernate-integration-tutorial-to-insert-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Struts Example</title>
		<link>http://s2sgateway.com/projects-download/simple-struts-example/</link>
		<comments>http://s2sgateway.com/projects-download/simple-struts-example/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 12:50:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[projects download]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[J2EE project download]]></category>
		<category><![CDATA[searching database using struts]]></category>
		<category><![CDATA[struts example project]]></category>
		<category><![CDATA[struts project download]]></category>

		<guid isPermaLink="false">http://s2sgateway.com/?p=93</guid>
		<description><![CDATA[Simple Struts Example is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/simple-struts-example/">Simple Struts Example</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></description>
			<content:encoded><![CDATA[Simple Struts Example is a post from: s2sgateway<p><a href="http://s2sgateway.com/projects-download/simple-struts-example/">Simple Struts Example</a> is a post from: <a href="http://s2sgateway.com">s2sgateway</a></p>
]]></content:encoded>
			<wfw:commentRss>http://s2sgateway.com/projects-download/simple-struts-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>


