views:

24

answers:

0

For many of my forms, the user submits to a particular URL and if there are errors, the script redirects back to the original page with the errors in the URL. That page then reads the URL parameters and displays the errors to the user like so:

http://localhost:8080/test/?signup_error_email=no_at_symbol

Works great. But sometimes the validation errors have parameters. For example, in the above contrived example, maybe we need to send the actual email address back as part of the error. So I could do this:

http://localhost:8080/test/?signup_error_email=no_at_symbol:namegmail.com

That works great too, if there are multiple parameters, just separate them with :'s. But then, if the user enters a :, it gets all screwed up of course... I'm curious if there are any standard ways of dealing with this?

Yes I know about javascript form validation, but this needs to be done this way for a reason. Not sure it matters, but I'm using Spring 3.0, Spring webmvc and JSP/JSTL. Maybe they have a convenient mechanism before I build our own...