Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet compilations

 
anshu sahai
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Can Any one help me plz?
I have configured my eclipse,i am able to run the jsp programs through eclipse using tomcat server.
But i am not able to run the servlets.
When i press compile button,its not giving any error,but when i am looking for output ,it says 404 error.

Do i need to write my servlet class and mapping information manually in the web.xml.

I dont know what i am missing.

Plz help me

Thanks
Anshu
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you need to write them in your web.xml file first.

Dave
 
anshu sahai
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave..

Do we need to write manually or when we compile the servlets will it automatically takes care of it.

Can you plz expain step by step what i need to do to compile and run servlets.

Thanks
Anshu
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to explicitly add the servlet to your webapp configuration.
Some IDEs and appservers may offer facilities to do that for you through some dialog box, but often you'll have to manually edit the web.xml yourself.
Any halfway decent tutorial or book will tell you how to do that, you should really read some to get to know what you're doing.
 
Mouly Kumaraswamy
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't about Eclipse, but WSAD (based on Eclipse 2.1) comes with a graphical editor for web.xml. Use it if Eclipse come with a DD editor.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I think you're better off learning how to write, compile, deploy, and debug servlets without an IDE when you're starting out.

Since this question is more about 'deploying from within Eclipse' I'll move this to the IDE forum where you're likely to get better help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic