daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. import javax.servlet.*;
  5. import javax.servlet.http.*;
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. public class create extends HttpServlet {
  13.    
  14.    
  15.     private static final long serialVersionUID = 1L;
  16.     HashMap<Integer,User> Benutzer = new HashMap<Integer,User>();
  17.    
  18.    
  19.    
  20.    
  21.     public void doGet(HttpServletRequest request,
  22.             HttpServletResponse response)
  23.  
  24.  
  25.     throws IOException, ServletException
  26.     {
  27.           // Medientyp festlegen und PrintWriter spezifizieren
  28.         response.setContentType("text/html");
  29.         HttpSession session = request.getSession(true);
  30.        
  31.          static int count;
  32.          
  33.        
  34.          String username = null;
  35.          String password = null;
  36.          String vorname = null;
  37.          String nachname = null;
  38.          String alter = null;
  39.          String geschlecht = null;
  40.          int punkte = 0;
  41.          
  42.          
  43.          username = request.getParameter("user");
  44.          password = request.getParameter("password");
  45.          vorname = request.getParameter("vorname");
  46.          nachname = request.getParameter("nachname");
  47.          alter = request.getParameter("alter");
  48.          geschlecht = request.getParameter("geschlecht");
  49.          
  50.          
  51.      
  52.         User user = new User(username,password,vorname,nachname,alter,geschlecht);
  53.        
  54.         count++;
  55.         Benutzer.put(count, user)
  56.          
  57.          
  58.        
  59.        
  60.        
  61.        
  62.     }
  63.    
  64.    
  65.      public void doPost(HttpServletRequest request,
  66.              HttpServletResponse response)
  67.      throws IOException, ServletException
  68.      {
  69.     //√Éergabe an doGet(), falls Anforderung mittels POST
  70.     doGet(request, response);
  71.      }
  72.    
  73.    
  74.  
  75. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top