SetSession
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SetSession extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession hs=request.getSession();
hs.setAttribute("a","pakistan");
hs.setAttribute("b","india");
out.println("Done");
}
}
import javax.servlet.*;
import javax.servlet.http.*;
public class SetSession extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession hs=request.getSession();
hs.setAttribute("a","pakistan");
hs.setAttribute("b","india");
out.println("Done");
}
}
Comments
Post a Comment