37 Application API Hidden

<%
			
		out.println("Java Servlet API Version "
					+ application.getMajorVersion() + "."
					+ application.getMinorVersion() + "<br>");
			
		out.println("URL of 'application2.jsp' is: "
					+ application.getResource("/application2.jsp") + "<br>");
			
		out.println("getServerInfo()=" + application.getServerInfo()
					+ "<br>");
	    // getRealPath方法会返回资源在服务器上的绝对路径
		out.println(application.getRealPath("/application2.jsp"));
		%>


2 利用Hidden现在注册向导


<form action="Wizard2.jsp" method="post">
你的名字:<input type="text" name="name" /><br> 
<input type="submit"value="submit" />
</form>


			<form action="Wizard3.jsp" action="post">

						你的名字:<%=name%>
						<br> 你喜欢的娱乐项目: 
						<input type="text" name="resume" />
						<input type="hidden" name="name2"  value=<%=name %>>
						<input type="submit" value="submit" />


			</form>

<%
	String name = request.getParameter("name2");
	String asume = request.getParameter("resume");
%>

<body>
	你的名字:<%=name %> <br>
	你喜欢的娱乐项目:<%=asume %>
</body>




你可能感兴趣的:(37 Application API Hidden)