Simple Message Board Display
<%@ Pagelanguage= "Java"ContentType= "text/html; charset=utf-8"pageencoding= "UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Message boards</title></Head><Body><formAction= "session0625.jsp"Method= "POST"ID= "Form1"name= "Form1"><DivAlign= "Center"><Tablewidth= "50%"Border= "0"><TR><TDwidth= "10%">Your contact e-mail:</TD><TDwidth= "40%"><inputtype= "text"name= "Email"/></TD></TR></Table><Tablewidth= "50%"Border= "0"Height= "40%"><TR><TD>Message content:</TD></TR><TR><TD><inputtype= "text"style= "width:50%;height:100%"name= "Liuyan"/></TD></TR><TR><TD><inputtype= "Submit"value= "Submit"/></TD></TR></Table></Div></form></Body></HTML>
<%@ Pagelanguage= "Java"ContentType= "text/html; charset=utf-8"pageencoding= "UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Message Board session</title></Head><Body><%stringEmail=newString (request.getparameter ("email"). GetBytes ("Iso-8859-1"), "UTF-8"), Session.setattribute ("email", email); String Liuyan=newString (Request.getparameter ("Liuyan"). GetBytes ("Iso-8859-1"), "UTF-8"), Session.setattribute ("Liuyan", Liuyan );%><formAction= "result0625.jsp"Method= "POST"><Table><TR><TD>OK to show message content?</TD></TR><TR><TD><inputtype= "Submit"value= "OK"/></TD><TD><inputtype= "Reset"value= "Cancel"/></TD></TR></Table></form><%-- your e-mail address is: <%=email%><BR>the content of your message is:<%=liuyan%>--%></Body></HTML>
<%@ Pagelanguage= "Java"ContentType= "text/html; charset=utf-8"pageencoding= "UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Insert Title here</title></Head><Body><%stringEmail= (String) session.getattribute ("email");String Liuyan= (String) session.getattribute ("Liuyan");%>your e-mail address is:<%=email%><BR>the content of your message is:<%=liuyan%></Body></HTML>
Operation Result:
JSP message Session