W Eb P Rogramming and & U Ser I Nterface D Esign Week 3
W Eb P Rogramming and & U Ser I Nterface D Esign Week 3
HTML
Tomcat
HTTP
Internet App. Server
Internet Server
JVM
servlet/HelloWorld
HelloWorld.class
demo/servlet/ equates to
…/demo/WEB-INF/classes/HelloWorld.class
HTTP is Connectionless
The HTTP protocol is connectionless
Knowledge of prior pages visited or, for
example, products placed in a shopping cart
are easily lost
So how can server applications maintain a
sense of a session with a client?
– hidden fields
– cookies
– session control
Hidden Fields in HTML
Solution comes from CGI period
Server hides session information within HTML
returned to the client
FORM field INPUT type can be set to “hidden”
<INPUT TYPE=“hidden” NAME=“itemsbought”
VALUE=“209087,342901”>
Field name and value will be returned to the server
by the client when the client submits the form
request to the server
Hidden Fields in HTML