This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shwetank sharma
Greenhorn
Posts: 10
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Suppose your new value is like


In jsp access your new value like


I hope it help..

Cheers..
Shwetank
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic