wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Verification failed on Username existence check using AJAX 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 » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

Verification failed on Username existence check using AJAX

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
Iam completely new to AJAX. Iam working on a web application using Struts, Spring and Hibernate. On the registeration page, there is button, on click of that it has to validate whether the username entered by the new user is already exists in the database( ms sql server 2005) or not.
But the problem is that AJAX is not getting called on the click of "Check Availability" button. I think there is some problem on URL. Because it is not able to enter into "AJAXCheckUserServlet.java" class since nothing is happening.

Following is my applicationContext.xml :-

struts-config.xml:-


web.xml:-

register.jsp:-

AJAXCheckUserServlet.java:-

The bolded line above in the code(register.jsp) has some problem i think because javascript alert "1" is not coming. But iam getting the alert "ein".
Please help me... I don't know what is happening inside actually and where i went wrong.
I would really appreciate your help.
Thanks in advance.

Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

You posted quite the same question here too.

What is the first alert statement displaying?? Since you didn't provide the ID attribute for the text field, struts will generate a unique ID itself. You need to put the styleId attribute on the html:text tag to give it the ein ID. Also why are you using /*.do as the path to the server call?? And do you think this will call the AJAXCheckUserServlet servlet?? You've not declared the AJAXCheckUserServlet servlet in your web.xml, so it won't be called.


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
Consider Paul's rocket mass heater.
 
subject: Verification failed on Username existence check using AJAX
 
Similar Threads
Communication failure during handshake. Is there a server running on localhost:3306?
struts-html.tld not found help me please
org.apache.jasper.JasperException: /Address.jsp(4,3) Attribute locale invalid for tag html according
wrong jar reference
Unable to display the Data from SQL SERVER 2005 on a JSP through <c:forEach> tags