• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

servlet basics

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also do check out the ServletFaQ here at the Ranch!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic