<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form method="post" action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="id" ><br>
<label for="lname">Last name:</label><br>
<input type="password" id="lname" name="pin"><br><br>
<input type="submit" value="Submit">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>
</body>
</html>
<!--
response.sendRedirect("網址");
=========================================
RequestDispatcher view=request.getRequestDispatcher("檔案");
view.forward(request,response);
=========================================
request.getSession();
session.isNew();
=========================================
<web-app>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
</web-app>
session.setMaxInactiveInterval(20*60)//以秒為單位
========================================
Cookie cookie=new Cookie("username",name);
cookie.setMaxAge(30*60);
response.addCookie(cookie);
HttpSessionBindingListener{
public void valueBound(HttpSessionBindingEvent event){}
public void valueUnBound(HttpSessionBindingEvent event){}
}
========================================
HttpSessionListener{
public void sessionCreated(HttpSessionEvent event){}
public void sessionDestroyed(HttpSessionEvent event){}
}
<listener>
<listener-class>
className
</listener-class>
========================================
HttpSessionAttributeListener{
public void sessionAttributeAdded(HttpSessionBindingEvent event){}
public void sessionAttributeRemoved(HttpSessionBindingEvent event){}
public void sessionAttributeReplaced(HttpSessionBindingEvent event){}
}<listener>
<listener-class>
className
</listener-class>
-->
沒有留言:
張貼留言