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



Home Answers Viewqa JSP-Servlet Servlet signup
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


AmanDeep
Servlet signup
1 Answer(s)      6 years and 2 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

October 25, 2008 at 4:15 PM


Hi friend,


Code to help in solving the problem :


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

public class SignUp extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res)throws IOException, ServletException
{
res.setContentType("text/html");
PrintWriter pw = res.getWriter();

String name="";
String id="";
String pwd="";
String pwd1="";

if(req.getParameter("name")!=null && req.getParameter("id")!=null)
{
name = req.getParameter("name").toString();
id = req.getParameter("id").toString();
pwd = req.getParameter("pwd").toString();
pwd1 = req.getParameter("pwd1").toString();
}


if(!name.equals("") || !id.equals(""))
{

pw.println("Congratulations" + name +" yow have successfully signup");
pw.println("Your login id is" +id);
}
else
{
pw.println("One of the Mandatary field is empty");
}
}

public void doPost(HttpServletRequest req, HttpServletResponse res)throws IOException, ServletException
{
doGet(req,res);
}

}

Thanks


Related Tutorials/Questions & Answers:
Servlet signup - JSP-Servlet
Servlet signup  Hi, thanks for your reply, I tried your logic code... javax.servlet.*; import javax.servlet.http.*; public class SignUp extends... successfully signup"); pw.println("Your login id is" +id); } else { pw.println("One
Servlet signup still not working satisfactorialy - JSP-Servlet
Servlet signup still not working satisfactorialy  Hello sir thanks... signup /SignUp   Hi friend, Code for Servlet... SignUp extends HttpServlet { public void doGet(HttpServletRequest req
Advertisements
Servlet signup same output - JSP-Servlet
Servlet signup same output  Ok i solved the problem of content type by res.setContentType("text/plain"), but the output is same it always prints the else value(i.e. One of the mandatary field is empty) so please help, thanks
Servlet - JSP-Servlet
and confirm password paremeters, and in the servlet called SignUp.java i... javax.servlet.http.*; public class SignUp extends HttpServlet { public void doGet... successfully signup"); pw.println("Your login id is" +id
Servlet
Servlet  What is Servlet
Servlet
Servlet  how to navigate one servlet page to another servlet page
servlet
servlet  is there any way to include pdf's in servlet
servlet
servlet  How many times the servlet is accessed
servlet
servlet  what are the methods and interfaces in the servlet api ?   Servlet Tutorials
servlet
servlet  how to interact with a servlet from a swing program
servlet
servlet  what are the all necessary configuration to run a servlet
servlet
servlet  i want to create a login page with servlet using database mysql? only in servlet not in jsp plzz help me out
servlet
servlet  I designed 1 html form & a servlet but when I click on form I don't get output of servlet Please help
servlet
servlet  I designed 1 html form & a servlet but when I click on form I don't get output of servlet Please help
Servlet
override Service method in the servlet when you extend GenericServlet to create servlet as it is mandatory to override it. But, when you extend HttpServlet to create a servlet then you can't override service method as there is a need to override
servlet
of the Servlet API. It contains the classes necessary for a standard, protocol-independent servlet. Every servlet must implement the Servlet interface in one
servlet
servlet  can i stoar record in variable which selected from table in servlet
servlet
servlet  dear sir servlet and html not run on eclips plz help me
Servlet
Servlet  What must be implemented by all Servlets?    The Servlet Interface must be implemented by all servlets
servlet
servlet  how to create a login form using servlet using submit,edit delete button
servlet
servlet  i want a program for counting the no of times the servlet has been invoked
Servlet
Servlet  I want to know the steps to write a simple servlet program... .   Hello Friend, Follow these steps: Put servlet-api.jar inside the lib folder of apache tomcat. 1)create a servlet. import java.io.*; import
servlet
servlet  how to read a file from different folder using filereader in servlet   Hello Friend, Please visit the following link: http://www.roseindia.net/servlets/servlet-read-file.shtml Here you will get an useful
servlet
servlet  i want to use servlet application on my web page then what should i do. I have already webspace.   Hi Friend, Please visit the following link: Servlet Tutorials Thanks
Servlet
Servlet   Why is Servlet so popular?   Because servlets are platform-independent Java classes that are compiled to platform-neutral byte code that can be loaded dynamically into and run by a Java technology-enabled Web
servlet
servlet  I want the full coding for uploading a file in local drive D usin jsp,java class and servlet... help me thanks in advance....   ... and servlet please and thanks in advance
Servlet
Servlet  Can a user defined function be included in a servlet? I need information regarding servlet syntax and not JSP.   Yes, you can create user defined function in Servlets. Have a look at the following link: http
Servlet
Servlet  Hi, Can any one please expalin me below topics SERVLET ENGINE 2.WHY SUPER.INIT(); Thanks alot in advance!! Regards: Akash
servlet
servlet  I want a fully readymade project on online voting system with code in java servlet and database backend as msaccess.can u plz send me as soon as possible
servlet
servlet  plz can anyone give me the link of javax library jar file. i badly need that. thanks in advance   Please visit the following link: Download Servlet API
servlet
servlet   Dear Deepak, is it compulsary to write the sevice() becoz i ve seen some example which does not ve sevice()..is it tue? plz replay me with thanks praveen
 

 

 

DMCA.com