当前位置: 代码迷 >> J2EE >> strus有关问题
  详细解决方案

strus有关问题

热度:308   发布时间:2016-04-22 03:32:33.0
strus问题
求助~~ 问题如下:

abc.do 是我的action。
( web.xml配置成
  <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  在IE地址栏中输入“http://localhost:8080/ ” 可以直接调用我的那个index.jsp页面。
 ) 

那么如果我在web.xml文件中直接配置成如下样式:
  
  <welcome-file-list>
  <welcome-file>abc.do</welcome-file>
  </welcome-file-list>

在IE地址栏中输入“http://localhost:8080/ ” 可以直接调用我的那个action么?




------解决方案--------------------
貌似不可以直接配置为***.do的形式,不过可以曲线救国
XML code
<welcome-file-list>      <welcome-file>index.jsp </welcome-file>     </welcome-file-list>
------解决方案--------------------
只要在index.jsp里面写一段话就可以了
Java code
<%    response.sendRedirect("/test/abc.do"); [color=#FF0000]//这里的具体路径你根据自己的情况写了[/color]%>
------解决方案--------------------
没错 你可以在index.jsp理加上这段
<c:redirect url="/abc.do">