I have all my pages under /web/ folder, there is a rule that redirects me to my home path (ex: http://ip:port/contextpath/web/home) when the url does not contain the /web/ at the start, any posible url that does not match /web/ (ex: /whatever/mypage) is not valid for me and I want to redirect to my home (/web/home).
thanks for any help.
This topic was modified 8 years, 4 months ago by youngreymond.
More than likely, I’m guessing you did not prepend the context-root. This must be done by hand (since you may at times want to redirect outside of the current context, but still on the same appserver.)
Otherwise, if your app is served under the context: “app1”, and you have another app under the context root “app2”, you would not be able to redirect from app1 to app2, or visa versa. You would also not be able to redirect to a URL that lives outside of the application context-root, unless you specified a fully qualified URL.
.perform(Redirect.temporary(context.getContextPath() + "/something-else"))
// Redirect to a URL in another application, or at the root of the appserver.