RE: Clay not escaping strings?

2007-08-09 Thread Richard Eggert
See below.




-Original Message-
From: Gary VanMatre [mailto:[EMAIL PROTECTED]
Sent: Thu 8/9/2007 11:53 AM
To: user@shale.apache.org
Subject: Re: Clay not escaping strings?
 
> #{mybean.prop}). 


Actually, this doesn't work.  I still get the same error message, which I can 
only assume is because Clay is internally nesting an f:verbatim (with 
escape="false") within the h:outputText.

As I indicated in my other email, the only way to get this to work is to do 
this :
Mockup value 
here

(escape="true" is unnecessary here since that is the default behavior of 
outputText)

It sure would be nice if there were a way to tell Clay whether to escape such 
strings (perhaps an "escapeProps" attribute added to the clay:clay component).  
In my case, the current behavior is never what I want to happen, and I suspect 
that would be the case in just about any application that doesn't need to store 
HTML in its managed beans.  



Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com


Re: Shale and Oracle ADF Faces.

2007-08-09 Thread Gary VanMatre
>From: "Anthony Yulo" <[EMAIL PROTECTED]> 
>
> Is there already a workaround to using Shale with Oracle ADF Faces (not 
> Trinidad)? 
> 
> 
> 
> I had read an article dated 2006 that there is a conflict between the 
> Servlet Filters by Shale and Oracle ADF faces. 
>

You can override the shale dialog prefix using a context param in the web.xml.  
The default is "dialog:" but you can provide your own.

This feature was added to the 1.0.4 release:
https://issues.apache.org/struts/browse/SHALE-355



  org.apache.shale.dialog.DIALOG_PREFIX
  sdialog:


 
 
> But does anyone has successfully used Shale and Oracle ADF Faces 
> together? 
> 
> 
> 
> I want to try using Shale's Dialog Manager instead of Oracles ADF Faces' 
> Dialog Framework. I want to test the waters if Shale's Dialog would 
> satisfy my needs. 
> 
> 
> 
> Regards, 
> 
> 
> 
> Anton 
> 
> 

Gary

Re: Clay not escaping strings?

2007-08-09 Thread Gary VanMatre
>From: "Richard Eggert" <[EMAIL PROTECTED]> 
>
> I'm using Clay with HTML templates in an application on which I am working. 
> In 
> several cases, I refer to managed bean properties directly in my template 
> text 
> (e.g., #{mybean.prop}). I recently noticed MyFaces' ReducedHTMLParser 
> throwing exceptions about malformed HTML. Not finding any problems in my HTML 
> template itself, I looked at the generated page source and discovered that in 
> cases where a managed bean property contained special characters (in my case, 
> less-than and greater-than signs), Clay is apparently not escaping them 
> before 
> rendering them. 
> 
> Is this a bug in Clay or a "feature" (or a configuration problem on my part)? 
> 


This is a "feature" :-).  The way that Clay works is that any markup in the 
template that doesn't map to a JSF component is treated as "verbatim".
If the markup contains a value binding expression, it's evaluated but there
is not an attempt to identify (parse out) a inline expression within the markup.

In the example above, the value expression would equate to the following:

ValueBinding vb = 
FacesContext.getCurrentInstance().createValueBinding("#{mybean.prop}");


Something you might try is wrapping these expressions is a span tag 
mapped to an outputText component.

Consider:

#{mybean.prop}). 



> Is there any workaround aside from putting calls to 
> org.apache.commons.lang.StringEscapeUtils.escapeHtml() in every managed bean 
> "getter" method that returns a String or wrapping all references in > 
> escape="true">? 
> 
> I'm using Shale v1.0.4. 
> 
> 
> Rich Eggert 
> Member of Technical Staff 
> Proteus Technologies, LLC 
> http://www.proteus-technologies.com 


Gary

> 
> 

RE: Clay not escaping strings?

2007-08-09 Thread Richard Eggert
Just a follow-up:

Wrapping it in  doesn't seem to work.  
Instead, I have to use #{mybean.prop} (I keep the body for mockup purposes).


Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com



-Original Message-
From: Richard Eggert [mailto:[EMAIL PROTECTED]
Sent: Thu 8/9/2007 10:31 AM
To: user@shale.apache.org
Subject: Clay not escaping strings?
 
I'm using Clay with HTML templates in an application on which I am working.  In 
several cases, I refer to managed bean properties directly in my template text 
(e.g., #{mybean.prop}).  I recently noticed MyFaces' ReducedHTMLParser 
throwing exceptions about malformed HTML.  Not finding any problems in my HTML 
template itself, I looked at the generated page source and discovered that in 
cases where a managed bean property contained special characters (in my case, 
less-than and greater-than signs), Clay is apparently not escaping them before 
rendering them.

Is this a bug in Clay or a "feature" (or a configuration problem on my part)?

Is there any workaround aside from putting calls to 
org.apache.commons.lang.StringEscapeUtils.escapeHtml() in every managed bean 
"getter" method that returns a String or wrapping all references in ?

I'm using Shale v1.0.4.


Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com




Clay not escaping strings?

2007-08-09 Thread Richard Eggert
I'm using Clay with HTML templates in an application on which I am working.  In 
several cases, I refer to managed bean properties directly in my template text 
(e.g., #{mybean.prop}).  I recently noticed MyFaces' ReducedHTMLParser 
throwing exceptions about malformed HTML.  Not finding any problems in my HTML 
template itself, I looked at the generated page source and discovered that in 
cases where a managed bean property contained special characters (in my case, 
less-than and greater-than signs), Clay is apparently not escaping them before 
rendering them.

Is this a bug in Clay or a "feature" (or a configuration problem on my part)?

Is there any workaround aside from putting calls to 
org.apache.commons.lang.StringEscapeUtils.escapeHtml() in every managed bean 
"getter" method that returns a String or wrapping all references in ?

I'm using Shale v1.0.4.


Rich Eggert
Member of Technical Staff
Proteus Technologies, LLC
http://www.proteus-technologies.com



Shale and Oracle ADF Faces.

2007-08-09 Thread Anthony Yulo
Is there already a workaround to using Shale with Oracle ADF Faces (not
Trinidad)?  

 

I had read an article dated 2006 that there is a conflict between the
Servlet Filters by Shale and Oracle ADF faces.  

But does anyone has successfully used Shale and Oracle ADF Faces
together?

 

I want to try using Shale's Dialog Manager instead of Oracles ADF Faces'
Dialog Framework.  I want to test the waters if Shale's Dialog would
satisfy my needs.

 

Regards,

 

Anton