struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <>
Subject RE: Struts vs Jsp/javascript..
Date Mon, 01 Jul 2002 07:42:59 GMT
Are Oranges better than fruit? ;-)

My understanding was that struts (ValidatorPlugIn actually) provided a means
(JavascriptValidatorTag) for generating javascript to do initial client side
validation based on rules you specify in an xml file. These rules may also
be used on the server side (I think it was by extending ValidatorForm
instead of ActionForm) so you get the best of both worlds. Haven't made use
of these features myself so I dont know the details.

You will find yourself needing to do quite a bit of validation at the server
side anyway (for example, the more complex validation based on your business
rules where you need access to server side information to do the

It is also considered good practice not to rely solely on client side
validation, for example , because clients might turn off javascript (since
this will probably break all but the simplest form designs anyway, I dont
actually regard this as a real reason - depends on which users you are
targeting though. An intranet app can be more specific about its browser
requirements than a mass market shopping portal website...).
More sinister reasons are that if you dont validate things at the server end
then you expose yourself to any garbage a malicious client might submit.
They aren't forced to only submit to that url from the form you provide
them. Again this would probably (but not necesarily) be of more concern to a
public website than a restricted web app.

Of course having validation done in javascript will give your users much
quicker feedback, and thus improve their experience significantly, but its
best to make sure that any input that can break your app if unvalidated is
also checked at the server end too.

One of the good things about struts is that it doesn't force you to use only
the features it provides. If you are more comfortable using your own
validation methodology then you can.

-----Original Message-----
From: Manish_Purang []
Sent: Monday, July 01, 2002 15:03
Subject: Struts vs Jsp/javascript..


Wanted to know whether or not Struts Framework scores over the jsp-
javascript combination in terms of validation of form elements.
I hope you are able to unedrstand what i am asking...? to make it clearer..

on one hand we have the jsp - javascript combination  where in we can call a
single javascript funtion to validate the form elements and provide for
basic validations  like NOT NULL , ONLY NUMERICALS... and so on...

on the other hand we could use Struts ' validate function and do the same

Which appraoch is better and any advantages of using Struts for the same...!

This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message