When i click on Monitor Tomcat, it shows

When i click on Monitor Tomcat, it shows

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:44 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 Tutorials/Questions & Answers:
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
Advertisements
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
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
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
print form information when click on print button
print form information when click on print button   Sir,I desingn institute webside using jsp and strut by using platform netbean 7.2.So request you please help for printing form information by clickin print button after submit
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
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 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
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 should I learn tensorflow
When should I learn tensorflow  Hi, TensorFlow is now getting used in industry. I am planning to learn it. When should I learn tensorflow? Thanks   Hi, Its always better to learn new technologies asap. Science
When should I learn tensorflow
When should I learn tensorflow  Hi, TensorFlow is now getting used in industry. I am planning to learn it. When should I learn tensorflow? Thanks   Hi, Its always better to learn new technologies asap. Science
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
Jsp error when i run this a jsp file
Jsp error when i run this a jsp file  hi I got this error when i run the jsp file in IDE and outside also please help me java.lang.NullPointerException org.apache.jsp.insertjsp.jspInit(insert_jsp.java:22
Page is not getting loaded when I refresh the webpage???
Page is not getting loaded when I refresh the webpage???  **I am... when I refresh the page.* Note: Header section is getting loaded always Could... function in JSP. It will get all details of image section from database. *I am
When should I start learning machine learning?
When should I start learning machine learning?  Hi, I am beginner... to learn: When should I start learning machine learning? Try to provide me good examples or tutorials links so that I can learn the topic "When should I
how to configure apache tomcat for eclipse when already its used by netbeans
how to configure apache tomcat for eclipse when already its used by netbeans  How to configure Apache tomcat for eclipse when already it's used by net beans. Should i change the server port number if so how should i change
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
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   ...). So I wanted to make the session invalid when browser/tab is closed like gmail
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
get UnsatisfiedLinkError when I try to use my JDBC driver.
get UnsatisfiedLinkError when I try to use my JDBC driver.  Why do I get UnsatisfiedLinkError when I try to use my JDBC driver
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
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
I invoke the ResultSet methods afterLast and beforeFirst when the method next works.
I invoke the ResultSet methods afterLast and beforeFirst when the method next works.  Why can't I invoke the ResultSet methods afterLast and beforeFirst when the method next works
how to create directed line between two buttons when i clicked there
how to create directed line between two buttons when i clicked there  Hi I have to create a topology between 6 nodes. 6 nodes are created as 6 buttons and when i clicked in first button and then on second button a directed
when I run exiting project that time I got error, I want solution on it?
when I run exiting project that time I got error, I want solution on it?  Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start
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
Null value when i set interface object in form controller - Spring
Null value when i set interface object in form controller   Hi all, i am very new about spring and hibernate. i got null value when i set.... when i call this method in form controller ohbillManager.saveBill(ohbill); i
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
write data to a pdf file when i run jsp page
write data to a pdf file when i run jsp page  Hi, <%@page import... to the libraries.the pdf file are not opened when i execute the program.please send the code to open the pdf file when i execute the jsp page
automatically break line when ever I put enter.
automatically break line when ever I put enter.  code is working fine... StringBuffer(OriginalMsg); for(int i = 0; i < sb.length(); i++){ int temp = 0; temp = (int)sb.charAt(i); temp
how i get experience wise resume from database when i submit from browser
how i get experience wise resume from database when i submit from browser  how i get experience wise resume from database when i submit from browser   Please go through the following link: Visit Here
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflow Earlier... to resolve the error: No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflow Earlier... to resolve the error: No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflow Earlier... to resolve the error: No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflow Earlier... to resolve the error: No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflow Earlier... to resolve the error: No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow
No module named 'absl' error when I import tensorflow  Hi, In one... the errror: No module named 'absl' error when I import tensorflowADS_TO_REPLACE_1... Python. How to resolve the error: No module named 'absl' error when I
i am getting the problem when i am downloading the pdf file from oracle 10g database - Struts
i am getting the problem when i am downloading the pdf file from oracle 10g database  if i created the pdf file from pdf machine,it is storing into datbase and download the pdf file from database. but when i created the pdf file
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse  please help me i have to submit this soon
I got build failed when deploying enterprise application - EJB
I got build failed when deploying enterprise application  I created web application with ejb moduless and stateless session beans. However, i am getting th errros:...please help pre-init: init-private: init-userdir: init
I am new to java applets. When i run this code on applet viewer status is displayed that applet not initialized
I am new to java applets. When i run this code on applet viewer status is displayed that applet not initialized  import java.awt.*; import java.awt.event.*; import java.applet.*; public class Textfields extends Applet implements
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
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
why it is very slow when I am using the backend as microsoft access file for running the java webapplication - SQL
why it is very slow when I am using the backend as microsoft access file for running the java webapplication  I am using the backend as microsoft access file for running the java webapplication.it is very slow when twoor mor

Ads