Yesterday I sent a message asking wondering why my helloworld application didn't go beyond loading the main class by Tomcat. Someone asked for my source code, I'm sending it in attachment.
As I said before, I inserted a System.err on the constructor of the class that extends WebApplication and I can see that message on catalina.out. But when I go to my browser I can't see anything, I just get a 404. I am using Java 5 with Tomcat 5.5.16 and wicket 1.2 rc2 on Linux.
This is really strange, as I don't get any errors on my logs, just the 404.
--
Cumprimentos,
Rui Pacheco
package wicket.test; import wicket.Session; import wicket.protocol.http.WebApplication;
public class HelloWorldApplication extends WebApplication { public HelloWorldApplication(){ System.err.println("::: HelloWorldApplication was initialized by Tomcat"); } public Class getHomePage() { return HelloWorld.class; } public Session newSession() { // TODO Auto-generated method stub return null; } }
package wicket.test; import wicket.markup.html.WebPage; import wicket.markup.html.basic.Label; public class HelloWorld extends WebPage { public HelloWorld(){ add(new Label("message", "Hello World!")); } }Message goes here
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <display-name>Wicket Examples</display-name> <servlet> <servlet-name>HelloWorldApplication</servlet-name> <servlet-class>wicket.protocol.http.WicketServlet</servlet-class> <init-param> <param-name>applicationClassName</param-name> <param-value>wicket.test.HelloWorldApplication</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HelloWorldApplication</servlet-name> <url-pattern>/helloworld/*</url-pattern> </servlet-mapping> </web-app>