aspose file tools*
The moose likes Struts and the fly likes Struts:How to pass value from action class to jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts:How to pass value from action class to jsp?" Watch "Struts:How to pass value from action class to jsp?" New topic
Author

Struts:How to pass value from action class to jsp?

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Hi ,

how do I pass a field obtained from my struts action class , to the jsp ?
In this program , i obtain a parameter from the front end(jsp) and pass it to the action class to perform certain calculations and pass back the result . How do I access this new value from my front end?
Im new to struts so dont know if its a simple doubt .

Thanks in advance.


Learning and Learning!-- Java all the way!
shwetank sharma
Greenhorn

Joined: Jan 09, 2011
Posts: 10

Hi,

Suppose your new value is like


In jsp access your new value like


I hope it help..

Cheers..
Shwetank


~~Cheers~~
Shwetank
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

shwetank sharma wrote:Hi,

Suppose your new value is like



In jsp access your new value like

Hi . I'm using struts 1.4 could you please explain with respect to that ?
Thanks
shwetank sharma
Greenhorn

Joined: Jan 09, 2011
Posts: 10

Hi,

Yes that was how it is implemented in struts 2.
In struts 1.x you have to do it like this..
In your form bean

On jsp you can display it like..

Where "formName" is name of Form bean.
Hope it helps..

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts:How to pass value from action class to jsp?