如何在支柱1中的URL重定向?
我们的应用程序(仍在使用Struts 1)需要将用户重定向到新的登录页面(外部托管)。在类似的应用程序(使用Strut 2)中,我们具有正常工作。下面,我将显示我们的实施。最终,我想在支柱1中找到同等的内容。由于这个旧的不支持的软件,我很难找到任何在线文档。我非常感谢这里的任何建议。
struts.xml :
<action name = "Home2"
class = "com.eppt.action.MasterAccountListAction2"
method = "wlgnReDirect">
<result name = "unknownerror" type = "tiles">masteraccountlist</result>
<result name="wlgn" type="redirect">${wlgntUrl}</result>
<result name="success" type="redirect">${wlgntUrl}</result>
</action>
重定向config java文件:
public String wlgnReDirect() {
try {
wlgntUrl = "https://wwwdev.idev.com/secure-login/en-us/?redirectUrl=http://www.yahoo.com";
nextScreen = "wlgn";
} catch (Exception e) {
addGenericError(request);
return "unknownerror";
}
return nextScreen;
}
如上所述,这是在Struts 2中使用的。
Our application (still using Struts 1) needs to redirect the user to a new login page (hosted externally). In a similar application (using Struts 2), we have this working properly. Below, I will show our implementation. Ultimately I want to find the equivalent in Struts 1. I am having trouble finding any online documentation because of this old unsupported software. I would greatly appreciate any advice here.
struts.xml:
<action name = "Home2"
class = "com.eppt.action.MasterAccountListAction2"
method = "wlgnReDirect">
<result name = "unknownerror" type = "tiles">masteraccountlist</result>
<result name="wlgn" type="redirect">${wlgntUrl}</result>
<result name="success" type="redirect">${wlgntUrl}</result>
</action>
redirect config Java file:
public String wlgnReDirect() {
try {
wlgntUrl = "https://wwwdev.idev.com/secure-login/en-us/?redirectUrl=http://www.yahoo.com";
nextScreen = "wlgn";
} catch (Exception e) {
addGenericError(request);
return "unknownerror";
}
return nextScreen;
}
Like stated above, this works as intended in Struts 2. How can I achieve the same in Struts 1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Struts 1中,如果您以编程方式创建新的
ActionForward
并将其从操作方法返回,则可以实现相同的结果。In Struts 1 the same result could be achieved if you create a new
ActionForward
programmatically and return it from the action method.