Almost ... people can turn off Javascript in their browsers.
If you want to perform error checking on the client-side using Javascript, it still doesn't mean you don't have to fully handle the errors in the servlet/Java code.
 
Client/Server : Validate in the client and the server
3-tier: Validate in the client, the middle-tier and in the database
 
A common case is, Javascript -> Java -> (PL/SQL, TransactSQL, etc).
 
It will be nice when 1 language can really be used in all tiers.  (When I say really: I don't mean downloading a huge JAR to client on the other end of a 28.8 modem; nor database vendors that support Java, almost).
 
Thor HW
----- Original Message -----
Sent: Sunday, August 08, 1999 9:13 PM
Subject: Re: Strange Question

Hi Andras,

Another solution to this kind of a problem where the user does not fill in all the fields when he is suppossed to is to validate it at the form level itself before  sending the request to the servlet. You can use Javascript or something like that to do this. So this will remove all the unwnated validations from the servlet side and make your code clearer.

Hope this helps

Nitin

Balogh Andras wrote:

       Hi,         I have a strange question. How hard is to the server to handle Exceptions ?To be more precise here is an example:I have a form with 3 fields:name,telephone,address.I retrieve the parameters in the servlet with the usuallymethod req.getParameterValues("name")[0].Now if the servlet is called from the right form that everything is OK.But if someone removes the 'name' field from the form my servlet throws aNullPointerException wich is a normal behavior.So my question is: this exception will be a SHOCK to the server(or the JVM) or it will terminate the servlet as nothing were happen?Or another question: Too many exceptions will produce anabnormal behavior  of the server(JVM) after a time ??I am asking this question becuase if the answer is NO (meening that Exceptions don't affect at allthe server or JVM) that i will drop the extra if conditions like:if(req.getParameterValues("name")!=null) name=req.getParameterValues("name")[0].  Waiting for Your answers. Thank you,                Andras
 

Reply via email to