How to use Tomcat

Hello friends
I want to use some functions which are in Java Servlet Specification 2.3.
I found that I have to use Tomcat for this. Any one who know about it please help, to find where I will get Its setup and required information to run the servlet in this tomcat.
with thanks
Vishwajeet

Hi,
1. go to: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.2/bin/
Download tomcat
Ex: jakarta-tomcat-4.0.2.zip (Win)
2. unzip it and put some where, you can rename the dir to C:\tomcat
3. set the path to CATALINA_HOME tomcat:
CATALINA_HOME=c:\tomcat
4. run tomcat:
%CATALINA_HOME%\bin\startup (Win)
$CATALINA_HOME/bin/startup.sh (Unix)
5. go to http://localhost:8080/ on your browser
...Enjoy
Hill

Similar Messages

  • How to use Tomcat for naming services

    Hi,
    I want to use Tomcat server for a naming service,but how??.
    What i want to do is
    It will register 2 services to a the naming server.
    Later lookup for it from another code.
    I want to know how i can register the same using Tomcat...
    Thanks in Advance
    Mandrake

    http://tomcat.apache.org/tomcat-5.0-doc/jndi-resources-howto.html

  • How to use tomcat JNDI  resource in eclipse

    hi all, In my project i am using JSF,Tomcat,eclipse... i am planing to implement annotaions as part of my application
    I want to use Jndi resource as part of my project by using java annotaions
    for this i configured my server.xml in tomcat as
    <Context docBase="ALWREPORTSNEW" path="/ALWREPORTSNEW"
    reloadable="true"
    source="org.eclipse.jst.jee.server:ALWREPORTSNEW" >
    <Resource auth="Container"
    driverClassName="com.mysql.jdbc.Driver" maxActive="10000"
    maxIdle="3000" maxWait="10000" name="jdbc/enrollmentschema"
    password="adminadmin" removeAbandoned="true"
    removeAbandonedTimeout="300" type="javax.sql.DataSource"
    url="jdbc:mysql://localhost:3306/enrollment_schema_old"
    username="root" />
    </Context>And i configured web.xml as
    <resource-ref>
    <description>Enrollment Schema Connection pooling</description>
    <res-ref-name>jdbc/enrollmentschema</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>And some where in my project i am using annotaion as follows. i am getting NULL when trying access that annotaion .
    @Resource(name = "jdbc/mobileEnrollProd") DataSource mobileds;
    @Resource(name = "jdbc/enrollmentschema")
    private DataSource enrollds;
    public String UploadBankWise() {
    System.out.println("--------- ds "+enrollds);// *i am getting NULL*
    }but same code working with Glassfish and net benas..
    can any body hint me where i did mistake
    thanks in advance

    Go to Window-Preferences-Java-Debug-Step Filtering. When the dialog opens, press F1 for help. Good luck!

  • How use Tomcat with MySQL

    Can anybody suggest me as how to use Tomcat with MySQL server.
    Thanks in advance.
    Khiz_eng

    add the classpath to the JDBC-driver to the tomcat-
    environment (I did it in tomcat.sh)
    Then put your code accessing MySQL into a servlet....
    You can put the user-ID and the password into a session-
    object or read them in as parameters.
    The book 'core Servlets and Java Server Pages' from
    Marty Hall gave me a lot information.
    Regards
    Fredy

  • Using Tomcat in Eclipse?

    Hi,
    Can you tell me how to use Tomcat using Eclipse?
    Whether we have to plug-in Tomcat in Eclipse?
    I'm using Eclipse3.1.1 Version.
    Thanks,
    Hari

    you can use "com.sysdeo.eclipse.tomcat_3.1.0" plugin. Just download the zip file and expand it in plugin folder of eclipse. I am using it on ecipse 3.1.2 it works fine.
    By the way you need to set certain parameters in Eclispe.
    GO to windows-preferences-java
    Installed JREs - add the path of your j2sdk1.4.(eg.c:j2sdk1.4.2_11)
    then Go to windows--preferences--tomcat-
    advanced - fill your tomcat base
    JVMSettings - JRE drop down box select the j2sdk you added
    JVMSettings - classpath - add tools.jar from your j2sdk lib folder
    JVMSettings - Boot ClassPath - add rt.jar from your jre lib folder
    SourcePath
    Select your java project you are working with
    Then click ok.
    Try to run eclipse in clear mode.
    Please let me know if this worked. I also did the same procedure and It is working fine.
    Meena

  • How can i do the upload file function using tomcat library??

    how can i do the upload file function using tomcat library??

    Did you read the document for the library?
    If you can't figure it out, why don't you ask the people who provide the library?
    This has nothing to do with JavaMail.

  • How to use Classes stored in "Classes" folder in JSP with tomcat ?

    Hello friends
    im using tomcat as server and MySQL as a Backend. now i am using the date calculation in Diff.class files which i have stored in catalina_home/webapps/prj_dev/Prj_files/classes/diff/DIff.class.
    now i am getting error that :
    Generated servlet error:
    Only a type can be imported. diff.Diff resolves to a package
    wht i have to do ?

    I don't include the "classes" word in my import anymore.. Waa.. I'm going nuts.. T.T
    Now, I'm trying to use the class through useBean..
    this is how my application looks like:
    /webapps
    -----/hangman-jsp
    ------------index.jsp
    ------------/WEB-INF
    -------------------web.xml
    -------------------MysteryPhrase.java
    -------------------/classes
    ---------------------------/beans
    ----------------------------------MysteryPhrase.class
    -----------/images
    -------------------hangman.gif
    This is what is in my MysteryPhrase:
    package beans;
    import java.lang.String;
    import java.lang.StringBuffer;
    public class MysteryPhrase {
         private String answer;
         private StringBuffer mysteryPhrase;
         private int guesses;
         private char[] alphabet;
         public MysteryPhrase () {
         this.alphabet = new char[26];
    public void setMysteryPhrase (String mysteryPhrase) {
         this.answer = mysteryPhrase;
         this.mysteryPhrase = new StringBuffer(mysteryPhrase.length());
         for (int i = 0; i < mysteryPhrase.length(); i++) {
              this.mysteryPhrase.setCharAt(i, '_');
    public void setGuess (char guess) {
         for (int i = 0; i < answer.length(); i++) {
              if (answer.charAt(i) == guess) {
                   mysteryPhrase.setCharAt(i, guess);
         guesses++;
    public String getMysteryPhrase () {
         return mysteryPhrase.toString();
    public String getAnswer () {
         return answer;
    public int getGuesses () {
         return guesses;
    This is what is in my index.jsp (It is not yet finished..I just started..)
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <jsp:useBean id="phrase" class="beans.MysteryPhrase"/>
    <jsp:setProperty name="phrase" property="MysteryPhrase" value="Hello!"/>
    <html>
         <head>
              <title>JSP/JSTL Implementation of Hangman</title>
              <style type="text/css">
                   div {
                        color: white;
                        background-color: gray;
                        position: absolute;
                        border-style: solid;
                        border-width: thin;
                        width: 20%;
                        height: 30%;
                        text-align: center;
                   #guessBoard {
                        top: 28%;
                        left: 42%
                   #mysteryPhraseBoard {
                        top: 50%;
                        left: 25%;
                        z-index: 2;
                   #statisticsBoard {
                        top: 57%;
                        left: 58%;
                        z-index: 2;
                   #categoryBoard {
                        top: 23%;
                        left: 10%
                   #hangman {
                        top: 7%;
                        left: 70%;
                   #char {
                        width: 20px;
                   body {
                        background-color: black;
              </style>
         </head>
         <body>
              <div id="categoryBoard">
                   <form method="post">
                        Please choose a category:
                        <select name="category">
                             <option>Category 1</option>
                             <option>Category 2</option>
                             <option>Category 3</option>
                             <option>Category 4</option>
                             <option>Category 5</option>
                             <option>Category 6</option>
                             <option>Category 7</option>
                             <option>Category 8</option>
                        </select>
                        <input type="submit" value="Change"/>
                   </form>
              </div>
              <div id="mysteryPhraseBoard">
                   The mystery phrase is
              </div>
              <div id="guessBoard">
                   <form method="post">
                        Enter a letter: <input id="char" type="text" name="letter"/>
                        or
                        Enter a word: <input type="text" name="word"/>
                        <input type="submit" value="Guess"/>
                   </form>
              </div>
              <div id="statisticsBoard">
                   Guesses: 0
                   Remaining Letters: 8
              </div>
              <div id="hangman">
                   <img src="images/hangman.gif"/>
              </div>
         </body>
    </html>

  • How to use debug my jdevloper devloped jsp applications using tomcat 4.0?

    hello,
    how to use debug my jdevloper devloped jsp applications using tomcat 4.0?
    how to run with using tomcat path with browser?
    can any one help?
    thanks
    pullareddy

    Hi Pullareddy,
    Charles' answer will work for Servlets in Tomcat, but debugging JSPs is a bit more complicated than debugging Servlets.
    Here's what you need to do:
    (I don't have Tomcat, so I don't know the details of Tomcat configuration files and I can't guarentee that Tomcat provides the flexibility so that you can configure it for debugging JSPs. Each application server is configured a bit differently. Hopefully you can adjust the following instructions to Tomcat.)
    1. You need to replace Tomcat's JSP engine with OJSP and you need to setup debugging parameters for OJSP.
    This is not specifically in the JDev documentation, but you may be able to apply the information found in the topic "Remote Debugging in OC4J".
    Here are some tips:
    A. You'll probably need to specify the following jars in some Tomcat config file: ojsp.jar, ojsputil.jar, xmlparserv2.jar, ojc.jar, and jdev-rt.jar.
    B. The OJSP class name is oracle.jsp.runtimev2.JspServlet.
    C. The debug parameters are:
    debug_mode = true
    developer_mode = true
    encode_to_java = true
    emit_debuginfo = true
    jspjavacompiler = oracle.jdevimpl.jsp.JspOjcCompiler
    2. You need to make Tomcat start the Java command with debugging options. (This is what Charles was talking about. One of the debug options is -XXdebug). This is in the JDev documentation in the topic "Starting a Java Process in Debug Mode". Please read that documentation help topic.
    3. You need to delete any old .java or .class files which were created in the past for your JSP. If you leave old .java or .class files around, then the debugger may not be able to stop at breakpoints in your JSPs. So, be sure to clean up old files.
    4. Set your project settings for remote debugging. This is on the Debugger - Remote panel in the Project Settings dialog box. You probably want either Attach to OJVM or Attach to JPDA. Which radio button you choose depends on what command line options you specified in step 2.
    -Liz

  • How can i run simple HelloServlet  ? using tomcat 5.5.16 & jdk1.5.0.6 ?

    Hi
    I have the jdk 1.5.0.6 and tomcat 5.5.16
    on my machine.
    The locations are as follows.
    1) jdk ---> C:\j2sdk1.5.0_06
    2) tomcat ---> C:\prgram files\Apache Software Foundation\Tomcat 5.5
    3) IE 6.0
    4) java class ---> C:\HelloWorld.java
    The Queries i have are as follows.
    1) How to set PATH?
    2) How the set CLASSPATH?
    3)how compile simple HelloServlet ?
    4)how run simple HelloServlet ? using tomcat ..
    please give me details
    shrinath
    Thanks in advance

    Read the Chapter 11 Java Servlet Technology
    Or search the web for servlet tutorial

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • Need basic info how to run my servlet with SSL/http (I am using Tomcat 4.0.

    I have a servlet that gets a user id and password
    and query information from an HTML form
    and then writes back the answer to the query as a new web page. We want to
    make the transaction secure because it is customer confidential information.
    What do I need to do in my servlet to get it to run under SSL?
    (I am using Apache Tomcat 4.0 on WinNT and
    can use either JDK 1.2.2 or 1.3.1....)
    I know this is a very basic question, but what I'm reading does not
    make it clear to me what I have to do to my servlet code to use SSL, or
    whether the server and client do all the work "outside" my
    servlet code so that no changes to the servlet would be required(???).
    Can I use Tomcat 4.0 for SSL? Any help getting my head pointed in the right
    direction will be much appreciated. (You may reply to this forum or
    to my email: [email protected]
    Much thanks!

    When one follows this how-to, one got the following result:
    The same page, say xyz.html, can be accessed in two ways: one is from
    http://localhost:8080/xyz.html, and the other is from https://localhost:8443/xyz.html.
    How can one allow people to be only able to access from https://localhost:8443/xyz.html, to be not able to access from http://localhost:8080/xyz.html? There is one sentence mentioned some where that Servlet 2.4 specification can do this. But Servlet 2.4 specification would not provide any help. Any clue?

  • How to run jsp using  tomcat server?

    hai friends,
    i'm using jsp for my application and for that i'm using tomcat server.
    i was runing my jsp files like this
    http://localhost:8080/examples/jsp/myapp/index.jsp but instead of this
    i need to run my jsp files like this
    http://localhost:8080/myapp/index.jsp
    what r the changes that i should do in tomcat installation to run myapplication in such a way.
    thanks in advance

    you need to redefine the server root...
    for that do the following...
    copy all the directory tree rooted at
    JAKARTA-HOME/webapps/ROOT/examples/jsp/myapp/ to
    JAKARTA-HOME/webapps/ROOT/myapp/
    -OR-
    in the server.xml, search for "Tomcat Root Context" and un-comment the code defining Root Context...
    change the docBase value from "ROOT" to "ROOT/examples/jsp"
    that shud help...
    -Pranav
    hai friends,
    i'm using jsp for my application and for that i'm
    using tomcat server.
    i was runing my jsp files like this
    http://localhost:8080/examples/jsp/myapp/index.jsp but
    instead of this
    i need to run my jsp files like this
    http://localhost:8080/myapp/index.jsp
    what r the changes that i should do in tomcat
    installation to run myapplication in such a way.
    thanks in advance

  • How can I use tomcat with Java ServerFaces

    Is there a tutorial on Java ServerFaces using tomcat?

    the JWSDP1.3 download includes Tomcat
    Follow links from here - http://java.sun.com/webservices/index.jsp
    NOTES
    #1 JWSDP1.3 includes a Beta release of Tomcat 5
    So you may want to also download the latest version from the apache/Tomcat websites
    http://jakarta.apache.org/tomcat/index.html
    #2 JWSDP1.3 contains JSF EA4 - JSF 1.0 Beta is now available
    follow the link on the JWSDP web site above

  • Viewing Excel Files using Tomcat - Problem with caching

    Hi all,
    A small part of an application I'm writing has links to Excel files for users to view/download. I'm currently using Tomcat v5 as the web/app server and have some very simple code (an example is shown below) which calls the excel file.
    <%@ page contentType = "application/vnd.ms-excel" %>
    <%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
    response.sendRedirect("file1.xls");
    %>
    This all works except but I'm having one big problem.
    The xls file (file1.xls) is updated via a share on the server so each month, the xls file is overwritten with the same name but with different contents. I'm finding that when an update is made to the xls file and the user then attempts to view the new file in the browser they recieve only the old xls file. It's caching the xls file and I don't want it to. How can I fix this so that it automatically gives the user the new updated file.
    The only way I've managed to get Tomcat to do this is to delete the work directory and delete the file from my IE temp folder and then restart Tomcat - this is a bit much!
    Any help would be greatly appreciated.
    Thanks.

    I'd a problem with caching a few years back, for a servlet request which returned an SVG file.
    As a workaround, I ended up putting appending "#" and a timestamp / random number after it. The browser assuming each request was new, and didn't use the cache.
    Eg.
    http://myserver/returnSVG.do#1234567
    where 1234567 is a timestamp / random.
    Not sure whether you can do this on a file based URL... but maybe worth a shot...
    regards,
    Owen

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

Maybe you are looking for

  • QA11/ Production order Cost

    I was wanting to know when you confirm a work order through co11n and post the qty. this automatically creates an inspection lot for us. Using QA11 or QE72 we then give the inspection lot a usage decision - if everything is OK and all material goes t

  • Many to Many View Link

    Hello All I just wish to know how to create a many to many view link. I have created a many to many association. In the view link wizard it is supposed to show me an association in 2 tables which are associated via the intersection table in the assoc

  • How can I throw application preferences away in OSX 10.8, how can I throw application preferences away in OSX 10.8

    Does anyone know how to throw preferences away in Mountain Lion? I used to be able to throw application prefs away in order to reset the application to original defaults. I do not see a way to do this now since my User Library is no longer in the Use

  • Safari is running extremely slow

    I have a Macbook Pro 13" purchased Early 2011.  I run OS X Version 10.7.5, processor 2.3 GHz Intel Core i5, 4GB 1333 Mhz DDR3 memory.  My Safari runs extremely slow and almost non-existent at times.  I have done the usual things like clear my cache,

  • I can't install itunes for Windows 7. Says program needed is missing

    When I tried to update my functional itunes on Windows 7, the installer reported that a program required for the installation was not found and the install failed. Eventually it was suggested that I remove the existing itunes, which I did. The proble