摘要:
<HTML><BODY><FORM METHOD=POST ACTION="SaveName.jsp">What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><P><INPUT TYPE=SUBMIT></FORM></BODY></HTML>The target of the form is "SaveName.jsp", which saves the user's n 阅读全文
摘要:
<%@ page import="java.util.*" %><HTML><BODY><%! Date theDate = new Date(); Date getDate() { System.out.println( "In getDate() method" ); return theDate; }%>Hello! The time is now <%= getDate() %></BODY></HTML>===========================To 阅读全文
摘要:
<%@ page import="java.util.*" %><HTML><BODY><% System.out.println( "Evaluating date now" ); Date date = new Date();%>Hello! The time is now <%= date %></BODY></HTML>=======================The first line in the above example is called a &q 阅读全文
摘要:
<TABLE BORDER=2><% for ( int i = 0; i < n; i++ ) { %> <TR> <TD>Number</TD> <TD><%= i+1 %></TD> </TR> <% }%></TABLE> 阅读全文
摘要:
The JSP "request" variable is used to obtain information from the request as sent by the browser. For instance, you can find out the name of the client's host (if available, otherwise the IP address will be returned.) Let us modify the code as shown:<HTML><BODY><% // Thi 阅读全文
摘要:
a scriptlet does not generate HTML. If a scriptlet wants to generate HTML, it can use a variable called "out".<HTML><BODY><% // This scriptlet declares and initializes "date" System.out.println( "Evaluating date now" ); java.util.Date date = new java.util 阅读全文
摘要:
<HTML><BODY><% // This is a scriptlet. Notice that the "date" // variable we declare here is available in the // embedded expression later on. System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date();%>Hello! The time is now <%= 阅读全文