Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
Spring MVC verifica el nombre de usuario en db antes del envío

Estoy haciendo una aplicación web usando Spring MVC y jsp. Soy bastante nuevo en esto y realmente estoy luchando por encontrar un enfoque para validar un nombre de usuario de DB antes de enviar el formulario. Aquí hay una demostración del tipo de cosas que estoy buscando http://www.bitrepository.com/demo/username-checker/

Agradecería cualquier ayuda brindada. Gracias

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Puede encontrar muchas respuestas si busca "Validación de formulario Spring MVC" en Google. Por ejemplo, tutorial oficial de primavera: https://spring.io/guides/gs/validating-form-input/

Otro ejemplo en codejava.net: http://www.codejava.net/frameworks/spring/spring-mvc-form-validation-example-with-bean-validation-api

over 4 years ago · Santiago Trujillo Report

0

Seguí este este tutorial:

http://www.mkyong.com/spring-mvc/spring-4-mvc-ajax-hello-world-example/

Muchas gracias @YohanesGultom

over 4 years ago · Santiago Trujillo Report

0

puede verificar el nombre de usuario mediante la validación de jquery

 $("#myform").validate({ rules: { email: { required: true, remote: { url: 'checkUserName', data: { userName: $('#username').val()}, dataFilter: function(data) { var json = JSON.parse(data); console.log(data); } } }, messages: { email: { required: "This field is required", remote: "Email address already in use. Please use other email." } } });

y en su controlador agregue este método:

 @requestMapping("checkUserName") @responseBody public boolean checkUser(@requestParam("userName") String userName){ return // method return bolean if user exist or non in database. }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!