You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sebestyén Csaba <cs...@freesoft.hu> on 2005/08/31 10:45:00 UTC

cannot use AddResource class to add my own resources

Hi!

 

I wrote a new component based on MyFaces, and this component has an external JS resource. While rendering, I want to add the reference of this resource by the AddResource class: I tried simply to call AddResource.addJavaScriptToHeader(...). But unfortunately this function can handle only the resources of the MyFaces components, because of the line 203:

   if( ! name.startsWith(COMPONENTS_PACKAGE) ){   log.error(  ....

 

If I write my own AddResource class (functions like yours), the ExtensionsFilter still references the old AddReource class (between lines 106 and 132), so I need to implement a new ExtensionFilter to handle my resources well.

 

This solution of my problem works, but I won't use it. I need a more structured solution. What shall I do to use the original AddResource class? And what are these "security reasons", why the restriction to the package name is required?

 

 

Thanks,

 

Csaba

 


Re: cannot use AddResource class to add my own resources

Posted by Martin Marinschek <ma...@gmail.com>.
I believe this need not be checked for, right.

Open a jira issue on this, and assign "Sylvain Vieujot" to the issue -
he is the original author of the ExtensionFilter.

regards,

Martin

On 8/31/05, Sebestyén Csaba <cs...@freesoft.hu> wrote:
>  
>  
> 
> Hi! 
> 
>   
> 
> I wrote a new component based on MyFaces, and this component has an external
> JS resource. While rendering, I want to add the reference of this resource
> by the AddResource class: I tried simply to call
> AddResource.addJavaScriptToHeader(...). But unfortunately
> this function can handle only the resources of the MyFaces components,
> because of the line 203: 
> 
>    if( ! name.startsWith(COMPONENTS_PACKAGE) ){   log.error(  .... 
> 
>   
> 
> If I write my own AddResource class (functions like yours), the
> ExtensionsFilter still references the old AddReource class (between lines
> 106 and 132), so I need to implement a new ExtensionFilter to handle my
> resources well. 
> 
>   
> 
> This solution of my problem works, but I won't use it. I need a more
> structured solution. What shall I do to use the original AddResource class?
> And what are these „security reasons", why the restriction to the package
> name is required? 
> 
>   
> 
>   
> 
> Thanks, 
> 
>   
> 
> Csaba 
> 
>   


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German