I have a simple servlet which is adding a session variable. To request the session variable I can just from within another servlet I can use –
request.getSession().getAttribute
But how can I request this variable on client side that does not implement the servlet spec. In this case im using MIDP.
public class SetTestStartTime extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response) {
Long currentTimeMilliSeconds = System.currentTimeMillis();
request.getSession().setAttribute("time", currentTimeMilliSeconds);
}
}
you cannot read session variable in client side. but you can write your session data to http header and you can read them from j2me applicaiton.
in servlet
and in j2me