users@glassfish.java.net

Re: servlets - total noob

From: Ludovic Champenois <Ludovic.Champenois_at_Sun.COM>
Date: Fri, 28 Mar 2008 22:06:40 -0700

glassfish_at_javadesktop.org wrote:
> hi everyone.
>
> i'm a total noob to glassfish and servlets, but not to java. i'm trying to make a simple html page that posts to a servlet which returns a response. nothing fancy, just to learn. i currently have a war file that i am dropping into autodeploy that looks like this:
>
> servletTest/
> - index.html
> - web.xml
> - sun-web.xml
> + WEB_INF/
> + classes/
> + ServletTest.class
>
>
web.xml ans sun-web.xml should be under WEB-INF/ dir
WEB_INF should be WEB-INF

> my servlet definition in web.xml looks like this
>
> <servlet>
> <servlet-name>servletTest</servlet-name>
> <servlet-class>servletTest</servlet-name>
>
Your servlet class is wrong:Needs to start with Capital S

Using Eclipse or NetBeans IDEs would help you detecting these errors,
Lud
> </servlet>
> <servlet-mapping>
> <servlet-name>servletTest</servlet-name>
> <url-pattern>/servletTest</servlet-name>
> </servlet-mapping>
>
> localhost:8080/servletTest serves up my index.html pages just fine, but no matter what i try i get a 404 when i try to reach my servlet. what am i doing wrong?
> [Message sent by forum member 'notatoad' (notatoad)]
>
> http://forums.java.net/jive/thread.jspa?messageID=266542
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>