Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default How to run servlets in Linux/WinXP

    I have apache (all versions), and i have Win Xp and Red HAT 5 Linux.
    Can anyone tell me how to do the settings as in where to place my .java and .class files ,plus do i have to make changes to web.xml file every time i make a servlet.

    Any response will be highly appreciated.

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    364
    Rep Power
    5

    Default

    Quote Originally Posted by msheerazhaider View Post
    I have apache (all versions)
    Apache as HTTP server?

    It does not come with support or module for running Java's JSP and servets.
    You need servlet container for that. There are many on market.

    But if you like Apache you can easily install Tomcat.
    Tomcat is written in Java, and Apache HTTP and modules are written in C.
    Tomcat is the Apache's implementation of the JSP and Servlet technology specification.

    You can even integrate Tomcat it in HTTP Apache.

    regards

  3. #3
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    I got Tomcat as well.
    In the original post i asked about few things like where to put my .java and .class file for servlets, and do i need to change web.xml,

    Can you please answer for that.

    Regards

  4. #4
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    364
    Rep Power
    5

    Default

    OK, first test your Tomcat installation.

    There are few applications that come with Tomcat.
    They are in
    tomcat-home\webapps\examples

    So run those JSP and servlet examples to see if everything is set OK.

    After that you can deploy some new application to Tomcat.

    It will be very useful to understand directory structure of project
    once it is deployed in Tomcat.

    Here is a post from the other day explaining it:
    WebContent/WEB_INF/classes

    Best way to deploy application to Tomcat is let you IDE (Eclipse, Netbeans)
    help you. Once you create 'Dynamic web project' it will have proper directory structure. Then you put your src, jsp and other files in proper place.
    At the end you export your project to WAR file and simply put war into
    tomcat-home\webapps\

    Then you run Tomcat, go to manager page, enter username and pass and go to your deployed new project

    Are you OK with this info? Who will pack those war files for you?

    regards

Similar Threads

  1. servlets
    By priyacvr in forum Java Servlet
    Replies: 2
    Last Post: 09-28-2009, 07:43 AM
  2. Replies: 6
    Last Post: 04-08-2009, 04:05 AM
  3. Servlets
    By javahelp00 in forum New To Java
    Replies: 1
    Last Post: 02-28-2009, 06:28 PM
  4. servlets or jsp
    By krishnapal in forum Advanced Java
    Replies: 1
    Last Post: 12-13-2007, 02:31 PM
  5. Servlets
    By nagaroopanandha in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 02:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •