• 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

validating inputs using struts

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm using jsp/jstl in my pages, and i'd like to validate the inputs using the struts validator. I have configured the application.properties file, the struts-config.xml, created a form bean (testForm.java) that extends the validatorForm and a form action (testAction.java)and even configured the validator.xml but i dont' know how to display the ActionErrors in my page (test.jsp) without using struts tag :<html:errors/> only using jstl.
I have tried to retrieve the content of the ActionErrors in the testAction but i intializea string to test then add the content of the ActionErrors, then set the errors variable in my jsp file test.jsp, but when the inputs are correct the errors variable in my jsp file is set to its initiale value however when the inputs are wrong, the erros variable is empty.

Any idea pls

Thx
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a forum just for questions on web frameworks such as Struts, so I'm moving this along to that forum for you.
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use JSTL to display the ActionErrors. But what's wrong using


--Nimchi
 
yacout dadoun
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that with JSTL i dont know from where to get the ActionErrors and when i use <html:errors/> nothing is displayed
[ October 06, 2004: Message edited by: yacout dadoun ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic