Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts and Validation Framework

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.
I am using the validator framework with my struts application. I have the client side javascript validation working but am having an issue with the server side validation
It boils down to this. When I declare my form to be
public class LoginForm extends ValidationActionForm instead of
public class LoginForm extends ActionForm I receive a class cast exception in my Action Class. This is due to the Action class' method execute wants an ActionForm not a ValidationActionForm. How do I get around this? Thanks.
 
chris hart
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never Mind Issue is solved. Thanks.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chris
I am also working in the struts. I am new to strutrs framework. I want to do client side validation. I have declared the fields and validatins requried for the fields in the validatin.xml. I am extending the
ValidatorActionForm for my formbean.
When I run the form by not entering anything in the form and press submit sutton, it is forwarding to failure page and it is not showing the required message.
What should I do to enable to client side validation. I have not written any javascript method in validator-rules.xml. All I am doing is defininf the errors.required in my application resources file. I am expecting a error message when I keep the text box blank. Can you please tell me what are the steps I need to follow to enable the validation.
Thanks,
archana
 
Tell me how it all turns out. Here is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic