This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes ServletException : null using Templates in Struts 1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ServletException : null using Templates in Struts 1.3" Watch "ServletException : null using Templates in Struts 1.3" New topic
Author

ServletException : null using Templates in Struts 1.3

Angelo Bonaparte
Greenhorn

Joined: Aug 02, 2006
Posts: 19
Hi,
I hope i explain this clearly. I have an action that needs to get some parameters from the request(not request attributes) and it needs to append them to the query string and then forward to a page which will use these parameters. I use the ActionRedirect class to create a redirect and append the parameters. Everything seems to be ok but when the page loads I get the following exception: ServletException in /templates/mainTemplate.jsp : null.

The action works properly if I just forward to the page so I know the problem is caused by the redirect. Is there a way to append request parameters(Not attributes) withing an action without creating a new forward? If not, does anybody have an idea on how to fix this problem.

Thanks.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Angelo Bonaparte:
Is there a way to append request parameters(Not attributes) withing an action without creating a new forward?

The short answer to this question is no. When You get a forward using the findForward method, it's actually a ForwardConfig, which is immutable.

However, the ActionRedirect has a constructor that will accept an immutable forward and clone it to create a new one. Example:

Regarding your error: Are you sure you're copying all the required parameters? You may be getting the error because you missed one or more of them. If the above doesn't fix it, post your code, and we'll help you debug it. Also, show us the first few lines of the stack trace and the full message you're getting.


Merrill
Consultant, Sima Solutions
 
jQuery in Action, 2nd edition
 
subject: ServletException : null using Templates in Struts 1.3
 
Similar Threads
Each Time The Server Restarts, The Browser Does Not Display The Welcome Page
Changing the URL when using forward or redirect...
URL same
Action Chaining issue
How to create a central error page