File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Validator Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validator Problems" Watch "Validator Problems" New topic

Validator Problems

Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
When I include the <html:javascript formName="LogonForm"/> tag, the validateLogonForm method is not being generated and even the enclosing <script> tags aren't being generated. All other functions, such as validateFloatRange are appearing literally on the page.
Here's the page:
(I had to change the onklick word so this post would succeed)

Here's my struts-config:

Here's my validation.xml:

Here's the form:

Can anyone help me? Thanks a lot in advance.
Umar Hathab Abdullah

Joined: Jan 23, 2003
Posts: 18
Use the following Tag...

<html:javascript formName="LogonForm"
<script language="Javascript1.1" src="staticJavascript.jsp"></script>

Code for staticJavascript.jsp
<%@ page language="java" %>
<%-- set document type to Javascript (addresses a bug in Netscape according to a web resource --%>
<%@ page contentType="application/x-javascript" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:javascript dynamicJavascript="false" staticJavascript="true"/>
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
I tried what Umar Hathab Abdullah suggested but it didn't help me because the dynamic javascript still is not being created at all, so no validateLogonForm method is inserted into the page. I must have done something wrong because I am running the struts-validator example application and it is working fine. Any hints? Thanks!
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
I should not have capitalized the logonForm in the form-bean element. I changed that and now everything works fine. I hate it when those little errors take so long to debug.
I agree. Here's the link:
subject: Validator Problems
It's not a secret anymore!