开发者

How to open one jsp from another through struts

How to open One jsp from another through Struts?

For example,

I have 2 JSPs, Page1.jsp & Page2.jsp.

Page1.jsp does not contain any Form.

Page2.jsp contains a Form.

I need a link on Page1.jsp which when clicked takes me to Page2.jsp.

What are the Actionmappings needed to be added to struts-config.xml?


Update:

I tried adding these lines in Page1.jsp

<html:li开发者_如何学Cnk page="Page2.do">Page2</html:link>

<a href="Page2.do">Page2</a>

In struts-config.xml, the following Action-mapping

<action path="/Page2"
parameter="Page2.jsp"
type="org.apache.struts.actions.ForwardAction"/>

The "href" one works, while the one with "html:link" does not take me to Page2.jsp.

Why is that?


with struts version 1.x ( in Page1.jsp ) :

<html:link action="/action"> 

then in struts-config.xml :

<action path="/action" forward="{path to }Page2.jsp"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜