Hey, I have got the code below which will find out whether the session is opened or not. So, just use it and get your problem solved.
Code:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.DateFormat;
public class Testing HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, java.io.IOException
{
HttpSession httpsession = req.getSession(false);
if (httpsession == null)
{
res.sendRedirect("/TA/Start.jsp");
}
else
{
res.sendRedirect("/TA/add.jsp");
}
Bookmarks