Everyone (beginning with me) is telling him to use JavaScript. He
says (privately to me) that his boss insists that validation take
place on the server (typical boss - probably from Marketing). So I'm
guessing he wants a servlet to getParameter() and validate the
contents, and if unacceptable, send back an appropriate response.
Seems dumb to me, unless there is some kind of error logging
requirement.
Cheers!
Mark
----- Original Message -----
From: "Ramesh, Kesav" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 06, 2001 1:31 AM
Subject: Re: How can I catch an JSP error ????
> use java script to do this
>
>
> Regards
>
> Ramesh Kesavanarayanan
>
> Electronic Data Systems
> Steeple Reach,
> 25, Cathedral Road,
> A SEI-CMM® Level-3 Organization
> 91-44-811 3801 to 15 ext :2186
> 91-44-233 0380 (res)
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> Happiness is easy but learning not to be unhappy is difficult
>
>
> -----Original Message-----
> From: BERWART Thierry [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 7:34 PM
> To: [EMAIL PROTECTED]
> Subject: How can I catch an JSP error ????
>
>
> Hello,
>
> I have a jsp which filled a bean with 3 variables : a name, an
address email
> and an age.
>
> This is a part of my JSP :
>
> <%@ page import="test_tbe" errorPage="error.jsp" %>
>
> <jsp:useBean id ="test" scope="page" class="test_tbe" />
> <jsp:setProperty name="test" property="name" param="p_name"/>
> <jsp:setProperty name="test" property="email" param="p_email"/>
> <jsp:setProperty name="test" property="age" param="p_age"/>
>
> <HTML>
> <BODY>
> <BR><BR>
> Hello
> <BR>
> please enter your name and your email ...
>
> <FORM METHOD="GET">
> Name :
> <INPUT TYPE="text" name="p_name">
> <BR> Email :
> <INPUT TYPE="text" name="p_email">
> <BR> Age :
> <INPUT TYPE="text" name="p_age">
> <BR><BR>
> <INPUT TYPE="SUBMIT">
> ...
>
>
> in my bean, the variable is defined as an int.
> And so, when the user enter a string, I got an
> org.apache.jasper.JasperException ...
>
> My question is : is it possible to catch this exception and
> display an error message like " the age field must be numeric" ...
???
>
> Thanks
>
> Thierry
>
> This is my bean :
>
> import java.util.*;
> public class test_tbe
> {
> private String name=null,email=null;
> private int age;
>
> public test_tbe()
> {
> }
>
> public String getName()
> {
> return email;
> }
>
> public int getAge()
> {
> return age;
> }
>
> public void setName(String p_name)
> {
> name = new String(p_name);
> }
>
> public void setEmail(String p_email)
> {
> email = new String(p_email);
> }
>
> public void setAge(int p_age)
> {
> age = p_age;
> }
>
> }
>
>
______________________________________________________________________
_____
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
______________________________________________________________________
_____
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html