G
GIMME
An application goes from jsp 1 to jsp 2.
Jsp 2 modifies a session attribute which is displayed on jsp 1.
Jsp 2 never displays, it always forwards (see below) back to jsp 1.
Jsp 2 removes the session attribute and sets it.
Sometimes jsp 1 does not display the most recent value of the
session attribute - to see it the user must click the browser's
refresh button.
Any suggestions?
public void DoForward( HttpServletRequest request,
HttpServletResponse response, String sURL) {
try {
response.setContentType("text/html; charset=UTF-8");
request.getRequestDispatcher(sURL).forward(request,response);
} catch (javax.servlet.ServletException ex ) {
System.out.println("DoForward()
javax.servlet.ServletException " + sURL );
ex.printStackTrace();
} catch (java.io.IOException ex ) {
System.out.println("DoForward() java.io.IOException " +
sURL);
ex.printStackTrace();
}
}
Also in Jsp 2 :
session.removeAttribute("tl");
session.setAttribute("tl",tl);
Jsp 2 modifies a session attribute which is displayed on jsp 1.
Jsp 2 never displays, it always forwards (see below) back to jsp 1.
Jsp 2 removes the session attribute and sets it.
Sometimes jsp 1 does not display the most recent value of the
session attribute - to see it the user must click the browser's
refresh button.
Any suggestions?
public void DoForward( HttpServletRequest request,
HttpServletResponse response, String sURL) {
try {
response.setContentType("text/html; charset=UTF-8");
request.getRequestDispatcher(sURL).forward(request,response);
} catch (javax.servlet.ServletException ex ) {
System.out.println("DoForward()
javax.servlet.ServletException " + sURL );
ex.printStackTrace();
} catch (java.io.IOException ex ) {
System.out.println("DoForward() java.io.IOException " +
sURL);
ex.printStackTrace();
}
}
Also in Jsp 2 :
session.removeAttribute("tl");
session.setAttribute("tl",tl);