aspose file tools*
The moose likes Struts and the fly likes why java script is not used in struts framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why java script is not used in struts framework" Watch "why java script is not used in struts framework" New topic
Author

why java script is not used in struts framework

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hey ,
I think struts framework is following some different concept for validating the user input leading to less performance of the webapplication

here the validations are done using taglibs in servlet not in the jsp file
so definitely it reduces the performance..
the user input is validated at server side
why why why


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
if you say that validation in struts has to be done server-side, you are not so correct. if not wrong ;-)

reading this article article should give you an overview.

btw: i disagree that client-side validation is better then server-side. with csv you depend on propriatary browser technology and are locking out any non-standard media (palm, screen-reader, etc). and yes, some users still deactivate javascript.

regards,
jan
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
saikrishna,

It's pretty clear that you've made very little effort to research this topic before posting this comment. Try Googling "Struts Client-Side Validation", read some of the hits you get, and then if you still have questions or comments, let us know.


Merrill
Consultant, Sima Solutions
nishit hegde
Greenhorn

Joined: Aug 24, 2006
Posts: 14
still not clear could anybody ellaborate on it
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The assumptions you make about Struts Validation in your first post are incorrect. I was hoping that by doing some research you would discover this for yourself.

here the validations are done using taglibs in servlet not in the jsp file

Everything about this statement is inaccurate. Struts does not generally use "taglibs" to validate, nor does it do validation in "the servlet".
Struts Validation does use client-side (JavaScript) validation if you set it up properly.

It's important to understand, though, that even if you do set up client-side validation, Struts still performs server-side validation. Depending on client-side validation alone is not reliable, as the user can turn off JavaScript from the browser.

My advice is to spend some time researching Struts Validation beginning with this link and then decide if its right for your project or not.
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
but there the validation rules are executed in a servlet that means the control goes to servlet when the form is submitted.
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
yes.

but if you read the previous posts this makes sense.

if you feel that your point is unanswered, you should take the time and discribe your open issue with different words (and more then one sentence).

bye,
jan
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
saikrishna: You do understand that Struts supports client-side validation that is implemented using JavaScript, correct? Does that not meet your needs?

- Brent
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
The #1 rule when writing web application is never trust the client.
Always validate the input you are receiving at the server end.
Javascript can be spoofed, disabled or even completely bypassed (hey all I need to do is type a url into my browser)

Your application should ALWAYS validate on the server side.
You application MAY also do validation on the client in javascript. This may improve the user experience, by saving some round trips to the server.
However you STILL do server side validation, even if you have validated in javascript.

In my experience the validation of parameters is never the bottleneck, unless you have some awful validation code running.

Cheers,
evnafets
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Originally posted by Stefan Evans:
The #1 rule when writing web application is never trust the client.
Always validate the input you are receiving at the server end.
Javascript can be spoofed, disabled or even completely bypassed (hey all I need to do is type a url into my browser)

Your application should ALWAYS validate on the server side.
You application MAY also do validation on the client in javascript. This may improve the user experience, by saving some round trips to the server.
However you STILL do server side validation, even if you have validated in javascript.

In my experience the validation of parameters is never the bottleneck, unless you have some awful validation code running.

Cheers,
evnafets



ok you may be correct, but before struts frame work the developers use to develop jsp pages using java script for the client side validation .

Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
i think your really really need to work on part A of your "life formula".

(1) you are wrong with your statement
(2) you are completely ignoring the fact that people putting effort into answering your 400+ questions. you're just dropping a line here and there, without any context to the (good) points people make. did you actually read all those answers to your question?

have a nice day,
jan
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
hi jan,
yes you may be right.
but i am different kind.
i am really really really thankful to all the ranchers who are helping me here.
internally i feel thankful,but externally i dont show up
Yes,i drop the statements with out any context,there is a reason for this
actually i dont want to explain you...
but you are misunderstanding me ..
ok here is my answer ...
The reason why doing like this is i will get some more solutions from others so that i can understand clearly

i am sorry for that ..
i am typical javarancher

thak's once again
bye
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why java script is not used in struts framework