This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Ajax servlet form validation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Ajax servlet form validation problem

Manas Saxena
Ranch Hand

Joined: Mar 01, 2013
Posts: 38
I have made a form validation using ajax wherein i am trying to validate email id through ajax call which would be directed to a servlet.But it seems that the servlet is not being called.
following is my jsp code



The following is my servlet code


However if when i used jsp instead of servlet(which i should not) for testing sake i was getting correc output.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60749
    
  65

Your servlet is mapped to ""regajax4.java"? Really?

The URL should to the mapping that you gave to the servlet in the deployment descriptor, prefixed by the context path. More info is in the JspFaq.

Also, why are you not using jQuery to do your Ajax? It is not recommended to use Ajax "by hand" as you have done here.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60749
    
  65

Closed as this question is repeated elsewhere.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ajax servlet form validation problem
 
Similar Threads
JSP,JDBC
how can i compare a session parameter value with variable value?
Value in the else condition is getting printed as the page loads
Form validation using jsp and AJAX
Form validation using jsp and AJAX