Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet basics

 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody, i am new to servlets. i have some basic servlet prog which i have tried to execute in my system. but it reported saying that servlets packages are not found. can someone please tell me which sdk should i install in my system to run my servlet programs.. please provide links if any.. thanks in advance;
 
Matteo Di Furia
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need a SDK, you need a container to run your web application.
Have a look at Tomcat, tomcat.apache.org
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
download the tomcat from the website and dowload the jdk
set the JAVA_HOME for jdk path
set the classpath for servlet-api.jar
see the headfirst servlet and jsp
 
ruban raj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For executing servlet programs ,it needs server like jboss , tomcat or some other server.

Steps to Exceute Servlet programs:

1.Download jboss or tomcat server ,they are opensource products.

2.Set JAVA_HOME path

3.Set Server_Home path .For example if you use tomcat ,you have to set TOMCAT_HOME path.

4.Put servlet-api jar in lib folder.

5.start the server using startup.bat file.

6.Point out servlet url in address bar.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also do check out the ServletFaQ here at the Ranch!
 
Douglas Carvalho
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way I can compile the servlets. Before I set the pathes, that was a variable called Path. So, to compile my Java programs I did this way:

JAVA_HOME C:\Arquivos de programas\Java\jdk1.6.0_07\bin
Path "lots of things";%JAVA_HOME%\\bin

Then, I installed Tomcat but I can�t compile the servlets classes. I put the Tomcat on C:, so the path to servlet-api.jar is this:

C:\Tomcat6.0\lib\servlet-api.jar (I was surprised that there was no common directory like the FAQ said)

So, I don�t know what to do. I tried to put this path on the variable Path above, in the JAVA_HOME and I created a new variable too, but none has worked. What I did wrong? Thank you very much guys, and sorry for some grammar mistakes. I�m Brazilian and I�m learning English toghether with servlets (laughs).
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to put this path on the variable Path above, in the JAVA_HOME and I created a new variable too, but none has worked.


Set the path (to your servlet-api.jar) in the CLASSPATH environment variable(create a new one if you don't have one). Then you will be able to compile your servlets
[ October 09, 2008: Message edited by: Vijitha Kumara ]
 
shar ball
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Douglas Carvalho,

If you still have issues trying to run your first servlet, you can follow the servlets demo here..

http://www.sharmanj.com/ServletsDemo/ServletsDemo1.html


Thanks,
Sharad.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic