How to change value of code in <spring:message code>

I am in trouble by using in my html. Actually i have defined some errors in file.
spraying_schedule_master_unq1=Duplicate Record.
post_role_master_unq1=Record for This Applicable Date Already Exists.

If any error occurred in controller class I have set that error to session:

session.setAttribute(SessionAttribute.error.toString(), error); 

And that error message i am showing at html:

<spring:message code="${error}" />

It works fine when error occurred as defined in property file but problem began when sessoin error contain different error from property file that time it shows error. So my problem is when error message is not present in property file it should display default message. Can I do that, if yes how? please give me a solution i am stuck here. Thanks


<spring:message code="${error}" text="your default text here" />

Need Your Help

Read XML files with Java

java xml xml-parsing xmldom

I need to read a XML file with java. File structure as below.

Delete lines starting with a unique number

python unique repeat

I'm learning Python and created this program, but it won't work and I'm hoping someone can find the error!