相关疑难解决方法(0)

如何将欢迎页面设置为struts操作?

我有一个基于struts的webapp,我希望默认的"欢迎"页面是一个动作.我发现的唯一解决方案似乎是使欢迎页面成为包含重定向到操作的JSP的变体.例如,在web.xml:

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Run Code Online (Sandbox Code Playgroud)

并在index.jsp:

<% 
  response.sendRedirect("/myproject/MyAction.action");
%> 
Run Code Online (Sandbox Code Playgroud)

当然有更好的方法!

java jsp struts struts2

40
推荐指数
6
解决办法
5万
查看次数

标签 统计

java ×1

jsp ×1

struts ×1

struts2 ×1