Results 1 to 3 of 3
  1. #1
    Marcus is offline Member
    Join Date
    Jun 2007
    Posts
    92
    Rep Power
    0

    Default How to run my first JSP

    I just installed the tomcat, but I dont know where to save my first jsp file, and how to run it in the browser by starting with http://

    Help me, Thanks
    Marcus:cool:

  2. #2
    Albert is offline Senior Member
    Join Date
    Jun 2007
    Posts
    114
    Rep Power
    0

    Default

    Locate the directory where you have installed Tomcat.
    In that directory...you should find another directory called webapps.

    So, assuming that you have installed Tomcat on the C drive, you should now be in C:\Tomcat\webapps\

    That is the directory where you should create your JSP projects. So, create a new Directory in the "webapps" directory for your new project....and create any jsp files you wish to have...

    Note...the structure of your project should be as follow (assuming that your project name is called "test_project"

    C:\Tomcat\webapps\test_project
    C:\Tomcat\webapps\test_project\index.jsp
    C:\Tomcat\webapps\test_project\WEB-INF
    C:\Tomcat\webapps\test_project\WEB-INF\web.xml
    C:\Tomcat\webapps\test_project\WEB-INF\classes
    C:\Tomcat\webapps\test_project\WEB-INF\lib
    C:\Tomcat\webapps\test_project\WEB-INF\etc


    The main file that you should note is "web.xml"....as you will need to specify all the necessary configurations for your project there. Look at the example projects installed when you installed Tomcat for a sample.

    Greetings
    Albert:rolleyes:

  3. #3
    Felissa is offline Member
    Join Date
    Jun 2007
    Posts
    95
    Rep Power
    0

    Default

    By default...Tomcat will run at port 8080....unless you have changed during the installation

    First, make sure that tomcat is currently running

    Second, point your browser to http:// localhost:8080
    Once there, you will be able to set a default tomcat page. if you cannot see it...it could be due to any of the following reasons:-
    1- The port is not 8080
    2- Tomcat is not currently running

    if it is the first one...please go and locate the following file

    C:\Tomcat\conf\server.xml

    around line 76...see what is the port on your system...

    Java Code:
    <Connector port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    If you don't like adding port 8080...or http:// localhost: 8080 you can change it to 80...and then you can write http:// localhost:8080

    Another important file...you should look at is the following
    C:\Tomcat\conf\tomcat-users.xml

    Well..if you want to access the Tomcat Manager...then you should add the following two line

    Java Code:
    <role rolename="admin"/>
    <user username="YOUR_USER_NAME_HERE" password="YOUR_PASSWORD_HERE" roles="admin,manager"/>
    As for seeing your project, depending on what you have called your project...you should be able to see at http://localhost:8080/PROJECT_NAME

    Greetings
    Felissa:p
    Last edited by Felissa; 07-04-2007 at 10:14 AM.

Posting Permissions

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