• Post Reply Bookmark Topic Watch Topic
  • New Topic

pass value  RSS feed

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my struts program..





after this code execute,go to second.jsp



myquestion is


how can i pass String a value to second.jsp???

how can i get Stirng a value in second.jsp???


how can i pass value from action class to jsp page???

how can i pass value from jsp page to action class???

 
Sheriff
Posts: 9611
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sihani, when your action returns a result value, the action object itself is put on the ValueStack. So you can access the action's properties in the JSP using OGNL. So if lets say you want to access the String user property in your JSP, you can access it using s:property tag as

<s:property value="user" />
 
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the simple way is to set an attribute into session,
and get the same attribute on the different page by using session.getAttribute("attributeName");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!