Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to run jsp file ?

Posted on 2004-04-04
14
5,051 Views
Last Modified: 2012-06-27
Hi,
         I am really new to jsp. i can create a hello world jsp page but just don't know how to run it.
somebody to me just to download and install jdk and tomcat.

         Now in my system, I have aleady installed jkd1.3.1 and tomcat 5 and i have written one Hello World jsp file( Ex: helloworld.jsp).
       
          Please give instruction on how to run my file ? I think a detail one is better for me as i mentioned earlier that i am really new to jsp.

Oh! my OS is windows XP pro with IIS installed as well.

Thanks,
0
Comment
Question by:mrpc_cambodia
  • 6
  • 3
  • 2
  • +2
14 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 10755229
1. Create folder "hello" on {tomcat5}/webapps/
2. Copy your hello world jsp to {tomcat5}/webapps/hello/
3. Restart tomcat
4. On the browser, type url
       http://localhost:8080/hello/helloworld.jsp
0
 
LVL 6

Expert Comment

by:jarasa
ID: 10756114
Well besides kotan advice you should have your JAVA_HOME env varible pointing to your JDK you can add it to you XP system or directly on the startup.bat file:

SET JAVA_HOME=Your jdk path

Javier
0
 

Author Comment

by:mrpc_cambodia
ID: 10762321
I did as kotan comment already and i also set the class path to my jdk directory.

but when i request the page using "http://localhost:8080/hellojsp/index.jsp", it shows page error 404, page not found and at the bottom line it shows "Apache Tomcat 5.x.x.x"
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 6

Expert Comment

by:jarasa
ID: 10763729
Do you get the welcome page of tomcat if you just put?: http://localhost:8080/ 
0
 

Author Comment

by:mrpc_cambodia
ID: 10763749
Yes,
0
 
LVL 2

Expert Comment

by:vikram_1982
ID: 10763781
Hai. I think we have a had a similar thread here at EE. Try taking a look at http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_20929737.html .
0
 

Author Comment

by:mrpc_cambodia
ID: 10781862
Oh! i am so sorry for long pause.

I have checked the link provided already. I followed their instruction but finally still no luck.

I think because my pc also has IIS isntalled.

So what should i do ?

Thanks,
0
 
LVL 1

Expert Comment

by:Sachin_Yash
ID: 10795998
HI !!!

        These r the steps u want to follow to start the JSP & Servlet programing.

         1. Save your Hello.jsp file into c:\tomcat fold.\webapps\examples\jsp\Hello.jsp

         2. Start your Tomcat Server (By start.bat file)
             (first of all from command prompt  give command as  c:\tomcat fold.\bin>startup

        3. If Success go to url & give command as :-
                    http://localhost:8080
            U will see welcome Page...
 
           Elase
                 reinstall the Tomcat & java & try again.
     
        4. Lastly give url as
                 http://localhost:8080/examples/jsp/Hello.jsp.

         
 
0
 

Author Comment

by:mrpc_cambodia
ID: 10803089
I can see the welcome page with this url:http://localhost:localhost:8080, but when i try http://localhost:8080/examples/jsp/hello.jsp, my browser shows one error message "HTTP ERROR 404. Page not found".
0
 
LVL 2

Expert Comment

by:vikram_1982
ID: 10811332
Tell me.. When u give http://localhost:8080 do u see IIS s homepage or Tomcat's homepage?? Usually, IIS takes precedence over Tomcat if both are present.

U may need to stop the IIS server to run tomcat

Try it.
Vikkki
0
 

Author Comment

by:mrpc_cambodia
ID: 10838509
Using this url http://localhost:8080, i can see the tomcat index page. if i delete the port number "8080" then i can see my iis default page.

0
 
LVL 1

Expert Comment

by:Sachin_Yash
ID: 10839424
Hi !!!

           That means u can see the page as
                  http://localhost:8080/index.jsp
           isn't it ???
           If yes then u r succssfully started you server..
                Just give the url as :
                    Http://localhost:8080/examples/jsp/hello.jsp
            U will get the output...

           
0
 

Author Comment

by:mrpc_cambodia
ID: 10847305
To see the index page of tomcat, there is no problem but when i try the second url you provided, the page just shows "Error 404, page not found".

One more thing, can i know what web server (Apache or IIS) is used to run this website ? cause i see that this website uses jsp language.

Thanks,
0
 
LVL 1

Accepted Solution

by:
Sachin_Yash earned 50 total points
ID: 10848541
Hi !!!

         These both (Apache & IIS) r Web server but the vendors r different...
          Make sure that your hello.jsp file is store in
the following path :
          c:\tomcat fold.\webapps\examples\jsp\Hello.jsp

         otherwise just click on JSP Examples Hyperlink
from your index.jsp page (if u can see the JSP Examples page ) then in that URL just replace index.html with Hello.jsp & hit enter.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I am having a difficulty creating a responsive Page for my website. 10 87
dateFashion java challenge 9 146
Unhandled exception type Exception 18 42
by zero exception 10 52
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question