wood burning stoves 2.0*
The moose likes Struts and the fly likes validating inputs using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validating inputs using struts " Watch "validating inputs using struts " New topic
Author

validating inputs using struts

yacout dadoun
Greenhorn

Joined: Oct 05, 2004
Posts: 11
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

Joined: Jan 10, 2002
Posts: 61316
    
  66

We have a forum just for questions on web frameworks such as Struts, so I'm moving this along to that forum for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nimchi Yung
Ranch Hand

Joined: Jan 27, 2004
Posts: 71
You can use JSTL to display the ActionErrors. But what's wrong using


--Nimchi
yacout dadoun
Greenhorn

Joined: Oct 05, 2004
Posts: 11
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 ]
 
GeeCON Prague 2014
 
subject: validating inputs using struts