struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hernan gonzalez" <hgonza...@gmail.com>
Subject Clean some characters in request parameters
Date Mon, 14 Apr 2008 21:51:19 GMT
Assume I have a lot of html forms with text inputs, and I want to
palce some restrictions for the set of allowed chars. Sort of a sanity
check, at the charset level.
For a concrete example, my storage (db) uses LATIN9 (iso-8859-15), and
the user sometimes can enter the non-allowed acute-accent (instead of
the intended-correct apostrophe). In this -and similar cases- I want
to detect it (replacing it with the "good" character, or throwing an
error). I wish to do it globally, not field by field... though not for
the entire application, but for a set of actions.
I was thinking of an interceptor that operates at the
HttpServletRequest level, before the ParametersInterceptor is applied
(I don't care if the http param corresponds to a String property), but
this does not seem very straightforward , as the HttpServletRequest
does not allow to manipulate the params.
Any suggestion or pointer?

HernĂ¡n

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message