Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sample jsp via Tomcal

Posted on 2012-03-24
4
Medium Priority
?
406 Views
Last Modified: 2012-03-28
I wonder if someone could help me with the following questions.

This is a part of path for your consideration:
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\begjsp-ch04\classes

1. I have installed Tomcat and not sure how to start it.

2. When I reboot my computer, I get “Access is denied, Unable to open service 'Tomcat7' “
Is this my laptop firewall preventing it from running? What can I do to run Tomcat without turning off my security software off?

3. I have made a jsp page coppied to:
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\begjsp-ch04\classes\carPage2.jsp

4. There is also a Car class prepared not sure where it goes.

Any kind of help is appreciated.

Thank you,
0
Comment
Question by:Mike Eghtebas
[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
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37762945
It looks as if you're following a book or tutorial -- which one?

Some answers:
>>C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\begjsp-ch04\classes

That path should have ROOT as part of it.  So you should create a subdirectory under webapps, like this:
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT\

Jsp pages -- things called xxx.jsp -- can be put in the ROOT directory

Under ROOT you need a WEB-INF directory
[tomcat home]\webapps\ROOT\WEB-INF
under WEB-INF goes the classes directory
[tomcat home]\webapps\ROOT\WEB-INF\classes
Also in WEB-INF goes the web.xml file for your webapp.  If you're working from a book or tutorial, there should be a sample web.xml file, something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
</web-app>

This is a nice tutorial on setting up Tomcat 7:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/
You don't have to use Eclipse, which is a Java development tool, but you're welcome to try it if you want.  The coreservlets.com site also gives directions for setup without Eclipse, which you could follow for your work.

Check if Tomcat is started and running correctly.  This is a good set of steps for that:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/test-server.html

>>2.  I get “Access is denied, Unable to open service 'Tomcat7' “
Yes, the normal install from Tomcat is to run as a service.  However, the user which tries to run it does not have sufficient privileges.  There are various solutions, see below for some options:
http://superuser.com/questions/284657/tomcat7-service-cannot-start-on-windows-7-even-when-it-is-set-to-log-in-as-admin

>>3.  jsp page
As mentioned above, a .jsp page should go someplace like this:
[tomcat home]\webapps\ROOT\xxx.jsp

>>4. Car class
I'm assuming that you mean a .jar class.  It's best to put it in the lib directory for your webapp:
[tomcat home]\webapps\ROOT\WEB-INF\lib
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 37764568
>>>>>1. I have installed Tomcat and not sure how to start it.

go to  command promt C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin> java    -jar bootsriploader.jar


this will start your application . or you can use startup.bat in C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin folder
0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 2000 total points
ID: 37764595
>>>>>2. When I reboot my computer, I get “Access is denied, Unable to open service 'Tomcat7' “
Is this my laptop firewall preventing it from running? What can I do to run Tomcat without turning off my security software off?


this problem occur in windows 7 only its OS problem not tomcat problem jsut config ur tomcat in ur IDE(Net beans ) start and stop when you need .

try to create web application and write your code there dont put in tomcat . thats is for only deployment(after finish all your development you will put it there )

http://netbeans.org/kb/docs/web/mysql-webapp.html

http://netbeans.org/kb/docs/web/quickstart-webapps.html
0
 
LVL 27

Expert Comment

by:mrcoffee365
ID: 37778387
Presumably your problem is fixed.  It's odd that you did not give the points to the first correct answer -- did you know that you can give it to the first person who answers, or to 2 people if you feel a second person contributed something different?  Just FYI for the next time you're interested in help from experts.
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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

610 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