Advertisement
Guest User

Untitled

a guest
Nov 29th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <%
  2. //inserire bean controllo di application e anche quello che prende i parametri in automatico
  3.  
  4. if(application.getAttribute("associazione")== null){
  5. Associazione a = new Associazione();
  6. application.setAttribute("associazione", a);
  7.  
  8. }
  9. /*<jsp:useBean id="socio" class="Archivio.Socio" scope="session"/>
  10. <jsp:setProperty name="socio" property="*"/>*/
  11.  
  12.  
  13. //((Associazione) application.getAttribute("associazione"))
  14.  
  15.  
  16.  
  17. if(((Associazione) application.getAttribute("associazione")) .usernamePresente( request.getParameter("username") ) == false){
  18. String nome,cognome,username,password,indirizzo;
  19. //campi della registrazione
  20. nome=request.getParameter("nome");
  21. cognome=request.getParameter("cognome");
  22. username=request.getParameter("username");
  23. password=request.getParameter("password");
  24. indirizzo=request.getParameter("indirizzo");
  25. ((Associazione) application.getAttribute("associazione")).addSocio(new Socio(nome,cognome,username,password,indirizzo));
  26. response.sendRedirect("menu.jsp");
  27. }
  28.  
  29. else{
  30. if(request.getAttribute("nome") == null){
  31. session.setAttribute("usernameNonValido", "true");
  32. response.sendRedirect("registrazione.jsp");
  33. }
  34. }
  35.  
  36.  
  37.  
  38. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement