• 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: HttpServletRequest is null

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all. I have a Login action that gets intercepted by non other than LoginInterceptor. In the interceptor the username and password are checked. I can even print them in the logs to see that they are really there.

The interceptor returns
[code]
return invocation.invoke();
[\code]

Then in the Login action username, password and HttpServletRequest are all null. I have setters for each. I am implementing ServletRequestAware.

Worst of all this was all working yesterday. This happened once before but then started working. Which all means I have no clue what I did or how to fix this.
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. I got the answer. I will post it here in case someone else comes along.

I had my interceptors set up like this. The loginInterceptor is one that I wrote. But, being custom it bypasses Struts 2's way of populating the request and properties. Trade out this code for the following:

Old:


Fix:
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic