473,513 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

servlet doubt

2147483648
11 New Member
In the below servlet pgm,excuting fine but destroy method and two more meothds im unable to find output in console/browser?
Plz help frnds......

Expand|Select|Wrap|Line Numbers
  1. package org.g2e.secondapp;
  2. import java.io.*;
  3. import javax.servlet.*;
  4. public class Servlet2 implements Servlet{
  5. ServletConfig config=null;
  6. public void init(ServletConfig config){
  7.     this.config=config;
  8.     System.out.println("servlet is initialized");
  9.  
  10. }
  11. public void service(ServletRequest req,ServletResponse res)throws IOException,ServletException{
  12.  
  13.     res.setContentType("text/html");
  14.     PrintWriter out=res.getWriter();  
  15.     out.println("<html><body>");  
  16.     out.println("<b>hello simple servlet</b>");  
  17.     out.println("</body></html>");  
  18.  
  19.  
  20. }
  21.  
  22. public ServletConfig getServletConfig(){
  23.     return config;
  24. }
  25. public String getServletInfo(){
  26.     return "copyright 2007-1010";
  27. }
  28.  
  29. public void destroy(){
  30.     System.out.println("servlet is destroyed");
  31. }
  32. }
Feb 1 '14 #1
0 929

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3879
by: Hai Tran | last post by:
Any help is appreciated. Installed Tomcat 4.1 and Mysql on a WinXP. I've manage to get Tomcat up and was able to view my first application ( myhome ) simple home page. Tomcat was installed under C:\Tomcat4\ with C:\Tomcat4\webapps\myhome\WEB-INF\classes to store all my java.class files. Under WEB-INF, I've have edit the web.xml file as ...
6
1963
by: abctech | last post by:
My requirement is such that any user must not be allowed to save the same record twice. For this what I do is as soon as some user fills up the page and clicks 'Save' I invoke a Servlet which checks the information filled in that page with that of the existing records and if a match is found then a message is printed back saying 'record already...
3
1131
by: crossroadsk | last post by:
I am coding a jsp. I want to refer a class which i would place in the classes folder of my tomcat server. Is it possible to refer a normal java class through web.xml instead of a servlet or bean? or else, is there anyway to access a java(not servlet or bean) class from jsp?
14
2385
by: ramadeviirrigireddy | last post by:
Hi All, I have the following code for form and servlet. when the form is submitted the servlet will print the values passed by the form. i'm not getting the servlet o/p when i submit the form.here is my code:(simple code just for testing i did this program) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>...
9
3153
by: mjahabarsadiq | last post by:
Hi I have created a servlet that is to be started at the server startup. And I got it. In that I have created a object of another class and set it as a session attribute. What I am trying is to get the object in a jsp page. Following are the codes.
7
8859
by: vinodsk101 | last post by:
Hi all, I have one doubt, can we pass a variable from javascript to servlet??? In Brief, i am getting some values in javascript through jsp and the same values i want in servlet. Ya i know i can get this values in servlet by using request.getParameter(""); But thise values are dynamically generated so i dont know how many values will be....
2
4430
by: sumanta123 | last post by:
Dear Sir, In my servlet proggram when i am click the link of ApplicationStatus.jsp in the address bar the url link is showing http://01hw173228:81/help/ApplicationStatus.jsp. When i submit the request it will go to servelt page in the and the request address bar is showing...
0
1389
by: hellwitu | last post by:
I am workin on a mms project and it has the following modules sender and reciever (j2me -using sun wireless toolkit) mm7 and mmsc (java- using eclipse) vasp server and content server (java servelets- using eclipse and tomcat apache) During normal run the connection should go somewhat like this
0
2283
by: enzo | last post by:
I want to create a maven scala spring hibernate project **using ECLIPSE**. Im following this tutorial : http://grahamhackingscala.blogspot.fr/2010/01/scala-spring-hibernate-maven-webapp-how.html Now I'm stuck in the 4th step : Start the Webapp with Maven using the Jetty Plugin. This is what the browser is displaying : HTTP ERROR 404 ...
1
2664
by: ajay13785 | last post by:
I want to insert data from Text box to oracle database ,so in my HTML where there are text box (and 3 Buttons-New ,Update and save)so when i click any of three buttons it takes me to redirectServlet , and from this servlet I want to again forward my page to insertServlet(i.e When I click NEW Button) ,but I am getting 404 error . May be my logic...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.