File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Request.setAttribute in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Request.setAttribute in Struts" Watch "Request.setAttribute in Struts" New topic

Request.setAttribute in Struts

Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51

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.

Vivek Agrawal
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

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?

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Request.setAttribute in Struts
It's not a secret anymore!