• Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 405 - redirect to index page?  RSS feed

 
Lester Carmelotes
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Is it possible to HTTP Status 405 it will redirect to login?

I have setting my jsp page to this session.setMaxInactiveInterval(10) and when the session inactive then if the user will try to refresh the page or go to other page the HTTP Status 405 will appeared.
Instead of error HTTP Status 405 will appear, it will redirect to index page by setting refresh page to 1 second.

Is it possible? if so, what to do?


Thanks guys,
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That suggests a different problem. HTTP status 405 does not mean the session has timed out, it means:

Method Not Allowed

The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.

What code do you have so far for handling your HTTP requests?
 
Lester Carmelotes
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply,

I don't much understand in Handling HTTP Request. I am still learning.

Here's my validation code:



I've added every jsp page to this code:
String name = (String) session.getAttribute("user");



Thanks,
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You implemented doPost() in your servlet... You're not using a GET, are you?
 
Lester Carmelotes
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I'm not using doGet.

But in JSP page I've setting this session.setMaxInactiveInterval(10) and after that when I try to access other JSP page the HTTP Status 405 will appear.

How can I make it work?


Thanks,
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lester Carmelotes wrote:But in JSP page I've setting this session.setMaxInactiveInterval(10) and after that when I try to access other JSP page the HTTP Status 405 will appear.


I suggest that you'll have the same problem if you don't set the max-inactive-interval, or even if you don't request that JSP at all. However I don't understand what you mean when you say you try to "access" another JSP. That isn't standard terminology and so it could mean a lot of different things. So first try testing things in other sequences so you don't get misled by coincidences, and then try explaining what you're doing. Hint: standard terminology for things you might be doing include "forwarding to" a JSP, "redirecting to" a JSP, and "requesting" a JSP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!