Welcome to the wonderful world of J2EE. Everyone was a newbie at one time or another...
You need to create a web application, with your servlet in it, of course.
The easiest way to tell you to do this, without going into all of the details about how to create a web app is to use your IDE, if you have one. For example, using Eclipse Web Tools Project, you can create a Web App project, the create a Servlet. The tool will create all the folders you need, config files (web.xml), etc. Then you need to jar them up into whatever you want to call your web app with a .war extention (lingo for this is a 'war' file), for example, "mywebapp.war" starting with the root directory. So, your war file should have at the root context:
/WEB-INF/lib (any jars you need in this folder /WEB-INF/classes (any classes you developed, and your servlet class) /WEB-INF/web.xml (the web app config file) anyotherfileshere.jsp
Move your war file to your server's deploy folder. If using the default server, move it to (note that I've been using 4.0.2... your installation folders may be different)
and start up the server.
Then, when you 'hit' the server, your URL should be something like:
In order to really understand what's going on here, it'd be a good idea to pick up a good beginning J2EE book (I like the Head First series, but there lots of good J2EE books out there).
[ April 10, 2006: Message edited by: M Anderson ] [ April 10, 2006: Message edited by: M Anderson ]
Mike -- SCJP, SCWCD
Joined: Mar 17, 2006
One more note...
If you're just learning how to do a J2EE web app for the first time, you might have an easier time with using Tomcat directly. Download Tomcat 5.5 and just use that. JBoss also has EJB capability, and the director structure can be confusing, even for a veteran like me.
In the case of Tomcat, you just copy your .war file do the webapps folder and bring up the server. Tomcat will also do hot deployments, like JBoss, meaning if you replace the war file while the server's already running, the server will install the new webapp right now, on the fly.
Joined: Jan 14, 2006
Thanx mike ,
But i am using GEL editor , could you please explain how to do it on GEL , or how do it without using any of the editor's.
Thanx in advance [ April 12, 2006: Message edited by: faisal usmani ]