Jump to content

Recommended Posts

Posted

Hi, I'm softlab on Johnny.

 

In my servlet I have these lines of code:

 

request.getSession().setAttribute("paginaUtente",paginaUtente);

RequestDispatcher dispatcher = contesto.getRequestDispatcher(paginaJSP);

dispatcher.forward(request,response);

 

and the attribute is set to "../sicurezza/accesso.jsp".

 

When the jsp page is served, there are these lines of code:

 

String paginaUtente = (String)session.getAttribute("paginaUtente");

paginaUtente = paginaUtente == null ? "" : paginaUtente.trim();

 

but now the attribute is empty.

 

Why the value set in the session by the servlet is not available for the JSP? Do not they use the same session?

 

Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...