Excel file download in Struts2 using apache POI

Apache POI is a project by Apache Software Foundation. It provides the Java API for Microsoft Documents. You can find out more about Apache POI. You can also download apache POI from here. how to save xls file in java struts2 Here we are explaining how to export data from struts2 action to an XML … Read more

Passing object from jsp page to action using model driven

Project Explorer addstudent.jsp






Passing parameter from jsp page to action

Project Explorer Library files addstudent.jsp






Getting Ip address of client

When user submit a form along with form data we can get Ip address of client. Lets see one simple program to demonstrate this

Redirect action to another Url

We want to redirect a action to another website or url. for that syntax is used

type=”redirect” is used to redirect this action to specified url. here url is a variable in action class with getter and setter methods. We are getting url value from jsp page.to get url value in struts.xml we used … Read more

html/jsp page response in ajax get method

We want to get an entire page as ajax response by using jquery get method. Steps: 1) First create pages(FirstJsp.jsp and SecondJsp.jsp) 2) call jquery get method to get ajax response in one page(here FirstJsp.jsp to get SecondJsp.jsp) 3)Configure struts.xml file Lets start with page creating FirstJsp.jsp




Flying saucer with struts2

Flying Saucer takes XML or XHTML and applies CSS 2.1-compliant stylesheets to it, in order to render to PDF (via iText), images, and on-screen using Swing or SWT. The library implements (basically) the entirety of CSS 2.1 and aims to be fully compliant with the W3C specification; it includes a small handful of CSS 3 … Read more

Setting page theme simple

In particular jsp page we can set that page simple by including following tags In jsp page

This will set page theme simple. It will not generate struts2 tabular format user has to create his own format while using theme simple. Example:

Showing Arraylist values using Struts2 Json and JQuery

I am having comment class, I want to show its property values to jsp page using json Comments.java

ListJson assigning values for comments.java. Here we fetch value of commentList and totalcomments value in our jsp page.


In Jsp page

Struts2 Json and Jquery Example

Here we will fetch a action variable’s value in jsp page using JSON and jquery Here I am using struts 2.3.4 for that we have to include struts-2-json-plugin-2.3.4.jar in class path or include it to your lib folder if you are using any IDE. Action class

In struts.xml we have to extend json-default and … Read more