tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnold Schneeberger" <arnold.schneeber...@liwest.at>
Subject JspValueExpression behavior different
Date Sat, 02 Aug 2008 18:29:39 GMT
Why does the methode "isLiteralText" always return "true" in my custom tag?
There are obvious different behaviors between jetty and tomcat.


public class EncryptedEmailTag extends UIComponentELTag {

	... 

	private ValueExpression address;

	...

	protected void setProperties(UIComponent component) {
		super.setProperties(component);
		if (address != null) {
			if (address.isLiteralText()) {
                try {
                	component.getAttributes().put("address",
address.getExpressionString());
                } catch (ELException e) {
                    throw new FacesException(e);
                }
				
			} else {
				component.setValueExpression("address",
address);
			}
		}
		...
	}
	...
}


public class UIEncryptedEmail extends UIOutput {
	
	...

	@Override
	public void encodeChildren(FacesContext context) throws IOException
{

		// get email address
		String address = null;
		if (getValueExpression("address") != null) {
			address = (String)
getValueExpression("address").getValue(context.getELContext());
		} else {
			address = (String) getAttributes().get("address");
		}
	...
}


for a short jsf block like this the string #{contact.text} is a literal 
on jetty it work correct.


                	<a4j:repeat id="contactsRepeater"
value="#{employee.contacts}" var="contact">
                		<h:panelGroup rendered="#{contact.type ==
'EMAIL'}">
               				<fiwup:encryptedEmail id="email"
address="#{contact.text}" />
                			<br>
                		</h:panelGroup>
                		
          		 		<h:panelGroup
rendered="#{contact.type != 'EMAIL'}">
                			<span><h:outputText
value="#{contact.text}" /></span>
                			<br>
                		</h:panelGroup>
                	</a4j:repeat>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message