• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ServletException : null using Templates in Struts 1.3

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic