You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Manish_Purang <Ma...@satyam.com> on 2002/07/01 09:02:37 UTC

Struts vs Jsp/javascript..

Hi,

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
job...
	
Which appraoch is better and any advantages of using Struts for the same...!

Regards,
Manish. 
************************************************************************** 
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts vs Jsp/javascript..

Posted by Vincent Aumont <vi...@vsl.ca>.
Struts and Javascript don't compete in this area.
Keep in mind that some of your users might disable JavaScript; therefore,
anything you validate on the client should be validated again on the server.

-Vincent.

> 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
> job...
>
> Which appraoch is better and any advantages of using Struts for the same...!
>
> Regards,
> Manish.
> **************************************************************************
> 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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts vs Jsp/javascript..

Posted by "Craig R. McClanahan" <cr...@apache.org>.
The validator framework can be used to generate client-side validation
JavaScript for Struts forms.  However, you should *always* redo the
validations at the server side -- it is not safe programming to assume
that the user has JavaScript enabled.

The way I look at it, client-side validation is there to improve the user
interface by reacting more quickly to user errors.  It's not something
that the server-side application should rely on.

Craig


On Mon, 1 Jul 2002, Manish_Purang wrote:

> Date: Mon, 1 Jul 2002 12:32:37 +0530
> From: Manish_Purang <Ma...@satyam.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Struts vs Jsp/javascript..
>
> Hi,
>
> 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
> job...
>
> Which appraoch is better and any advantages of using Struts for the same...!
>
> Regards,
> Manish.
> **************************************************************************
> 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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts vs Jsp/javascript..

Posted by Andrew Hill <an...@gridnode.com>.
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
validation).

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 [mailto:Manish_Purang@satyam.com]
Sent: Monday, July 01, 2002 15:03
To: struts-user@jakarta.apache.org
Subject: Struts vs Jsp/javascript..


Hi,

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
job...

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

Regards,
Manish.
**************************************************************************
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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>