当一个url过来时,如:具体路径/hello.jsp?name=john,在hello.jsp页面,可以这样得到name的值:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String name = request.getParameter("name");//用request得到
%>
然后在
hello:<%=name%>中显示。解释说明:
request.getParameter是用来获取URL中的参数的