• 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

is this the case of session lost?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a problem related to the servlet I am using to check the requests made.
Every request of my application has an "acao" field, in order to tell what this servlet will do, so the first thing I check when getting the request is its value.
The first page is the login. The servlet can easily get the "acao", and checks for additional parameters like "user" and "password". After validation, it redirects using
res.sendRedirect(res.encodeURL("http://localhost:8080/aiwua/" + targetURL));
Now, this targetURL page is shown and it has a hidden form with another "acao" parameter.
The servlet now should get this "acao" and do other things since the value is different than before.
But here's the odd part. I have this structure in the servlet:
if (acao != null) {
if (acao.equals("login") {
// do stuff for validating user
}
else if (acao.equals("link") {
// do other stuff
}
else
// redirect to error page1
}
else
// redirect to error page2
Now, the second request, in which "acao" is "link", doesn't work.
There IS an "acao" parameter, since it doesn't show the error page2, but error page1.
When I get the request parameters names, I get none.
But how come, since he KNOWS the "acao" parameter exists?
And I guess the above has to do with the fact that I can't set any attribute to the request session, though I use the getSession() method with no parameter and it doesn't show any other errors.
Thanks for your attention.
 
reply
    Bookmark Topic Watch Topic
  • New Topic