Solved

How to run jsp file ?

Posted on 2004-04-04
14
5,065 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
[X]
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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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