?
Solved

The problem is with the j_security_check used in  jsp pages in the login screen.

Posted on 2003-03-20
6
Medium Priority
?
927 Views
Last Modified: 2007-12-19
i am working on jsp along with tomcat server.In the login screen i am using response.encodeURL("j_security_check") to redirect from login screen after submission of the page.I am able to successfully login.But once wen i press the back button of the browser and move to login screen and again try to login i 've an error message saying "HTTP STATUS 404 ERROR THE REQUESTED RESOURCE(/j_security_check) IS NOT AVAILABLE".To login again,I've to close the browser fully and open a new one .
 Can anyone help this out?
0
Comment
Question by:sure_krishna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 220 total points
ID: 8179853
 Yuo will have to invalidate the session since the session is already active when you use the back button of your browser... I am not sure if the following will help if you put it on the top of your login page.

<%
HttpSession session = request.getSession(false);
session.invalidate();
%>

  You could also try to expire any cache you might have:

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>

  Hope it helps.

0
 

Expert Comment

by:CleanupPing
ID: 9058569
sure_krishna:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9730551
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept girionis' comment as answer.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0
 
LVL 35

Expert Comment

by:girionis
ID: 9730717
 Thank you :)
0
 
LVL 1

Expert Comment

by:TomBruser
ID: 11739400
Simple solution:

At the start of your login and login-error pages, include the following:

    if (request.getAttribute("javax.servlet.forward.request_uri") == null) {
        response.sendRedirect("/index.jsp");
    }

where /index.jsp is equivalant to some acceptable page to forward users to if they have inadvertantly hit the back button to reach the login page.

To create a logout function, make a logout.jsp that contains the following:

        session.invalidate();
        response.sendRedirect("/index.jsp");

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question