开发者

Redirect to different page from inside c:import

开发者 https://www.devze.com 2023-02-19 16:05 出处:网络
Is there any way I can redirect to a different page from a Spring Controller that gets called from a JSP using <c:import>?

Is there any way I can redirect to a different page from a Spring Controller that gets called from a JSP using <c:import>?

Scenario is as follows: I have a Spring WizardFormController, that handles a multi-page form and is included into the website using a JSP and <c:import>. After the wizard is finished, I would like to redirect to a different page, but that s开发者_开发技巧eems to be impossible from the Controller. At least, if I could get a message to the surrounding JSP, it would already help.


It seems, the only way is to use JavaScript to create a client-side redirect like this:

<script type="text/javascript>
    window.location.href = '<URL of Target>';
</script>
0

精彩评论

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