Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Development-process My Servlet code not working
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rajendra
My Servlet code not working
1 Answer(s)      5 years and 6 months ago
Posted in : Development process



Advertisement
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
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 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
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
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
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
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
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
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
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
Same email-massage is sending twice in online server(tomcat) but working fine in my local server(Tomcat)..
Same email-massage is sending twice in online server(tomcat) but working fine in my local server(Tomcat)..  Sir, I created one project in jsp... Submitting their daily report , it is working fine but when am uploading
Form Code To Dispay Webpages On My Site
Form Code To Dispay Webpages On My Site  I want to use a form input box to display different pages on my site depending on the code the user types into the box. example: Producer Code 1234 would bring up Producer 1 page
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
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
Not sure whats wrong with my code HELP PLEASE?!?!
Not sure whats wrong with my code HELP PLEASE?!?!  I cant figure out what I am doing wrong in my code can anyone help me out??? Grades function computeGrade( ) { var hw, lab, midt, fin, avg; hw = parseFloat
Small Bug How to solve in my code
Small Bug How to solve in my code  String season=""; pst = con.prepareStatement("SELECT DISTINCT(Season) season FROM specialdates where Regid... +=rs.getString("season") + ","; } in above code seasons +=rs.getString("season
doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser... the code i developed i can send u to ur mail if u give ur mail id.... It would be good for me to provide you the solution if problem is clear. Plz send code
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
anyone willing to look over my code? (java)
anyone willing to look over my code? (java)  package inorder.without.cheats; import java.util.Arrays; import javax.swing.JOptionPane; public class InOrderWithOutCheats { public static void main(String[] args
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
how can i simplify my java code
how can i simplify my java code  /* Create a program that prompts... Scanner (System.in); String pass=""; int c = 1; int code=0...=Integer.toString(f); String q=Integer.toString(g); String r=Integer.toString
ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import
why jsp pages are not working on linux but java application is working in windows - JSP-Servlet
why jsp pages are not working on linux but java application is working in windows  java web application jsp pages are not showing the fileds corectly on linux server but same application is working on windows.why
Advertisements
 

 

 

DMCA.com