Solved

How to run jsp file ?

Posted on 2004-04-04
14
5,044 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String format issue 13 91
lessBy10  challenge 15 95
Is it possible to "sandbox" html content within a JSP? 4 101
mysql jsp example issue 32 33
Read about the ways of improving workplace communication.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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