81,091
社区成员
发帖
与我相关
我的任务
分享
<%
String username = (String)request.getAttribute("username");
%>
<%=username %>
下例举例说明了redirect属性的用法:
<forward name="success" path="/Catalog.jsp" redirect="true"/>
如果 redirect=true, URL 建立如 / contextPath / path 因为 HttpServletResponse.sendRedirect(…) 中解释 URL 采用 ”/” 开头相对于 servlet 容器根目录。
如果 redirect=false, URI 建立如 / path 因为 ServletContext.getRequestDisptacher(…) 采用虚拟目录相关 URL 。