• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validator Problems

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic