• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

struts validation issue

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks,
It seems like if I specify a field as required in
struts's validation-rule.xml and that field is missing
from the form, when i submit the form it would say
file not found /actionName without spitting out an
exception. It is as if it's seeing the action
specified by actionName as a file... any idea why?
thanks
Here is my validation-rule.xml:

Here is my action-mapping:

Here is my form embedded in the jsp


if I add in the missing required field headWeight,
then
the action gets called and everything's fine.
otherwise, it would not even construct the action, it
happened before action gets constructed and called..
If a field is missing, shouldn't it just populate the
bean and forwards back to the input page with the
error msg instead of giving a mysterious error?
what's wrong with the way i m using struts validation?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using the Struts <html:form> tag instead of the regular html version. In the Struts tag, specify the action as /saveSoldierInfo (no .do). It appears that the validator doesn't know where to return to if there's an error. I believe that using the struts form tag may solve this problem.
[ March 10, 2005: Message edited by: Merrill Higginson ]
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Merril,
thank you. I believe that was the cause of the problem, using struts tags definitely works.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!