Thanks. I've updated the quickstart template to have a prefix as well. Prefixing with a '/' makes sens because Click doesn't handle JSP directly, it uses the Servlet RequestDispather to forward to the container JSP engine. According to the Javadoc, '/' means relative to the context root, otherwise it is relative to the current request which means you end up with JSPs being loaded from the current request eg. '/user/' which is wrong.
regards Bob [1]: http://download.oracle.com/javaee/1.4/api/javax/servlet/ServletRequest.html#getRequestDispatcher%28java.lang.String%29 On 2011/02/26 17:03 PM, Ari wrote: > Thank you, I think the leading "/" did it... JSP templates are loading for me > now. > > Thanks again, > Ari > > On Thu, Feb 24, 2011 at 9:06 AM, Bob Schellink <[email protected] > <mailto:[email protected]>> wrote: > > On 2011/02/24 15:42 PM, Ari wrote: > > Starting from the example that ships with Click 2.2.0, I stripped out > the authentication > component, > > and verified that the app runs fine at > http://localhost:8080/myapp/user/home.htm. > > > > Then I renamed the home.htm and border-template.htm to jsp extensions, > and changed the > corresponding > > method call in BorderPage.java to: > > > > public String getTemplate() { > > //return "border-template.htm"; > > return "border-template.jsp"; > > } > > Shouldn't you prefix with a '/' -> "/border..." > > > > > When I browse to http://localhost:8080/myapp/user/home.htm I get: > > > > _The requested resource (/myapp/user/border-template.jsp) is not > available._ > > > Have you placed your border-template.jsp under /user? > > > > > and the Tomcat (6.0.26) logs, with everything set to FINE, say: > > [Click] [debug] /border-template.jsp -> CLASS NOT FOUND > > This is correct. There is no BorderTemplate class. > > > > I then stripped out all the Velocity code and replaced with JSP > equivalents, using the > > examples/webapp/border-template.jsp as a guide, but that made no > difference. > > > > However if I browse to http://localhost:8080/myapp/user/home.jsp > > By accessing JSP directly you are bypassing Click. Remember that Click is > generally mapped to serve > '.htm' files. That is why you should still ref urls with .htm. > > Hope this helps. > > Bob > >
