• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to deploy a servlet in JBOSS using GEL?

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ,

I am a newbie in J2EE , can some one explain me how to deploy a servlet in JBOSS 4.0.3 , i have this small servlet to print HELLO WORLD .


thanks in advance

regards

[ April 10, 2006: Message edited by: faisal usmani ]
[ April 12, 2006: Message edited by: faisal usmani ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the JBoss forum.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)

C:\jboss\jboss-4.0.2\server\default\deploy

and start up the server.

Then, when you 'hit' the server, your URL should be something like:

http://localhost:8080/mywebapp/servlet/HelloWorldServlet

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 ]
 
M Anderson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic