• 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

Struts 2 - passing request parameters to jsp from an Interceptor

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created a log-in Interceptor which checks for a request parameter. If this parameter exists, I then add 2 request parameters and forward to a jsp. The 2 request parameters I add are the same names as 2 input elements on the form of the jsp.

My struts.xml contains the following snippet:



My Login Interceptor contains the following snippet:



A snippet from my corresponding jsp containing the input elements:



For some reason the request parameters set in my interceptor are not resulting in the form elements being populated with the appropriate values.

I would appreciate advice as to what I need to do to ensure these request values are set into the jsp.

Thanks in advance.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us more code of your interceptor. What's parameters (I suppose your action implements parameter aware but still I want to confirm)...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what your use-case is, but I'm suspicious that this is the right way to do it.

Interceptors are designed for cross-cutting concerns; I'm not convinced this is one (particularly since the interceptor will fire if someone decides to put that param in the URL--but perhaps that's what you want).

What are you trying to accomplish?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic