如何通过struts从另一个jsp打开一个jsp

Van*_*aff 2 jsp struts

如何通过Struts打开另一个jsp

例如,

我有2个JSP,Page1.jsp和Page2.jsp.

Page1.jsp 不包含任何表单.

Page2.jsp 包含一个表单.

我需要一个关于Page1.jsp的链接,当点击会将我带到Page2.jsp.

什么是需要添加struts-config.xmlActionmappings


更新:

我尝试在Page1.jsp中添加这些行

<html:link page="Page2.do">Page2</html:link>

<a href="Page2.do">Page2</a>
Run Code Online (Sandbox Code Playgroud)

struts-config.xml中,执行以下Action-mapping

<action path="/Page2"
parameter="Page2.jsp"
type="org.apache.struts.actions.ForwardAction"/>
Run Code Online (Sandbox Code Playgroud)


"HREF"作品之一,而一个以"HTML:链接"不带我去Page2.jsp.

这是为什么?

dvh*_*vhh 8

使用struts版本1.x(在Page1.jsp中):

<html:link action="/action"> 
Run Code Online (Sandbox Code Playgroud)

然后在struts-config.xml中:

<action path="/action" forward="{path to }Page2.jsp"/>
Run Code Online (Sandbox Code Playgroud)