Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to split an error message using String.split

843836Mar 4 2005 — edited Mar 4 2005
SQL Exception Occured javax.servlet.jsp.JspException: INSERT INTO APPLICATION_DEFINITION_TABLE VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) : Duplicate key or integrity constraint violation message from server: "Duplicate entry 'WETWTR-WERT' for key 1"

I want to split the error message on ":"

<c:out value="${ErrMsg}"> </c:out>
<% String[] ErrArray = Pattern.compile(":").split(ErrMsg,2);%>
<c:out value=" ${ErrArray[0]}"></c:out>
<c:out value=" ${ErrArray[1]}"></c:out>
<c:out value=" ${ErrArray[2]}"></c:out>
</c:if>

Can anyone help. I have spent lot of time using PAttern,Matcher class..

Regards,
Sun
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2005
Added on Mar 4 2005
2 comments
311 views