實驗環境:Myeclipse10 + tomcat7
簡單應用於登陸界面。jsp:forward的作用是,把當前的JSP頁引導到另一個頁面上,浏覽器地址本顯示的是當前網頁的地址,內容則是另一個界面的。
1.User.html
<%@ page language=java import=java.util.* pageEncoding=utf-8%> <% String path = request.getContextPath(); String basePath = request.getScheme()+://+request.getServerName()+:+request.getServerPort()+path+/; %>
<%@ page language=java import=java.util.* pageEncoding=UTF-8 isErrorPage=true%> <% String path = request.getContextPath(); String basePath = request.getScheme()+://+request.getServerName()+:+request.getServerPort()+path+/; %>
<%@ page language=java import=java.util.* pageEncoding=UTF-8%> <% String path = request.getContextPath(); String basePath = request.getScheme()+://+request.getServerName()+:+request.getServerPort()+path+/; %>