>At 04:42 PM 9/15/99 +0000, Sandy Tiu wrote:
>>"Account does not exist."
>>
>>I found out that I have to parse the above string and replace all spaces
>>with a "%20" before appending it to the url. It worked after
>>I did this. Is there a better way?
>
><%
>String encodedMsg = java.net.URLEncoder.encode(e.getMessage());
>response.sendRedirect("udpate_error.jsp?msg=" + encodedMsg);
>%>
>
>Although, I think a better way would be to have the databse throw an
>exception, and then set <%@ page errorPage="update_error.jsp" %>, instead
>of trying to pass an exception message in the URL.

...or just pass an error_code=some number and write the message on
update_error.jsp based on the error code.

Eric M. Andersen
I/T Specialist
IBM Global Services
Tel: (781) 895-2637,   Fax : (781) 895-2843, t/line : 362-2637
Internet ID:  [EMAIL PROTECTED]
Lotus Notes ID: Eric M Andersen/Waltham/IBM

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to