Hi Sweety,
i write jsp in that jsp i have done all validation using javascript.so when clint request through browser where that script exected on client side or server side?
Although the JavaScript is generated by JSP in server, JavaScript ALWAYS being executed in client browser.
if client side then if my browser doesnot support java script validation what happen?
In this case, all JavaScript will NOT be executed, and all checkings will not be performed. Thus, in practice, we will do one more layer.
We first check the input from the users in the browser via JavaScript, we will also check it once again in the server-side (say
Servlets) before the data is really put into the database or being process.
This is because, when JavaScript is disabled, the checking will be by-passed, and invalid data can be sent to the server which may harm the server. Thus, being doing anything, we will check it once again.
You may think that, if we check it 2 times, then, maybe the checking in browser can be removed. But this may not be the case. Since JavaScript can prompt the user immediately if the enter the wrong data. Thus, this saves the network bandwidth that every time, wrong data are only triggered by the server component.
Does this help you?
Nick.
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)