This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Struts and the fly likes Action: Unable to retrieve values from request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action: Unable to retrieve values from request" Watch "Action: Unable to retrieve values from request" New topic

Action: Unable to retrieve values from request


Joined: Apr 30, 2002
Posts: 7
I'm having a problem viewing the values placed in the request within an Action class. I tried to simplify the process by removing only what is needed to get my example to work. Here are the details:

There is the action:
<action path="/Reports/jellyReports"
<forward name="campus_report"


public ActionForward campusreport(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception {

request.setAttribute("trackId", "564");
request.setAttribute("campusId", "76");
return mapping.findForward("campus_report");

Track Id ==> <%= request.getParameter("trackId")%>
Campus Id ==> <%= request.getParameter("campusId")%>

Track Id ==> null
Campus Id ==> null

Any ideas?
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
Shouldn't your action be called JellyReportAction? not campusreport?

In Struts it is common practice to use a FormBean to pass information between the action and the JSP page.

[ March 13, 2006: Message edited by: Jason Moors ]
Samuel Cox
Ranch Hand

Joined: Nov 16, 2004
Posts: 96



Joined: Apr 30, 2002
Posts: 7
Turns out the problem was due to not using: request.getAttribute(). I knew the problem was simple...I just didn't see it....thanks for the help.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Action: Unable to retrieve values from request
It's not a secret anymore!