Struts2:如何告诉我的index.jsp转发到struts2动作?
问题描述:
通常当我在Web应用程序上看到index.jsp时,它只会转发到另一个URL,例如login.jsp,例如
Oftentimes when I see an index.jsp on a web application it just forwards to another url like login.jsp such as
<jsp:forward page="login.jsp" />
使用struts2时,我想要一个类似的index.jsp,但我希望它转发给一个动作。我该怎么做?
When using struts2, I want a similar index.jsp but I want it to forward to an action. How do I do this?
答
如果需要,可以使用纯HTML
You can use plain HTML if you want
在您的头标记之间使用:
Between your head tags use:
<META HTTP-EQUIV="Refresh" CONTENT="1;URL=Login.action">
这将重定向到myCOntext / Login.action
This will redirect to myCOntext/Login.action
如果Login位于名称空间后面,您需要将其包含在URL
If Login is behind a name space you wil need to include that in the URL