Hi all,
While investigating CLK-429 I realized the way we handle explicit
forwarding of JSP pages might not be correct.
Since Click cannot render a jsp page it uses
requestDispatcher.forward. This works fine but a problem comes up if
one explicitly forwards to a jsp Page, by invoking
Page.setForward("customer.jsp").
What happens here is that Click will forward to customer.jsp, and as
ClickServlet is setup to process .htm extensions (not jsp) this
request will not process the Page Customer.java.
This same situation existed for redirects but was fixed by converting
the jsp extension to htm. This ensured that the redirect was processed
by ClickServlet and once the page was processed, an implicit forward
is done to the underlying jsp template.
Should we not do the same for forwards? In other words if a user
explicitly sets the Page to forward, we should convert from jsp to
htm, process the Page and then do a final forward to the jsp.
To see this issue in action you can try the JSP example from trunk:
http://localhost:8080/click-examples/jsp/navigation-a.htm
and click on the forward link which passes a parameter. Note the
parameter will never increase. This is because the Page we forward to
is never processed.
Should we change this behavior in 1.5-RC1?
regards
bob