im trying to establish and access a session from my servlet, but I can’t get it working.
All tutorials just call request.getSession(true); for the session object, but I get “request can not be resolved”.
I purely have to work with taglibs, no logic in the jsp page.
How can I access session data?
Thanks!
package controller;
import java.io.*;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import javax.servlet.jsp.tagext.*;
public class Initialize extends BodyTagSupport
{
public int doEndTag() throws JspTagException
{
try
{
// Implementation
JspWriter out = pageContext.getOut();
HttpSession session = request.getSession(true);
out.println(session.getId());
return SKIP_BODY;
}
catch(IOException error)
{
throw new JspTagException(error);
}
}
}
The right example for session data access from a taglib would have been: