On Wed, Jul 21, 2010 at 10:14 PM, Bob Schellink <[email protected]> wrote: > On 22/07/2010 09:27, Beto wrote: > >> I know, it is the default. I thought that I would need to change that >> extension since now I'm using jsp. > > So you want to do this? > > <servlet-mapping> > <servlet-name>ClickServlet</servlet-name> > <url-pattern>*.jsp</url-pattern> > </servlet-mapping> Yes! Did it this way.
> I haven't tested but I think this will cause problems because Click is not a > JSP engine and won't be > able to handle JSP requests directly. What Click does is forward the JSP > requests to the >Servlet container. I'm using Jetty/Tomcat and for common jsp request it isn't forwarding: BOTH: Page Not Found The page you requested was not found. JETTY [QUOTE] [INFO] Started Jetty Server [INFO] Console reloading is ENABLED. Hit ENTER on the console to restart the context. [Click] [debug] GET http://localhost:8080/index.jsp [Click] [debug] /index.jsp -> CLASS NOT FOUND [Click] [info ] renderTemplate: /click/not-found.htm - 68 ms [Click] [info ] handleRequest: /index.jsp - 93 ms [/QUOTE] TOMCAT [QUOTE] [Click] [info ] Click 2.2.0 initialized in debug mode Jul 22, 2010 8:35:12 AM org.apache.catalina.core.StandardContext start INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/basic-shiro-jsp-0.0.1-SNAPSHOT] has already been started [Click] [debug] GET http://localhost:8080/basic-shiro-jsp-0.0.1-SNAPSHOT/ [Click] [debug] /index.jsp -> CLASS NOT FOUND [Click] [info ] renderTemplate: /click/not-found.htm - 18 ms [Click] [info ] handleRequest: /index.jsp - 45 ms [/QUOTE] >If you apply the mapping above Click will forward the request unto itself and >go into a > recursive loop. > > Can you confirm whether this is true? Yes! [QUOTE] HTTP ERROR 500 Problem accessing /secure/users.jsp. Reason: Server Error Caused by: java.lang.StackOverflowError at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:457) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) at org.eclipse.jetty.server.Dispatcher$ForwardAttributes.setAttribute(Dispatcher.java:471) [/QUOTE] > > >>> Even if the template is a JSP, you still access the URL via .htm. Click >>> will automatically >>check whether the template is a HTM or JSP and change >>> the extension accordingly. >> >> I didn't find this information in your reference [1]. >> Where, in the docs, can I find more about setting up jsp in click? > > > There is some docs on JSP here: > http://click.apache.org/docs/user-guide/html/ch02.html Here, as well doesn't have much information: "If you use JSP pages for rendering, the .jsp extension must be used. For example: " And says that I should use the .jsp extension, but doesn't indicate that I must use the .htm extension in the request url. Regards, Gilberto
