Topic: Where exactly to usage of Java script and servlet? (Read 977 times)
Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: Apr 26, 2011, 03:07:42 pm »
I have learnt basics of Java script now my query is in which part of application JS must be used and which part servlet must be used. I think in places where the request need not be sent to the serve (like check whether all entries are filled in a form) JS is used and servlet is used when validation at server side is needed(like checking password or reserving a cinema ticket) i dont no how far i am correct. Please guide me.
My Name is Enigo Montoya
Posts: 32
236 credits Members referred : 0
« Reply #1 on: May 10, 2011, 07:11:29 pm »
Java script is basically used to make the user experience to a better level. If a user doesn't fill out all fields, but clicks the submit button anyway, Javascript can tell them very fast what is the problem. But if you go back to the server without all the field filled in, and the server has to send back a page with an error message, then it's very slow (well, not so slow, maybe 1 or 2 seconds, but to the user that looks slow). But you can't trust the JavaScript. People can disable it, or play games with it. Hackers love JavaScript ;-). The server must check everything too. So you use Javascript to make things faster and better for user, but your servlet must also check the things that come back from the user, and make sure everything is OK. Then, the user is happy, and your server is safe from people who try to trick you.
Cyberpunk Wannabe
Posts: 44
300 credits Members referred : 0
« Reply #2 on: Aug 18, 2011, 11:47:30 am »
java script is used to make the user experience better. If a user doesn't fill out all fields, but clicks the submit button anyway, Javascript can tell them very fast what is the problem. But if you go back to the server without all the field filled in, and the server has to send back a page with an error message, then it's very slow (well, not so slow, maybe 1 or 2 seconds, but to the user that looks slow). But you can't trust the JavaScript. People can disable it, or play games with it. Hackers love JavaScript ;-). The server must check everything too. So you use Javascript to make things faster and better for user, but your servlet must also check the things that come back from the user, and make sure everything is
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=11825