Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request.setAttribute in Struts

 
Vivek Kr Agrawal
Ranch Hand
Posts: 51
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying request.setAttribute("AttributeName") and request.getAttribute("AttributeName") desperately in Struts but it is not working. Checked various sites and references but of no help.
Here is the detailed description:
In HomeAction, I am using


In home.jsp
I tried using both
<%=request.getAttribute("op") %>
<bean:write name="op"/>

my struts config looks like


Please suggest something.
 
Joe Ess
Bartender
Posts: 9279
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't given us much code or other information to go on, so let's start with basics:
- are you sure HomeAction is being executed?
- are you sure form1.getUSERID() returns a value?
- are you putting the action name, not the jsp name, in the URL?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic