users@glassfish.java.net

Re: servlets - total noob

From: David Heffelfinger <dheffelfinger_at_ensode.net>
Date: Sat, 29 Mar 2008 19:36:05 -0400

It is recommended that you put your servlet in a package (i.e.
com.mycompany.servlets.ServletTest), then use the fully qualified name of
your servlet in the <servlet-class> element of web.xml.

The exact URL to use depends on the context root of the application. The
context root defaults to your war file's name, modifying the default context
root is app server specific, with GlassFish it can be accomplished by
modifying sun-web.xml.

The URL you provided (http://server:8080/servletTest/servletTest) would be
correct if your context root is servletTest, more than likely your war file
needs to be named servletTest.war for this URL to work.

An IDE such as NetBeans or Eclipse will help with all the "grunt work" of
adding the servlet to web.xml.

NetBeans integrates very nicely with GlassFish, I would suggest you give it
a try.

Hope that helps,
David

On Sat, Mar 29, 2008 at 7:07 PM, <glassfish_at_javadesktop.org> wrote:

> thanks, but i still can't get a response from the servlet. what url
> should i be trying to reach it at? i'm trying
> http://server:8080/servletTest/servletTest. is this right?
> [Message sent by forum member 'notatoad' (notatoad)]
>
> http://forums.java.net/jive/thread.jspa?messageID=266617
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>


-- 
http://ensode.net - A Guide to Java, Linux and Other Technology Topics
http://java-ee-5-glassfish.packtpub.com/ - Java EE 5 Development Using
GlassFish Application Server
http://jasperreportsbook.packtpub.com - JasperReports For Java Developers