Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletException : null using Templates in Struts 1.3

 
Angelo Bonaparte
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic