/set SESSION ATTRIBUTE
request.getSession().setAttribute("var",var);
//SET REQUEST ATTRIBUTE
request.setAttribute("var", var);
//CHECK IF A REQUEST PARAMETER IS SET, USED FOR EXAMPLE
//WHEN YOU USE A HTML <form> OR SUBMIT THE PARAMETER IN
//THE URL, LIKE /your.jsp?name=FOO
if ( request.getParameter("name")!=null )
name=request.getParameter("name");
//CHECK IF ATTRIBUTE IS SET. AN ATTRIBUTE CAN BE ANY (SERIALIZIBLE)
//JAVA OBJECT.
if ( request.getAttribute("name")!=null )
name=(String)request.getParameter("name");
0 留言:
發佈留言