Home Answers Viewqa Java-Beginners When i click on Monitor Tomcat, it shows

 
 


Mohit Jain
When i click on Monitor Tomcat, it shows
1 Answer(s)      a year and 2 months ago
Posted in : Java Beginners

To run servlet i have seen the tutorial from http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml

Hello i followed each and every step same to same as given, i have installed java 7 and tomcat 7, when i click on Monitor Tomcat it shows Application System Error , Access is denied ,Unable to open the service 'Tomcat 7'

and when i Open your Browser (Google Chrome) and type the following URL : http://localhost/ then i get the Apache tomcat page,

but when i finally want to see my class output finally , Then i get HTTP Status 404 and can't get my result , Please help me what should i do..?

View Answers

March 13, 2012 at 10:46 AM


Put servlet-api.jar inside the lib folder of apache tomcat.

1)create a servlet.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet{ 
  public void doGet(HttpServletRequest request, HttpServletResponse response)
                                   throws ServletException,IOException{
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("<html>");
    pw.println("<head><title>Hello World</title></title>");
    pw.println("<body>");
    pw.println("<h1>Hello World</h1>");
    pw.println("</body></html>");
  }
}

2)Go to the webapps folder of your apache tomcat and create a web application folder but it should having an appropriate name like examples.

3)Create web.xml and classes folder inside the WEB_INF folder of web application folder.

4)Copy the servlet to the classes folder.

5)Edit the web.xml to include servlet name and url pattern.

<servlet>
  <servlet-name>HelloWorld</servlet-name>
  <servlet-class>HelloWorld</servlet-class>
 </servlet>
 <servlet-mapping>
 <servlet-name>HelloWorld</servlet-name>
 <url-pattern>/HelloWorld</url-pattern>
 </servlet-mapping>

6)Compile your servlet.

7)Run Tomcat server by clicking the startup.bat file. This is located inside the bin folder of apache tomcat.

8)Open the browser and type the following url:

http://localhost:8080/webapplicationfolder_name/HelloWorld

For more information, please go through the following links:

Servlet Tutorials

http://www.roseindia.net/servlets/HowToRunAServlet.shtml









Related Pages:
When i click on Monitor Tomcat, it shows
When i click on Monitor Tomcat, it shows   To run servlet i have seen... installed java 7 and tomcat 7, when i click on Monitor Tomcat it shows...://localhost/ then i get the Apache tomcat page, but when i finally want to see my
When i click on Monitor Tomcat, it shows
When i click on Monitor Tomcat, it shows   To run servlet i have seen... installed java 7 and tomcat 7, when i click on Monitor Tomcat it shows...://localhost/ then i get the Apache tomcat page, but when i finally want to see my
Tomcat
Tomcat  when i am compiling my program i got .class file.but when i am try to run it it shows the error like Exception in thread "main... type in the url path of the tomcat to see the output
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end... to give the url... but he knows to double click on an icon to start his server
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end... to give the url... but he knows to double click on an icon to start his server
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end... to give the url... but he knows to double click on an icon to start his server
how can i run tomcat server and my home page come when i double click on an icon in servlets
how can i run tomcat server and my home page come when i double click on an icon in servlets  Hi.. there if we are giving a small application to end... to give the url... but he knows to double click on an icon to start his server
Tomcat
Tomcat  When i want to run the servlet program in tomcat i got the following errors type Status report message Servlet InsertServlet...) is not available. But i configure the all files properly
TOMCAT
TOMCAT  When i am deploy the servlet class file in tomcat server i get the following errors pe Exception report message description The server...); int i=pstm.executeUpdate(); if(i==1
why tomcat is shoutdown when access the jsp page - Development process
why tomcat is shoutdown when access the jsp page  I have a menu.when i click on menutitem(jsp page),some time tomcat is shoutdown and sometimes it is working fine  Hi Friend, Please send your code. Thanks
when i hit enter it represent action like click a button
when i hit enter it represent action like click a button  Hi, Plz provide a program in html like I want 2 submit buttons,when i hit the enter button it will represent the action like click the 1st submit
Photoshop a LCD Monitor
monitor stand. Select direct selection tool (A key) and adjust as I have done.... Adjust the setting as I have done it.  Border of the Monitor: To make... with stroke 1 as I have here. Screen of the Monitor: Select again rectangle
Expand / Collapse form div when click on button
Expand / Collapse form div when click on button  Hi, I have a form integrated from Wufoo with iFrame code. If the user misses a field an error message appears but it takes more space than the DIV Formbox. How can I make the DIV
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound  Hai, To Extract war file jar -xvf struts-blank-1.3.10.jar it shows the below one Microsoft Windows [Version 6.1.7600
click on back button go to the login page
click on back button go to the login page  now when i click on back button the page show that page on where i came from and it shows the session expired but i want when i click a back buttob then it should show a login page
problem with starting tomcat - IDE Questions
When I start Tomcat inside of Eclipse using the "Servers" tab, the "Console" window shows that Tomcat is running but the "Servers" window shows "starting... the tomcat configuration. I hope that, this link will help you. Visit
tomcat startup problem - IDE Questions
the tomcat server and deploying the project in server from myecllipse ide,when i try to start the tomcat server from ide, it shows the namingexception,ioexception...tomcat startup problem  hiiiiii My computer os is windows vista.i
Guide to download and install Tomcat 6
on the monitor.  Double click on the Apache Tomcat. The window of Apache Tomcat... of 'Tomcat Completion' displays on the screen. Click on the 'Finish' button... Guide to download and install Tomcat 6   
Tomcat
Tomcat  I am using UBUNTU and I want to install tomcat to run servlet programs
Tomcat with quartz by using eclipse ide
Tomcat with quartz by using eclipse ide  Hai friends I am in a position to run a simple quartz hello job program in eclipse by using tomcat server. when i run this in tomcat server it shows 404 error that is resources
How to change table row color when click on Hyper Link in jsp?
How to change table row color when click on Hyper Link in jsp?  I use... row2 row3.. when click on the link1 automatically change the the row1 color,similarly when click on the link2 automatically change the the row2
tomcat
tomcat   i downloaded and installed taomcat server but my servlet... the following links: http://www.roseindia.net/quickguide/tomcat/tomcatdownloadinstall.shtml http://www.roseindia.net/web-application-server/tomcat/install
click on check box
click on check box  I create a check box in HTML and when i click on my check box relative information in page store in database
Tomcat
Tomcat  i have a problem in starting tomcat server.. May 12, 2011 12... resolving reference java.io.FileNotFoundException: D:\Workspace\conf\tomcat... Global JNDI Resources javax.naming.NamingException: D:\Workspace\conf\tomcat
TOMCAT
) java.lang.Thread.run(Unknown Source) how can we solve this error.so many times i
Setting the Monitor brightness using Java
Setting the Monitor brightness using Java  I am Facing problem in writing a code to change the Monitor Brightness using Java. This problem is solved using ASP.net how to change in java please give me some suggestions
JFrame Button click to start play
JFrame Button click to start play  i made a game and and i add a button in new jframe and i want when i click it it start to play...can anyone help me
Sysdeo Tomcat Launcher Plugin
but it seems that Tomcat developers don't care about it because it happens when...) ClassNotFoundException on javac/Main when accessing JSP : Tomcat is started with a JRE... Sysdeo Tomcat Launcher Plugin   
Tomcat Configuration For Eclipse Server
Tomcat Server? I am using Tomcat 6.0v Thanks In Advance   Install tomcat... tomcat 6.0(choose according to the tomcat version you are using ). I am using tomcat 6.0.x so I selected tomcat 6.0 and then clicks on the next button. 5)Clicks
I don't found in Tomcat 7.0 's bin folder..
.. but when i type http://localhost:8080/ on browser then i get tomcat page. I don't...I don't found in Tomcat 7.0 's bin folder..  While making servlet using tomcat 7.0, i don't find startup.bat file in bin folder. My servlet
ecclipse_tomcat - JSP-Servlet
ecclipse_tomcat  hello sir, i installed ecclipse and tomcat6.0 I have java also installed.. How can I configure Tomcat for ecclipse...For running... runtime click on add button on the right side panel choose Apache Tomcat
Deployment on apache tomcat 7.0.14.0
, on port 8084. but I have one another apache tomcat with what I deply others apps that I download, or something like that. But,this tomcat use port 8080. so, when I... their properties(folder location,port in the same case,...), I see that these tomcat
Deployment on apache tomcat 7.0.14.0
, on port 8084. but I have one another apache tomcat with what I deply others apps that I download, or something like that. But,this tomcat use port 8080. so, when I...Deployment on apache tomcat 7.0.14.0  Hi guys, Sorry but im
Tomcat error - JSP-Servlet
Tomcat error  Sir I have Installed Tomcat 6.0 om my personel computer havind Operating system windows xp. But when I start the tomcat it gives the error :-this is non microsoft product please see event log . what might
tomcat server problem
tomcat server problem  hello rose india, my name is raju. I am placing a problem with tomcat5.5 server. when i am trying to execute my project I have deployed my project in tomcat and then i tried to execute first it showed me
tomcat - Servlet Interview Questions
tomcat  Hi Deepakji, I am swamy,when tomcat memory is fulled with web applications how we can increase memory of tomcat.is it possible. Thank You, Thanks&Regards, Swamy
Tomcat - Java Beginners
:\Tomcat 4)Click Next Button 5)finally finish Thanks Rajanikant...Tomcat  Hi Friends, I want to installed Steps 1... You just follow the Steps for jdk as well as tomcat 1)Run the exe file 2)see
tomcat cache - JSP-Servlet
tomcat cache  hai friends i have a query that is i want to remove the cache memory from Tomcat server Automatically using jsp without deleting it manually from work folder because every time when i make any changes
binding data with textbox on dropdown click
binding data with textbox on dropdown click  Hello friends,Divyesh here. i have jsp page and i would like to bind data with text box on dropdown click. in dropdown employee id are load.and when we select perticular id than how
Click on Page Refresh - JSP-Servlet
Click on Page Refresh  hi ,i am working on jsp with mysql. i m facing a problem whenever i click on page refresh or f5 button, the value on form.... Points to be remember 1)when the data insert successfully in the database
How can I do it? .click();
How can I do it? .click();  I have a very unusual problem. I want...("a"); x.click(); </script> So it's click on an element witch one Id's is "a", but I want that it make mouseup in this element. How can I do it, because if I write
uploading of image showing exception when size increases.
uploading of image showing exception when size increases.  Hi . I have a project in which the user can upload images. it works properly, but when the image size increases to arnd 1 MB or more it shows exception. I am using tomcat
insertin form data into databse and blank all form field when click on submit button
insertin form data into databse and blank all form field when click on submit button  sir, i useing the jsp. i want insert form data into Ms-Access database when click on submit button and blank all form field after inserting
Tomcat Books
. The last one I read was Tannenbaums classic "Operating Systems". The Tomcat book...; Tomcat 5 Unleashed I have been reading Tomcat 5 Unleashed since I purchased... how to use Tomcat properly. I have always been bothered by the default Tomcat
jQuery auto complete through database using JSP shows error
jQuery auto complete through database using JSP shows error  The tutorial on jQuery titled "jQuery auto complete through database using JSP" shows error on browser when I try to select the one in the dropdown. Please help
JSP view detail page on accept button click
JSP view detail page on accept button click  i Have 1 jsp page in that there r 2 button accept and view details when we click on aceept button it will submit to next page and when click on view details page it will shown the data
Scrollbar click in safari browser not Collapsing opened dropdowns
Scrollbar click in safari browser not Collapsing opened dropdowns  When im clicking on the scrollbar in safari browser the click not collapsing the opened dropdowns....i mean if iam scrolling the scrollbars after content is being
how can i make a session invalidate in java when browser is closed
how can i make a session invalidate in java when browser is closed   how can i make a session invalidate in java when browser is closed   ... that shows the user account page fetching from session(same browser). So I wanted
problem with starting tomcat - IDE Questions
and tomcat 5.5 in my project. when iam going to start server it is giving like this: Timeout waiting for tomcat v5.5 server @localhost to start.Server did... Srikala, Please check the tomcat configuration. I am sending you
How to load elements from db when i press next.
means when i click next, the next 20 books will be displayed from db on the same...How to load elements from db when i press next.  Hello , I am working on a project "Online Book Mart" using JSP and Servlets and I am astuck

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.