messages in jsp

catch (aException de)

{

messages.add(ActionMessages.GLOBAL_MESSAGE,new

ActionMessage("ary"));

}

catch (Exception e)

{

// Report the error using the appropriate name and ID.

messages.add(ActionMessages.GLOBAL_MESSAGE,new

ActionMessage("cry"));

}

if (!messages.isEmpty())

{

saveMessages(request,messages);

}

jsp code in error page

<bean:write key="ary">

<bean:write key="cry">

getting both message at a time while I want one message at a time depending on exception.

also tried logic present but no avail

[636 byte] By [smita_smitaa] at [2007-10-3 2:26:14]
# 1
try this:<logic:messagesPresent message="true"><html:messages id="msg" message="true"><bean:write name="msg"/></html:messages></logic:messagesPresent>
rainMysterya at 2007-7-14 19:25:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanxs rain for effort.already solved
smita_smitaa at 2007-7-14 19:25:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...