My Servlet code not working

My Servlet code not working

View Answers

July 16, 2009 at 12:58 PM

Hi Friend,

Try this:

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class HelloWorldExample
*/
public class HelloWorldExample extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* Default constructor.
*/
public HelloWorldExample() {
// TODO Auto-generated constructor stub
}


public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("raja");
}


public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

}
}

Thanks









Related Tutorials/Questions & Answers:
My Servlet code not working - Development process
My Servlet code not working  HHi, After executing servlet am getting blank screen. Am using weblogic server and Eclipse editor. But jsp is working fine. Steps(what i did ) 1)Created servlet (In eclipse) and export it (saved
Code not working
Code not working  i want to write my first applet. I wrote the java program and html code for that. while im running in appletviewer it is asking for security permissions. so, i created a policy file and linked it with html file
Advertisements
code not working properly
code not working properly  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException...); } } in the above code if i enter a valid username and password i am
Why is this code working
Why is this code working  Looking at this piece of code: #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct _point{ int x; int y; } point; int main (void) { point *ptr; point obj
Solve my code
is the mistake in this code! This is working only one record doesn't work...Solve my code  import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.io.*; public class ChangeDetails extends
Servlet signup still not working satisfactorialy - JSP-Servlet
Servlet signup still not working satisfactorialy  Hello sir thanks for your reply I tried following code given by you, What it has a problem as: I... signup /SignUp   Hi friend, Code for Servlet
servlet code
servlet code  how to implement insert update n delete in one servlet in net beans   If you want to perform insert, update and delete functions in the same servlet, then please visit the following links: http
What is wrong with my servlet?
What is wrong with my servlet?  I'd like to know which part of the code is wrong. My code is: print("code sample"); import java.util.*; import...((new Integer(qty)).intValue()); return cd; } } print("code
servlet code - JSP-Servlet
servlet code  Create a servlet to develop a login application with javascript clientside validations and serverside validations
Searching for Code - JSP-Servlet
JSP, Servlet Searching for Code  Hi, i am looking for a jsp servlet code examples for the search function in my application.Thanks
servlet code - JSP-Servlet
servlet code  how to implement paging or pagination in java code using servlets.  Hi Friend, Try the following code: import java.io.... code, we have used following database table: CREATE TABLE `student
SaveAs Dialogue box is not working on button click in servlet
SaveAs Dialogue box is not working on button click in servlet  Hii Sir, i added response.setHeader into my servlet code to export the data into excel file but this is not working on button click ...plz give me
myJSF,Hibernate and Spring integration code is not working. - Hibernate
myJSF,Hibernate and Spring integration code is not working.  the code...:8081/HibernateMyfaces/ in my url (my port no. for tomcat is 8081), it shows me HTTP Status 404... is inside the myfacesjsfhibernate folder) to my tomcat/webapp directory. 4)i have
Clarify my doubt - JSP-Servlet
Clarify my doubt  Hi All, Although i know the concept of Servlet & JSP, but I have never got a chance to work in EJB . So could u please tell me how... project in netbeans adding jsp/servlet in this web project and deploying
atm code in servlet& jsp
atm code in servlet& jsp  pls send me the code of ATM project in servlet jsp . my requirements are first of all an user login window open then balance enquiry, withdraw of money, money transfer, then log out. pls send as early
Encryption code - JSP-Servlet
Encryption code  Iam developing a web security application for that reason i need a code of encryption in servlet. Can u please send it to me.Its very urgent Because my project delivery date is very near
Problem in my code - Development process
Problem in my code  Plz go thru this code. I want to check login and pwd with database. Backend MsAccess , Table name : Reg , Dsn Name: JJ While executing code am getting 404 error User Name Password
JSP code - JSP-Servlet
. thanking u......... This is what my code is. Jam Name...;   Hi Friend, Try the following code: Jam Name: Thanks  The above answer given by friend is working. Thanks
Pls review my code - Struts
Pls review my code  Hello friends, this is my code in struts action class this page contains checkboxes and radiobuttons also. when i enter the submit it shows me blank page. can anybody solve my problem its urgent. help me
pls review my code - Struts
pls review my code  Hello friends, This is the code in struts. when i click on the submit button. It is showing the blank page. Pls respond soon its urgent. Thanks in advance. public class LOGINAction extends Action
this is my code java - Date Calendar
this is my code java  /* * NewJFrame.java * * Created on 11... NOT modify this code. The content of this method is * always regenerated...; jTextField1.setText(months); #### This My problem jTextField2.setText(days
pls review my code - Struts
pls review my code  When i click on the submit page i am getting a blank page Pls help me. thanks in advance. public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync... here!!!..., i want to pass the texbox value and file to servlet im stuck with this error plzz help me..., in servlet if i use request.getParameter() its
Mutiple part is ot working - JSP-Servlet
. But in one system when i use enctype="mutlipart" its working but in other system its not working. Is this a problem with the browser or nything else... code where you having the problem and visit to : http://www.roseindia.net
code - Servlet Interview Questions
by the servlet container. The status code of the response always should...code  servlet service method along with an example code  Hi Friend, Servlet service() method: Once the servlet starts getting
servlet code problem - JSP-Servlet
servlet code problem  This is my JSP code index.jsp Sync Data Sync Data Please use the following input box to upload file or enter... to servlet im stuck with this error plzz help me..., thanks in advance....  
How to add the servlet api to my pom.xml?
How to add the servlet api to my pom.xml?  Hi, I have learned Maven... have to add the servlet api in pom.xml file. Let's know how to add the servlet api to my pom.xml? Thanks   Hi, Use the following code in your
servlet code to update password?
servlet code to update password?  Create a servlet page which helps the user to update his password. The user should give the username,old password... users.then Store it into a table. please tell me the code for the above question
code required in servlet
code required in servlet  hello... you provided me the answer with javascript.. i want to check which button is clicked in the servlet.. i have only 1 servlet an in that separate codes for different button clicks.. can u plzzz
code for this problem - JSP-Servlet
code for this problem   i have buttom submit .It is working with single click.Suppose if i am At the same time clicking(parallel) twise second request will be stoped until process the proces first requst and terminate
jsp code - JSP-Servlet
jsp code  Can anyone help me in writing jsp/servlet code to retrieve files and display in the browser from a given directory.  Hi Friend, Try the following code: Thanks
Help in completing Servlet code!
Help in completing Servlet code!  Complete the following Servlet codes to store the information read from the input form to session object. public... String comment = req.getParameter(?commentText?); //Complete the code to store
code for JSP and Servlet - JSP-Servlet
code for JSP and Servlet  i have to create a jsp page that contains username and password, so how to code servlet according to it?  Hi sushil, package javacode; import java.io.*; import javax.servlet.*; import
Code Works - JSP-Servlet
Code Works  Hi The code provided is working fine along with the pagination . i edited the queries and that makes difference.. here is the code. Thank you Regards Eswaramoorthy Pagination of JSP page
servlet code - Applet
servlet code  how to communicate between applet and servlet  Hi Friend, We are providing you the code that will display the message sent from the servlet to applet. Here is the code of 'ServletExample.java
code - JSP-Servlet
code  i have one check box in my form. When i click the check box i want to execute some sql query.so i write one javascript function. but i dont...; use some server side script like servlet or jsp, call these when user click
code error - JSP-Servlet
code error  hii this program is not working becoz when the mouse... complaint   Hi friend, Do some changes in your code to solve the problem. 1)In "describe()" function write code "return true"; 2
Code - JSP-Servlet
Code  Using servlet,JSP,JDBC and XML create a Web application for a courrier company to provide online help in tracking the delivery status of items
JSP code - JSP-Servlet
JSP code  hello,i working in project with JSP technology,i have one page Login.html and on there two options NewUser and Recoverpassword..can u tell me how to link these pages with each other using JSP..and how to write the code
java servlet code - Servlet Interview Questions
java servlet code  iam doing a project in java, preparation of on line examination in that how to prepare a question paper using servlet code
jsp code - JSP-Servlet
colum.  Hi Friend, Try the following code: Add/Remove...; } } Thanks  its not working properly....In second row it is not showing
What's wrong with my pagination code in JSP?
What's wrong with my pagination code in JSP?  Dear experts, I've.... Hope someone can advise me how to. Thanks! print("code sample"); <...; print("code sample");   JSP Pagination The given code retrieves
jsp code - JSP-Servlet
jsp code  in my table there are 3 fields named orderid ,itemname, itemqty. i want code that fetch orderid in dropdown... on select dropdown get table of item details of that orderid... there are multiple items at one orderid
download code using servlet - Servlet Interview Questions
download code using servlet  How to download a file from web to our system using Servlet
code - JSP-Servlet
code  hi sir my question is i have created a html ang jsp code.... how to write the code to accept an existing id and password.  Hi Friend, Try the following code: 1)login.html: Login
source code - JSP-Servlet
source code  i want source code for my project online examination it includes two modules user and administrator so if user want to write exam first he register his details and then select the topics on which he want to write
source code - JSP-Servlet
source code  i want source code for my project online examination it includes two modules user and administrator so if user want to write exam first he register his details and then select the topics on which he want to write
jsp code - JSP-Servlet
jsp code  hi my requirement is generate dynamic drop down lists... statement? pls provide code how to get first selected drop down list value..., Try the following code: function city(){ var cid
how to point my jsp form action to servlet? - JSP-Servlet
was trying to point my jsp action to my servlet.(f.action="../fyp.servletLogin";) fyp is the folder that stores my servlet. Here is my function code in jsp, when user...how to point my jsp form action to servlet?  I am currently using
jsp code - JSP-Servlet
jsp code  Hello Everybody, can anyone help me to findout the modules as i am developing a whiteboard application using jsp? this application is my dream application. Thank you

Ads