Description
http://article.gmane.org/gmane.comp.web.click.user/2515
I am trying out Click 1.4.2 in a web app that has existing legacy jsp pages. In particular situations, I need to redirect from a click page to one of these jsp pages. For example, in MyPage:
public boolean onSecurityCheck() {
setRedirect("/jsp/legacy.jsp");
return false;
}
This results in a redirect to "http://myhost/context/jsp/legacy.htm".
ClickServlet.processPage() performs a hard-wired conversion of "/jsp/legacy.jsp" to "/jsp/legacy.htm". This was added I think by CLK-338. In my case, I have no intention of using jsp with click servlet, so I would prefer that this conversion be optional.
My workaround is:
String contextPath = getContext().getRequest().getContextPath();
javax.servlet.http.HttpServletResponse response = getContext().getResponse();
String url = response.encodeRedirectURL(contextPath + "/jsp/legacy.jsp");
try
catch(java.io.IOException e)
{ throw new RuntimeException(e); }setPath(null);
Anyone see any issues with this?
Would it be tough to make the "jsp" to "htm" conversion be configurable?
—
From Bob:
We can move the conversion logic to Page#setRedirect method. That way its easier to overload or subclass.