File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

validating inputs using struts

yacout dadoun

Joined: Oct 05, 2004
Posts: 11

I'm using jsp/jstl in my pages, and i'd like to validate the inputs using the struts validator. I have configured the file, the struts-config.xml, created a form bean ( that extends the validatorForm and a form action ( 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

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

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] [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

yacout dadoun

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 ]
I agree. Here's the link:
subject: validating inputs using struts
It's not a secret anymore!