Ajouter un commentaire

markove
recuperation d'un formulaire

Bonjour je voudrais récuperer les donné d'un formulaire avec request.getParamater() mais la page servlet n'affiche rien voila mon code de jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body> 
<form method="POST" action="test"><br>
            nom:<input type="text" name="nom"><br>
            prenom:<input type="text" name="prenom"><br>
            <input type="submit" value ="envoyer">
        </form>
</body>
</html>

mon code jsp
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 test
*/
public class test extends HttpServlet {
   private static final long serialVersionUID = 1L;

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

   /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      
      PrintWriter out=response.getWriter();
  String      t=request.getParameter("nom");
        out.print(t);
   }

   /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
   }

}
merci en avance

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 TTTTTT  Y   Y   AA   DDD   RRRR  
TT Y Y A A D D R R
TT Y AAAA D D RRRR
TT Y A A D D R R
TT Y A A DDD R RR