tags:

views:

1135

answers:

1

Hi all,
I am working on struts2. In my action class I have written some accessors (setter-getter). Now, suppose this action class is returning SUCCESS and in struts.xml I am open a jsp page (say abc.jsp) against the result "SUCCESS". I need the values of all getter methods written in action class without creating object of action class in my jsp (i.e abc.jsp).

A: 

If your controller has a getPostalCode property you can do:

<s:textfield name="postalCode"/>

Which will bind the value to the controller field. Outside s: tags you can also use jsp-el; the expression ${postalCode} will do the same. Read this documentation

krosenvold