Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

displaying request var using struts on jsp

 
Ronan Dowd
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How (using struts tags) on a JSP do i print the value of a request variable (a simple string) stored in the previous action ?
bean:write seems to just be for objects that are stored rather that simple types ..

Action code:
request.setAttribute("name","Bill");

JSP code:
??

Thanks, Ronan
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The scope="request" is optional, as it will search any scope. If you don't specify a property, Struts assumes that the object itself is either a String or has a toString() method it can call.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic