You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sundaram <wi...@yahoo.co.in> on 2011/05/03 20:49:23 UTC

Myfaces extension: changing default resource uri

Myfaces resources for extension are loaded from this default path

/faces/myFacesExtensionResource/*

But in my web app, for security purpose urls can have only 
path like this /faces/fduf/*

and thus extension resources are not getting loaded in webpages, as
extension resource urls are not allowed.

How can i change the default extension url.


usual entry in web.xml
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>
-- 
View this message in context: http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31535354.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Myfaces extension: changing default resource uri

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

Look here (just replace extensionResource with ndm):

http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/examples/simple20/src/main/webapp/WEB-INF/web.xml

Check this param:

  <context-param>
    <description>
        Change the url-pattern from the ExtensionsFilter
        Default is "/faces/myFacesExtensionResource"
        Note: The filter-mapping for ExtensionsFilter, the url-pattern is
        this value + "/*", else there comes a exception
    </description>
    <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
    <param-value>/faces/extensionResource</param-value>
  </context-param>

and then this one:

  <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
  </filter-mapping>

it could be too:

  <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/extensionResource/*</url-pattern>
  </filter-mapping>

regards,

Leonardo

2011/5/4 sundaram <wi...@yahoo.co.in>:
>
> can you provide a example for this.
>
>
> like original resource location = /faces/myFacesExtensionResource/*
>
> allowed url = /faces/ndm/*
>
>
>
> Leonardo Uribe wrote:
>>
>> Hi
>>
>> The web config param you are looking for is this one:
>>
>> org.apache.myfaces.RESOURCE_VIRTUAL_PATH
>>
>> by default is:
>>
>> /faces/myFacesExtensionResource
>>
>> so you'll need to change your filter mapping and this param to make it
>> work.
>>
>> regards,
>>
>> Leonardo
>>
>> 2011/5/3 sundaram <wi...@yahoo.co.in>:
>>>
>>> Myfaces resources for extension are loaded from this default path
>>>
>>> /faces/myFacesExtensionResource/*
>>>
>>> But in my web app, for security purpose urls can have only
>>> path like this /faces/fduf/*
>>>
>>> and thus extension resources are not getting loaded in webpages, as
>>> extension resource urls are not allowed.
>>>
>>> How can i change the default extension url.
>>>
>>>
>>> usual entry in web.xml
>>>    <filter-mapping>
>>>        <filter-name>MyFacesExtensionsFilter</filter-name>
>>>        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
>>>    </filter-mapping>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31535354.html
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31543632.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: Myfaces extension: changing default resource uri

Posted by sundaram <wi...@yahoo.co.in>.
can you provide a example for this.


like original resource location = /faces/myFacesExtensionResource/*

allowed url = /faces/ndm/*



Leonardo Uribe wrote:
> 
> Hi
> 
> The web config param you are looking for is this one:
> 
> org.apache.myfaces.RESOURCE_VIRTUAL_PATH
> 
> by default is:
> 
> /faces/myFacesExtensionResource
> 
> so you'll need to change your filter mapping and this param to make it
> work.
> 
> regards,
> 
> Leonardo
> 
> 2011/5/3 sundaram <wi...@yahoo.co.in>:
>>
>> Myfaces resources for extension are loaded from this default path
>>
>> /faces/myFacesExtensionResource/*
>>
>> But in my web app, for security purpose urls can have only
>> path like this /faces/fduf/*
>>
>> and thus extension resources are not getting loaded in webpages, as
>> extension resource urls are not allowed.
>>
>> How can i change the default extension url.
>>
>>
>> usual entry in web.xml
>>    <filter-mapping>
>>        <filter-name>MyFacesExtensionsFilter</filter-name>
>>        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
>>    </filter-mapping>
>> --
>> View this message in context:
>> http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31535354.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31543632.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Myfaces extension: changing default resource uri

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

The web config param you are looking for is this one:

org.apache.myfaces.RESOURCE_VIRTUAL_PATH

by default is:

/faces/myFacesExtensionResource

so you'll need to change your filter mapping and this param to make it work.

regards,

Leonardo

2011/5/3 sundaram <wi...@yahoo.co.in>:
>
> Myfaces resources for extension are loaded from this default path
>
> /faces/myFacesExtensionResource/*
>
> But in my web app, for security purpose urls can have only
> path like this /faces/fduf/*
>
> and thus extension resources are not getting loaded in webpages, as
> extension resource urls are not allowed.
>
> How can i change the default extension url.
>
>
> usual entry in web.xml
>    <filter-mapping>
>        <filter-name>MyFacesExtensionsFilter</filter-name>
>        <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
>    </filter-mapping>
> --
> View this message in context: http://old.nabble.com/Myfaces-extension%3A-changing-default-resource-uri-tp31535354p31535354.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>