Solved

sample jsp via Tomcal

Posted on 2012-03-24
4
400 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 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

718 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