how to split an error message using String.split
843836Mar 4 2005 — edited Mar 4 2005SQL 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