struts的。do的问题!

dl1125 2003-10-17 10:35:00
在1.0中可以
1.0中可以通过调用home.do调用jsp页面。
但是在1.1中就不行了?请问如何写?谢谢!!

<action
path="/home"
parameter="/index.jsp"
type="org.apache.struts.actions.ForwardAction"
scope="request"
validate="false">
</action>

<action
path="/home"
forward="/index.jsp">
</action>
...全文
82 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinaraul 2003-10-17
  • 打赏
  • 举报
回复
在web.xml中加入:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
在strustconfig.xml中form和action写法应为:
<form-bean name="registrationForm" type="com.wrox.pjsp2.struts.registration.RegistrationForm" />

<action-mappings>
<action name="registrationForm" type="com.wrox.pjsp2.struts.registration.EditRegistrationAction" validate="false" scope="request" path="/editRegistration">
<forward name="success" path="/registration.jsp" />
</action>
</action-mappings>
dl1125 2003-10-17
  • 打赏
  • 举报
回复
是路径方面的问题!在前面要加/do/就可以了:)

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧