samedi 7 juin 2014

Hiding data from URL using POST


Vote count:

0




I'm trying to do a System that has a Login function ... I'm using MVC... Java and JSP pages..



@RequestMapping(value = "/register", method = RequestMethod.POST)
public @ResponseBody
void register(String fN,String lN,String email, String password, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
System.out.println("Entered register function yarab !");
System.out.println("First Name: "+fN);
System.out.println("Last Name: "+lN);
System.out.println("email: "+email);
System.out.println("password: "+password);

Enduser user= new Enduser(fN,lN,email,password);
rep.addUser(user);
System.out.println("User Successfully added !");


}


This is the controller function i use when someone register...



$(function() {
$('.register').click(function()
{


var fN=document.getElementById('fN').value;
var lN=document.getElementById('lN').value;
var email=document.getElementById('emaill').value;
var password=document.getElementById('pass').value;


$.ajax({
url: '/quconnectsu/register',
type:'POST',
data: { fN:fN, lN:lN, email:email, password:password},
success: function() {

}
});
});
});


and this code in the JSP to send the data to the controller when the register button is entered ! ...


I NEED to hide the information in the URL ..



( http://localhost:8080/test/homepage.jsp?fN=Maha&lN=Mohasseb&emaill=&pass= ) !.... I dunno what's the problem since i'm using POST !! .. why does the data appears !! ...


Please Help me !



asked 23 secs ago






Aucun commentaire:

Enregistrer un commentaire