-
Mar 31st, 2009, 02:26 PM
#1
A simple check for form errors in JSP page?
Hello
I need, what seem to me, a very simple check in a JSP-page to see if there are any errors at all that I have added, after submit. It could look something like this:
<c:if test="${command.errors}">
My html code...
</c:if>
(where "command" would be my form). I havn't been able to find an example of how to check this in a page. I'm looking for the same Java function as "errors.hasErrors()". I'm not looking to print them in the page, at this point, just determine if errors exist so I can write different HTML.
Thanks
-
Mar 31st, 2009, 06:08 PM
#2
i think that the tag you are looking for is:
<spring:hasBindErrors name="${form}">
</spring:hasBindErrors>
it exposes the errors in the "errors" variable
-
Apr 1st, 2009, 01:59 AM
#3
Almost!
Thanks, this is almost what I want, it's just that I also need cases when there are no errors. Can this tab be written in its opposite as well?
-
Nov 7th, 2009, 02:00 PM
#4
Hi
Can anyone provide code for a window where i can check the errors of any jsp code.....i am in desperate need of it.....
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules