Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validator Problems

 
Anthony Watson
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Use the following Tag...

<html:javascript formName="LogonForm"
dynamicJavascript="true"
staticJavascript="false"/>
<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
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic