Struts2:如何告诉我的index.jsp转发到struts2动作? [英] Struts2: How do I tell my index.jsp to forward to a struts2 action?
本文介绍了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
这篇关于Struts2:如何告诉我的index.jsp转发到struts2动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文