Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

  • Advertisements

Archive for the ‘Struts 2’ Category

How to use “s:checkbox” in Struts 2 in iterator

Posted by Pankil Patel on April 13, 2010

When you have requirement to use “s:checkbox” as a iterator / multiple / group wise, How you will use it?

Here is the sample example or way to it:

Step 1: Create List of “String” in you action file like:

private List symptomCheckBoxList = new ArrayList();

And create it’s getter and setter.

Step 2: Put “s:checkbox” into your “s:iterator”

Here symptomList in s:iterator is the list “private List symptomList = new ArrayList();” which is having generic type “Symptom” POJO for this list in your action file.

‘ s:property value=”symptomName” ‘ is the value to display for checkbox and here it is property type String into the Symptom POJO.

And “symptomCheckBoxList” is the list in which you will get the the selected / checked value from the display list. It must be in string format.


Posted in Struts 2 | 2 Comments »

Captcha in Struts 2

Posted by Pankil Patel on April 12, 2010


Posted in Core Java, Struts 2 | Leave a Comment »


Posted by Pankil Patel on March 29, 2010


Posted in Struts 2 | Leave a Comment »

How to overrride fileUpload interceptor in struts 2?

Posted by Pankil Patel on March 29, 2010

<interceptor-ref name=”fileUpload”>
<param name=”maximumSize” >1024</param>
<param name=”allowedTypes”>image/png,image/gif,image/jpeg,image/jpg</param>

Just put those lines inside of your action definition in your struts.xml.

Posted in Struts 2 | Leave a Comment »

Struts 2

Posted by Pankil Patel on March 16, 2010

1) Date / datetimepicker


2) How will work in struts2?

myAppUserList -> List in supported Action file

selectedId -> value will be set in this property of supported Action file, after page submit

user.id -> ComboBox’s value component

user.name -> ComboBox’s text(display) component

key / label=”Select User” -> Use key for properties file & label for Hard Coding in jsp.

<s:select list=’myAppUserList’ listKey=”user.id” listValue=”user.name” key=”Select User” name=”selectedId” id=”id”/>

Posted in Struts 2 | Leave a Comment »