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