Solved

How to run jsp file ?

Posted on 2004-04-04
14
5,010 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do you get the welcome page of tomcat if you just put?: http://localhost:8080/
0
 

Author Comment

by:mrpc_cambodia
Comment Utility
Yes,
0
 
LVL 2

Expert Comment

by:vikram_1982
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Expert Comment

by:Sachin_Yash
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

12 Experts available now in Live!

Get 1:1 Help Now