Hopefully this will be a very easy question for any of you to answer.
I'm new to JSP and would like to do some server-side validation on an
HTML form before posting the information to an external CRM database.
We are already doing client-side validation, but are finding that some
users have disabled javascript and submitting blank forms -- not good.
I aslo have a question out to tech support for the CRM, with no help so
far.
For some reason, this task is turning out to be a bigger headache then
it should be. Any suggestions or advice? How can I validate via
server-side code and submit the form to this external URL?
Thanks in advance!
nospam_googlegroups@scovetta.com - 23 Nov 2005 04:54 GMT
Flo--
For simple web applications, you can probably manage to just have a
validate() function in your servlet that takes the HttpServletRequest
object and does your validation manually.
For anything larger than a few pages and a few forms, I'd suggest using
the Jarkarta Commons Validator
(http://jakarta.apache.org/commons/validator/). It'll take a little
longer to set up, but it'll save you time and headaches later on.
Basically, you create an XML file with rules like
<rule>
<parameter name="client_age" type="numeric" min="0"/>
<parameter name="client_name" required="true"/>
</rule>
I just made that actual <rule> up, it's something like that though.
Give it a shot.
-Mike
> Hopefully this will be a very easy question for any of you to answer.
> I'm new to JSP and would like to do some server-side validation on an
[quoted text clipped - 10 lines]
>
> Thanks in advance!
Bernd Maierhofer (dato) - 24 Nov 2005 08:03 GMT
Additionally you may want to have a look at the STRUTS framework which does
client side validation as well as server side vaildation.
hth Bernd
> Hopefully this will be a very easy question for any of you to answer.
> I'm new to JSP and would like to do some server-side validation on an
[quoted text clipped - 10 lines]
>
> Thanks in advance!