Solved

How to run jsp file ?

Posted on 2004-04-04
14
5,032 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now