You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ju...@VerizonWireless.com on 2004/03/17 19:42:41 UTC

Links within ActionErrors

I know this probably violates some basic guidlines but...
I am trying to display an html link rendered by the message in the
ActionErrors section of a JSP.
My problem is that the '<' and '>' symbols are being replaced by '& l t;'
and '& # 034;'  (their equivelent)
How can I prevent this translation from happening?

Example:
In the applicationresources file we have something like the following:
	error.save.dup.link=<a href="{0}">click for details</a>
The action class creates the actual link address and adds an actionError as
follows:
	tActionErrors.add(ActionErrors.GLOBAL_ERROR,
		new ActionError("error.save.dup.link", 
	
iRequest.getRequestURL().substring(0,iRequest.getRequestURL().lastIndexOf("/
")) +
		"/blah blah blah" ));
	  saveErrors(iRequest, tActionErrors);

In the JSP we have tags to dislay the errors:
	<logic:messagesPresent>
	  <table><tr><td>
	  	<b><span id="errorsHeader"><bean:message
key="errors.validation.header"/></span></b>
	  	<html:messages id="error">
	          <c:out value="${error}"/>
	        </html:messages>
	  </td></tr></table>
	</logic:messagesPresent>
	
When the error is displayed because the '<' and '>' signs have been replaced
it just show the text as follows:
	<a href="http://localhost:8080/blah blah blah"> click to see </a>




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Links within ActionErrors

Posted by Robert Taylor <rt...@mulework.com>.
Use <c:out value="${error}" escapeXml="false"/>


robert
> -----Original Message-----
> From: Julio.Font@VerizonWireless.com
> [mailto:Julio.Font@VerizonWireless.com]
> Sent: Wednesday, March 17, 2004 1:43 PM
> To: struts-user@jakarta.apache.org
> Subject: Links within ActionErrors
> 
> 
> I know this probably violates some basic guidlines but...
> I am trying to display an html link rendered by the message in the
> ActionErrors section of a JSP.
> My problem is that the '<' and '>' symbols are being replaced by '& l t;'
> and '& # 034;'  (their equivelent)
> How can I prevent this translation from happening?
> 
> Example:
> In the applicationresources file we have something like the following:
> 	error.save.dup.link=<a href="{0}">click for details</a>
> The action class creates the actual link address and adds an actionError as
> follows:
> 	tActionErrors.add(ActionErrors.GLOBAL_ERROR,
> 		new ActionError("error.save.dup.link", 
> 	
> iRequest.getRequestURL().substring(0,iRequest.getRequestURL().lastIndexOf("/
> ")) +
> 		"/blah blah blah" ));
> 	  saveErrors(iRequest, tActionErrors);
> 
> In the JSP we have tags to dislay the errors:
> 	<logic:messagesPresent>
> 	  <table><tr><td>
> 	  	<b><span id="errorsHeader"><bean:message
> key="errors.validation.header"/></span></b>
> 	  	<html:messages id="error">
> 	          <c:out value="${error}"/>
> 	        </html:messages>
> 	  </td></tr></table>
> 	</logic:messagesPresent>
> 	
> When the error is displayed because the '<' and '>' signs have been replaced
> it just show the text as follows:
> 	<a href="http://localhost:8080/blah blah blah"> click to see </a>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org