web.xml中这样配置 <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> 然后在index.jsp中使用Struts2的标签 <s:action name="getDataInfo" executeResult="true"></s:action> 这个标签会执行这个action,然后返回结果页面.
web.xml中这样配置
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
然后在welcome.jsp使用jsp内置对象跳转或转发
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% /* response.sendRedirect("medicine/title"); //重定向*/
request.getRequestDispatcher("medicine/title").forward(request,response);//转发%>
web.xml
<welcome-file-list>
<welcome-file>jump.jsp </welcome-file>
</welcome-file-list>
jump.jsp里通过这段代码访问action':
<meta http-equiv='refresh' content='0;url=show.action'>
<welcome-file-list>
<welcome-file>index.jsp </welcome-file>
</welcome-file-list>
index.jsp里
<jsp:forword page="show.action">