我只是想做个session测试但是总是有405提示,有没有可以不写doGet()和doPost()方法就可以直接测试的???
public class TestSession extends HttpServlet{
void testSession(HttpServletRequest req,HttpServletResponse resp) throws IOException{
HttpSession session=req.getSession();
PrintWriter pw=resp.getWriter();
pw.println(session.getId());
pw.println(session.getMaxInactiveInterval());
pw.println(session.getAttributeNames());
pw.println(session.getServletContext());
}
}
public class TestSession extends HttpServlet{
void testSession(HttpServletRequest req,HttpServletResponse resp) throws IOException{
HttpSession session=req.getSession();
PrintWriter pw=resp.getWriter();
pw.println(session.getId());
pw.println(session.getMaxInactiveInterval());
pw.println(session.getAttributeNames());
pw.println(session.getServletContext());
}
}
http://www.duduwolf.com/wiki/2006/102.html