You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Arnold Schneeberger <ar...@liwest.at> on 2008/08/02 20:29:39 UTC

JspValueExpression behavior different

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


Re: AW: JspValueExpression behavior different

Posted by Mark Thomas <ma...@apache.org>.
Arnold Schneeberger wrote:
> Is there a workaround - or what you mean with "probably a bug"

I mean that if the behaviours are different, at least one implementation 
has a bug. From a quick scan, it looks like Tomcat is in the wrong but I 
haven't looked at it in any detail.

Mark



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


AW: JspValueExpression behavior different

Posted by Arnold Schneeberger <ar...@liwest.at>.
Is there a workaround - or what you mean with "probably a bug"

-----Ursprüngliche Nachricht-----
Von: Mark Thomas [mailto:markt@apache.org] 
Gesendet: Samstag, 02. August 2008 20:40
An: Tomcat Developers List
Betreff: Re: JspValueExpression behavior different

Arnold Schneeberger wrote:
> Why does the methode "isLiteralText" always return "true" in my custom
tag?
> There are obvious different behaviors between jetty and tomcat.

Probably a bug.

Mark



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



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


Re: JspValueExpression behavior different

Posted by Mark Thomas <ma...@apache.org>.
Arnold Schneeberger wrote:
> Why does the methode "isLiteralText" always return "true" in my custom tag?
> There are obvious different behaviors between jetty and tomcat.

Probably a bug.

Mark



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