File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes need help on bean define Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "need help on bean define" Watch "need help on bean define" New topic

need help on bean define

prasanthh reddy

Joined: Sep 01, 2008
Posts: 8
Hi all

I am migrating my code to struts 2 .I am getting problem with bean:define tag

in struts 2 i have use the the <s:set> teg for that but i am unable to get the value in my action class
the code snippet is a s follows
In struts 1
<bean:define id="itemId" name="groupAdminEditForm" property="itemId" type="java.lang.Integer"/>
In struts 2
<s:set name="itemId" value="%{itemId}" />

In action class
public void setItemId(int itemId){ this.itemId = itemId; }
public int getItemId(){ return itemId; }

if i say <s:property name="itemId"/> I am getting the value in jsp but I am not able to get that value in action class

am I doing some thing wrong

David Newton

Joined: Sep 29, 2008
Posts: 12617

What do you mean, you're unable to get the value in the action class? The action class is what's providing the variable to the JSP!
prasanthh reddy

Joined: Sep 01, 2008
Posts: 8
sorry devid I have asked the wrong question what you said is correct I got the value in jsp
thank you
wood burning stoves
subject: need help on bean define