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

validating inputs using struts

 
yacout dadoun
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Nimchi Yung
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic