摘要: <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 阅读全文
posted @ 2012-01-24 01:54 greencolor 阅读(263) 评论(0) 推荐(0) 编辑
摘要: <%@ 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 阅读全文
posted @ 2012-01-24 01:31 greencolor 阅读(204) 评论(0) 推荐(0) 编辑
摘要: <%@ 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 阅读全文
posted @ 2012-01-24 01:08 greencolor 阅读(473) 评论(0) 推荐(0) 编辑
摘要: <TABLE BORDER=2><% for ( int i = 0; i < n; i++ ) { %> <TR> <TD>Number</TD> <TD><%= i+1 %></TD> </TR> <% }%></TABLE> 阅读全文
posted @ 2012-01-24 00:52 greencolor 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2012-01-24 00:41 greencolor 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2012-01-24 00:37 greencolor 阅读(191) 评论(0) 推荐(0) 编辑
摘要: <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 <%= 阅读全文
posted @ 2012-01-24 00:33 greencolor 阅读(183) 评论(0) 推荐(0) 编辑