You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ma...@sanofi-aventis.com on 2008/01/11 17:31:08 UTC

Is it possible to use AddResource with my own components?

Hi,

 

I've written a custom component that requires some Javascript. I have
the js in an external file but I was hoping to have it included in the
tag, kind of like the myfaces tags do. I tried using the AddResource
class, basically looked at the myfaces source and tried to do the same
thing, but it fails on the component validation. It checks if the
package starts with org.apache.myfaces.custom... or something like that.
I can't really get past that unless if I want to rebuild myfaces. Is
there a way to get this to work externally? Or is there a way to do this
I don't know about. For now I have to just manually include the script
in the JSP pages. This will work, but it can lead to complication if
someone else is using the tag and neglects to add the javascript.

 

Thanks

Matt


Re: Is it possible to use AddResource with my own components?

Posted by simon <si...@chello.at>.
On Fri, 2008-01-11 at 17:31 +0100, Matt.Rossner-prest@sanofi-aventis.com
wrote:
> Hi,
> 
>  
> 
> I’ve written a custom component that requires some Javascript. I have
> the js in an external file but I was hoping to have it included in the
> tag, kind of like the myfaces tags do. I tried using the AddResource
> class, basically looked at the myfaces source and tried to do the same
> thing, but it fails on the component validation. It checks if the
> package starts with org.apache.myfaces.custom… or something like that.
> I can’t really get past that unless if I want to rebuild myfaces. Is
> there a way to get this to work externally? Or is there a way to do
> this I don’t know about. For now I have to just manually include the
> script in the JSP pages. This will work, but it can lead to
> complication if someone else is using the tag and neglects to add the
> javascript.

I know that this code was written with the intention of allowing other
people to use it for their own resources.

However if I remember correctly, it was decided to require users to
write and register a simple subclass of one of the pieces to "enable"
serving resources from their own package. This greatly reduces the
possibility that an attacker could trick the ExtensionsFilter into
serving out all the resources an application had on its classpath
(possibly including config files with database passwords etc).

Sorry I cannot remember the exact details for the moment.

Of course as this code is licensed under the APL, you are also free to
take the necessary bits and modify them as needed. If you redistribute
the result, you do need to make some minor acknowledgements; the exact
details will be somewhere on the Apache website.

Regards,

Simon


RE: Is it possible to use AddResource with my own components?

Posted by Ma...@sanofi-aventis.com.
Thanks, this helps a lot. You're right it's not difficult or fancy but it was also not documented until now. So I thank you for taking the time to update the wiki page.

Matt

-----Message d'origine-----
De : Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Envoyé : mercredi 16 janvier 2008 09:37
À : MyFaces Discussion
Objet : Re: Is it possible to use AddResource with my own components?

Thanks a lot!

regards,

Martin

On 1/16/08, David Delbecq <de...@oma.be> wrote:
> http://wiki.apache.org/myfaces/External_Resources
> :)
> En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
> ces termes:
> > Hi David,
> >
> > would you be willing - if time permits - to post a short outline of your
> > solution on our Wiki?
> >
> > Thanks very much in advance!
> >
> > regards,
> >
> > Martin
> >
> > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Did here, nothing difficult or fancy about it. Just use the
> >> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> >> Then use on it, methods with signature addXXX(...., ResourceHandler
> >> resourceHandler);
> >> You just have to code your own resourceHandler class. Main job of this
> >> class is to split and check the ressources requested. It then returns a
> >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> >> which serve the requested content. Overall here, we had just a few lines
> >> of code.
> >>
> >> Another more stupid solution is to indeed put your resources in a
> >> subpackage of org.apache.myfaces.custom :)
> >>
> >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >>
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I've written a custom component that requires some Javascript. I have
> >>> the js in an external file but I was hoping to have it included in the
> >>> tag, kind of like the myfaces tags do. I tried using the AddResource
> >>> class, basically looked at the myfaces source and tried to do the same
> >>> thing, but it fails on the component validation. It checks if the
> >>> package starts with org.apache.myfaces.custom... or something like that
>
>
> --
> http://www.devlog.be (a belgian developer's logs)
>
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Is it possible to use AddResource with my own components?

Posted by Martin Marinschek <ma...@gmail.com>.
Thanks a lot!

regards,

Martin

On 1/16/08, David Delbecq <de...@oma.be> wrote:
> http://wiki.apache.org/myfaces/External_Resources
> :)
> En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
> ces termes:
> > Hi David,
> >
> > would you be willing - if time permits - to post a short outline of your
> > solution on our Wiki?
> >
> > Thanks very much in advance!
> >
> > regards,
> >
> > Martin
> >
> > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Did here, nothing difficult or fancy about it. Just use the
> >> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> >> Then use on it, methods with signature addXXX(...., ResourceHandler
> >> resourceHandler);
> >> You just have to code your own resourceHandler class. Main job of this
> >> class is to split and check the ressources requested. It then returns a
> >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> >> which serve the requested content. Overall here, we had just a few lines
> >> of code.
> >>
> >> Another more stupid solution is to indeed put your resources in a
> >> subpackage of org.apache.myfaces.custom :)
> >>
> >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >>
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I've written a custom component that requires some Javascript. I have
> >>> the js in an external file but I was hoping to have it included in the
> >>> tag, kind of like the myfaces tags do. I tried using the AddResource
> >>> class, basically looked at the myfaces source and tried to do the same
> >>> thing, but it fails on the component validation. It checks if the
> >>> package starts with org.apache.myfaces.custom… or something like that
>
>
> --
> http://www.devlog.be (a belgian developer's logs)
>
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Is it possible to track the user's action?

Posted by Svilen Ivanov <sv...@gmail.com>.
Yes - Spring gives more power. However this is suitable for vanilla JSF projects

2008/1/18, Alonso Isidoro Roman <al...@gmail.com>:
> i think that you need spring framework,  In fact, you need the Interceptors
> that spring provides.
>
> 2008/1/17, liumin HU <lh...@sigems.fr>:
> > hi Svilen,
> >
> > It works well, Thank you very  much. Just the getAction() is a deprecated
> > method.
> >
> > liu
> >
> >
> > ----- Original Message -----
> > From: "Svilen Ivanov" <sv...@gmail.com>
> > To: "MyFaces Discussion" < users@myfaces.apache.org>
> > Sent: Wednesday, January 16, 2008 10:51 AM
> > Subject: Re: Is it possible to track the user's action?
> >
> >
> > > Hi liu,
> > >
> > > This might help:
> > >
> http://www.mail-archive.com/users@myfaces.apache.org/msg42241.html
> > >
> > > It is ActionListener that logs which action is called from the UI.
> > >
> > > Hope this helps
> > >
> > > Regards,
> > > Svilen
> > >
> > >
> > > 2008/1/16, general.equal.700 <ge...@gmail.com>:
> > >> Hi liu,
> > >>
> > >> You can create servlet filters and phase listeners.
> > >>
> > >> -OE
> > >>
> > >> -----Original Message-----
> > >> From: liumin HU [mailto:lhu@sigems.fr]
> > >> Sent: Wednesday, January 16, 2008 3:58 AM
> > >> To: MyFaces Discussion
> > >> Subject: Is it possible to track the user's action?
> > >>
> > >> hi all,
> > >>
> > >> I think it is not a really question of myface. but I hope i can get
> some
> > >> suggestion here.
> > >>
> > >> I want to know ,for analysing the bug,how to collect which action is
> > >> called
> > >> by user and what is sended from interface. I think i can do it If I add
> a
> > >> system.out in every method. But it is not very elegant et simple. Can
> we
> > >> do
> > >> it in a other way?
> > >>
> > >> Any suggestion is appreciated.
> > >>
> > >> sorry for my poor egnlish and thanks in advance.
> > >>
> > >> liu
> > >>
> > >>
> > >> ----- Original Message -----
> > >> From: "Martin Marinschek" <martin.marinschek@gmail.com >
> > >> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> > >> Sent: Wednesday, January 16, 2008 9:36 AM
> > >> Subject: Re: Is it possible to use AddResource with my own components?
> > >>
> > >>
> > >> Thanks a lot!
> > >>
> > >> regards,
> > >>
> > >> Martin
> > >>
> > >> On 1/16/08, David Delbecq <delbd+jakarta@oma.be > wrote:
> > >> > http://wiki.apache.org/myfaces/External_Resources
> > >> > :)
> > >> > En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait
> en
> > >> > ces termes:
> > >> > > Hi David,
> > >> > >
> > >> > > would you be willing - if time permits - to post a short outline of
> > >> > > your
> > >> > > solution on our Wiki?
> > >> > >
> > >> > > Thanks very much in advance!
> > >> > >
> > >> > > regards,
> > >> > >
> > >> > > Martin
> > >> > >
> > >> > > On Jan 12, 2008 2:33 PM, David Delbecq < delbd+jakarta@oma.be>
> wrote:
> > >> > >
> > >> > >
> > >> > >> Did here, nothing difficult or fancy about it. Just use the
> > >> > >> addResourcesFactory.getInstance(...) to get an instance of
> > >> > >> AddResource.
> > >> > >> Then use on it, methods with signature addXXX(....,
> ResourceHandler
> > >> > >> resourceHandler);
> > >> > >> You just have to code your own resourceHandler class. Main job of
> > >> > >> this
> > >> > >> class is to split and check the ressources requested. It then
> > >> > >> returns a
> > >> > >> class of type
> org.apache.myfaces.renderkit.html.util.ResourceLoader
> > >> > >> which serve the requested content. Overall here, we had just a few
> > >> > >> lines
> > >> > >> of code.
> > >> > >>
> > >> > >> Another more stupid solution is to indeed put your resources in a
> > >> > >> subpackage of org.apache.myfaces.custom :)
> > >> > >>
> > >> > >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> > >> > >>
> > >> > >>> Hi,
> > >> > >>>
> > >> > >>>
> > >> > >>>
> > >> > >>> I've written a custom component that requires some Javascript. I
> > >> > >>> have
> > >> > >>> the js in an external file but I was hoping to have it included
> in
> > >> > >>> the
> > >> > >>> tag, kind of like the myfaces tags do. I tried using the
> > >> > >>> AddResource
> > >> > >>> class, basically looked at the myfaces source and tried to do the
> > >> > >>> same
> > >> > >>> thing, but it fails on the component validation. It checks if the
> > >> > >>> package starts with org.apache.myfaces.custom… or something like
> > >> > >>> that
> > >> >
> > >> >
> > >> > --
> > >> > http://www.devlog.be (a belgian developer's logs)
> > >> >
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >>
> > >> http://www.irian.at
> > >>
> > >> Your JSF powerhouse -
> > >> JSF Consulting, Development and
> > >> Courses in English and German
> > >>
> > >> Professional Support for Apache MyFaces
> > >>
> > >>
> > >
> > >
> > > --
> > > Svilen Ivanov
> > > http://svilen-online.blogspot.com
> > >
> > > There is no dark side of the moon really.
> > > Matter of fact it's all dark.
> > >
> >
> >
>
>
>
> --
> Alonso Isidoro Roman.


-- 
Svilen Ivanov
http://svilen-online.blogspot.com

There is no dark side of the moon really.
Matter of fact it's all dark.

Re: Is it possible to track the user's action?

Posted by Alonso Isidoro Roman <al...@gmail.com>.
i think that you need spring framework,  In fact, you need the Interceptors
that spring provides.

2008/1/17, liumin HU <lh...@sigems.fr>:
>
> hi Svilen,
>
> It works well, Thank you very  much. Just the getAction() is a deprecated
> method.
>
> liu
>
>
> ----- Original Message -----
> From: "Svilen Ivanov" <sv...@gmail.com>
> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> Sent: Wednesday, January 16, 2008 10:51 AM
> Subject: Re: Is it possible to track the user's action?
>
>
> > Hi liu,
> >
> > This might help:
> > http://www.mail-archive.com/users@myfaces.apache.org/msg42241.html
> >
> > It is ActionListener that logs which action is called from the UI.
> >
> > Hope this helps
> >
> > Regards,
> > Svilen
> >
> >
> > 2008/1/16, general.equal.700 <ge...@gmail.com>:
> >> Hi liu,
> >>
> >> You can create servlet filters and phase listeners.
> >>
> >> -OE
> >>
> >> -----Original Message-----
> >> From: liumin HU [mailto:lhu@sigems.fr]
> >> Sent: Wednesday, January 16, 2008 3:58 AM
> >> To: MyFaces Discussion
> >> Subject: Is it possible to track the user's action?
> >>
> >> hi all,
> >>
> >> I think it is not a really question of myface. but I hope i can get
> some
> >> suggestion here.
> >>
> >> I want to know ,for analysing the bug,how to collect which action is
> >> called
> >> by user and what is sended from interface. I think i can do it If I add
> a
> >> system.out in every method. But it is not very elegant et simple. Can
> we
> >> do
> >> it in a other way?
> >>
> >> Any suggestion is appreciated.
> >>
> >> sorry for my poor egnlish and thanks in advance.
> >>
> >> liu
> >>
> >>
> >> ----- Original Message -----
> >> From: "Martin Marinschek" <ma...@gmail.com>
> >> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> >> Sent: Wednesday, January 16, 2008 9:36 AM
> >> Subject: Re: Is it possible to use AddResource with my own components?
> >>
> >>
> >> Thanks a lot!
> >>
> >> regards,
> >>
> >> Martin
> >>
> >> On 1/16/08, David Delbecq <de...@oma.be> wrote:
> >> > http://wiki.apache.org/myfaces/External_Resources
> >> > :)
> >> > En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait
> en
> >> > ces termes:
> >> > > Hi David,
> >> > >
> >> > > would you be willing - if time permits - to post a short outline of
> >> > > your
> >> > > solution on our Wiki?
> >> > >
> >> > > Thanks very much in advance!
> >> > >
> >> > > regards,
> >> > >
> >> > > Martin
> >> > >
> >> > > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be>
> wrote:
> >> > >
> >> > >
> >> > >> Did here, nothing difficult or fancy about it. Just use the
> >> > >> addResourcesFactory.getInstance(...) to get an instance of
> >> > >> AddResource.
> >> > >> Then use on it, methods with signature addXXX(....,
> ResourceHandler
> >> > >> resourceHandler);
> >> > >> You just have to code your own resourceHandler class. Main job of
> >> > >> this
> >> > >> class is to split and check the ressources requested. It then
> >> > >> returns a
> >> > >> class of type
> org.apache.myfaces.renderkit.html.util.ResourceLoader
> >> > >> which serve the requested content. Overall here, we had just a few
> >> > >> lines
> >> > >> of code.
> >> > >>
> >> > >> Another more stupid solution is to indeed put your resources in a
> >> > >> subpackage of org.apache.myfaces.custom :)
> >> > >>
> >> > >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >> > >>
> >> > >>> Hi,
> >> > >>>
> >> > >>>
> >> > >>>
> >> > >>> I've written a custom component that requires some Javascript. I
> >> > >>> have
> >> > >>> the js in an external file but I was hoping to have it included
> in
> >> > >>> the
> >> > >>> tag, kind of like the myfaces tags do. I tried using the
> >> > >>> AddResource
> >> > >>> class, basically looked at the myfaces source and tried to do the
> >> > >>> same
> >> > >>> thing, but it fails on the component validation. It checks if the
> >> > >>> package starts with org.apache.myfaces.custom… or something like
> >> > >>> that
> >> >
> >> >
> >> > --
> >> > http://www.devlog.be (a belgian developer's logs)
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >>
> >> http://www.irian.at
> >>
> >> Your JSF powerhouse -
> >> JSF Consulting, Development and
> >> Courses in English and German
> >>
> >> Professional Support for Apache MyFaces
> >>
> >>
> >
> >
> > --
> > Svilen Ivanov
> > http://svilen-online.blogspot.com
> >
> > There is no dark side of the moon really.
> > Matter of fact it's all dark.
> >
>
>


-- 
Alonso Isidoro Roman.

Re: Is it possible to track the user's action?

Posted by liumin HU <lh...@sigems.fr>.
hi Svilen,

It works well, Thank you very  much. Just the getAction() is a deprecated 
method.

liu


----- Original Message ----- 
From: "Svilen Ivanov" <sv...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, January 16, 2008 10:51 AM
Subject: Re: Is it possible to track the user's action?


> Hi liu,
>
> This might help:
> http://www.mail-archive.com/users@myfaces.apache.org/msg42241.html
>
> It is ActionListener that logs which action is called from the UI.
>
> Hope this helps
>
> Regards,
> Svilen
>
>
> 2008/1/16, general.equal.700 <ge...@gmail.com>:
>> Hi liu,
>>
>> You can create servlet filters and phase listeners.
>>
>> -OE
>>
>> -----Original Message-----
>> From: liumin HU [mailto:lhu@sigems.fr]
>> Sent: Wednesday, January 16, 2008 3:58 AM
>> To: MyFaces Discussion
>> Subject: Is it possible to track the user's action?
>>
>> hi all,
>>
>> I think it is not a really question of myface. but I hope i can get some
>> suggestion here.
>>
>> I want to know ,for analysing the bug,how to collect which action is 
>> called
>> by user and what is sended from interface. I think i can do it If I add a
>> system.out in every method. But it is not very elegant et simple. Can we 
>> do
>> it in a other way?
>>
>> Any suggestion is appreciated.
>>
>> sorry for my poor egnlish and thanks in advance.
>>
>> liu
>>
>>
>> ----- Original Message -----
>> From: "Martin Marinschek" <ma...@gmail.com>
>> To: "MyFaces Discussion" <us...@myfaces.apache.org>
>> Sent: Wednesday, January 16, 2008 9:36 AM
>> Subject: Re: Is it possible to use AddResource with my own components?
>>
>>
>> Thanks a lot!
>>
>> regards,
>>
>> Martin
>>
>> On 1/16/08, David Delbecq <de...@oma.be> wrote:
>> > http://wiki.apache.org/myfaces/External_Resources
>> > :)
>> > En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
>> > ces termes:
>> > > Hi David,
>> > >
>> > > would you be willing - if time permits - to post a short outline of 
>> > > your
>> > > solution on our Wiki?
>> > >
>> > > Thanks very much in advance!
>> > >
>> > > regards,
>> > >
>> > > Martin
>> > >
>> > > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
>> > >
>> > >
>> > >> Did here, nothing difficult or fancy about it. Just use the
>> > >> addResourcesFactory.getInstance(...) to get an instance of 
>> > >> AddResource.
>> > >> Then use on it, methods with signature addXXX(...., ResourceHandler
>> > >> resourceHandler);
>> > >> You just have to code your own resourceHandler class. Main job of 
>> > >> this
>> > >> class is to split and check the ressources requested. It then 
>> > >> returns a
>> > >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
>> > >> which serve the requested content. Overall here, we had just a few
>> > >> lines
>> > >> of code.
>> > >>
>> > >> Another more stupid solution is to indeed put your resources in a
>> > >> subpackage of org.apache.myfaces.custom :)
>> > >>
>> > >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
>> > >>
>> > >>> Hi,
>> > >>>
>> > >>>
>> > >>>
>> > >>> I've written a custom component that requires some Javascript. I 
>> > >>> have
>> > >>> the js in an external file but I was hoping to have it included in 
>> > >>> the
>> > >>> tag, kind of like the myfaces tags do. I tried using the 
>> > >>> AddResource
>> > >>> class, basically looked at the myfaces source and tried to do the 
>> > >>> same
>> > >>> thing, but it fails on the component validation. It checks if the
>> > >>> package starts with org.apache.myfaces.custom… or something like 
>> > >>> that
>> >
>> >
>> > --
>> > http://www.devlog.be (a belgian developer's logs)
>> >
>> >
>> >
>>
>>
>> --
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>>
>
>
> -- 
> Svilen Ivanov
> http://svilen-online.blogspot.com
>
> There is no dark side of the moon really.
> Matter of fact it's all dark.
> 


Re: Is it possible to track the user's action?

Posted by Svilen Ivanov <sv...@gmail.com>.
Hi liu,

This might help:
http://www.mail-archive.com/users@myfaces.apache.org/msg42241.html

It is ActionListener that logs which action is called from the UI.

Hope this helps

Regards,
Svilen


2008/1/16, general.equal.700 <ge...@gmail.com>:
> Hi liu,
>
> You can create servlet filters and phase listeners.
>
> -OE
>
> -----Original Message-----
> From: liumin HU [mailto:lhu@sigems.fr]
> Sent: Wednesday, January 16, 2008 3:58 AM
> To: MyFaces Discussion
> Subject: Is it possible to track the user's action?
>
> hi all,
>
> I think it is not a really question of myface. but I hope i can get some
> suggestion here.
>
> I want to know ,for analysing the bug,how to collect which action is called
> by user and what is sended from interface. I think i can do it If I add a
> system.out in every method. But it is not very elegant et simple. Can we do
> it in a other way?
>
> Any suggestion is appreciated.
>
> sorry for my poor egnlish and thanks in advance.
>
> liu
>
>
> ----- Original Message -----
> From: "Martin Marinschek" <ma...@gmail.com>
> To: "MyFaces Discussion" <us...@myfaces.apache.org>
> Sent: Wednesday, January 16, 2008 9:36 AM
> Subject: Re: Is it possible to use AddResource with my own components?
>
>
> Thanks a lot!
>
> regards,
>
> Martin
>
> On 1/16/08, David Delbecq <de...@oma.be> wrote:
> > http://wiki.apache.org/myfaces/External_Resources
> > :)
> > En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
> > ces termes:
> > > Hi David,
> > >
> > > would you be willing - if time permits - to post a short outline of your
> > > solution on our Wiki?
> > >
> > > Thanks very much in advance!
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
> > >
> > >
> > >> Did here, nothing difficult or fancy about it. Just use the
> > >> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> > >> Then use on it, methods with signature addXXX(...., ResourceHandler
> > >> resourceHandler);
> > >> You just have to code your own resourceHandler class. Main job of this
> > >> class is to split and check the ressources requested. It then returns a
> > >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> > >> which serve the requested content. Overall here, we had just a few
> > >> lines
> > >> of code.
> > >>
> > >> Another more stupid solution is to indeed put your resources in a
> > >> subpackage of org.apache.myfaces.custom :)
> > >>
> > >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> > >>
> > >>> Hi,
> > >>>
> > >>>
> > >>>
> > >>> I've written a custom component that requires some Javascript. I have
> > >>> the js in an external file but I was hoping to have it included in the
> > >>> tag, kind of like the myfaces tags do. I tried using the AddResource
> > >>> class, basically looked at the myfaces source and tried to do the same
> > >>> thing, but it fails on the component validation. It checks if the
> > >>> package starts with org.apache.myfaces.custom… or something like that
> >
> >
> > --
> > http://www.devlog.be (a belgian developer's logs)
> >
> >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>


-- 
Svilen Ivanov
http://svilen-online.blogspot.com

There is no dark side of the moon really.
Matter of fact it's all dark.

RE: Is it possible to track the user's action?

Posted by "general.equal.700" <ge...@gmail.com>.
Hi liu,

You can create servlet filters and phase listeners.

-OE

-----Original Message-----
From: liumin HU [mailto:lhu@sigems.fr] 
Sent: Wednesday, January 16, 2008 3:58 AM
To: MyFaces Discussion
Subject: Is it possible to track the user's action?

hi all,

I think it is not a really question of myface. but I hope i can get some 
suggestion here.

I want to know ,for analysing the bug,how to collect which action is called 
by user and what is sended from interface. I think i can do it If I add a 
system.out in every method. But it is not very elegant et simple. Can we do 
it in a other way?

Any suggestion is appreciated.

sorry for my poor egnlish and thanks in advance.

liu


----- Original Message ----- 
From: "Martin Marinschek" <ma...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, January 16, 2008 9:36 AM
Subject: Re: Is it possible to use AddResource with my own components?


Thanks a lot!

regards,

Martin

On 1/16/08, David Delbecq <de...@oma.be> wrote:
> http://wiki.apache.org/myfaces/External_Resources
> :)
> En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
> ces termes:
> > Hi David,
> >
> > would you be willing - if time permits - to post a short outline of your
> > solution on our Wiki?
> >
> > Thanks very much in advance!
> >
> > regards,
> >
> > Martin
> >
> > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Did here, nothing difficult or fancy about it. Just use the
> >> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> >> Then use on it, methods with signature addXXX(...., ResourceHandler
> >> resourceHandler);
> >> You just have to code your own resourceHandler class. Main job of this
> >> class is to split and check the ressources requested. It then returns a
> >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> >> which serve the requested content. Overall here, we had just a few 
> >> lines
> >> of code.
> >>
> >> Another more stupid solution is to indeed put your resources in a
> >> subpackage of org.apache.myfaces.custom :)
> >>
> >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >>
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I've written a custom component that requires some Javascript. I have
> >>> the js in an external file but I was hoping to have it included in the
> >>> tag, kind of like the myfaces tags do. I tried using the AddResource
> >>> class, basically looked at the myfaces source and tried to do the same
> >>> thing, but it fails on the component validation. It checks if the
> >>> package starts with org.apache.myfaces.custom… or something like that
>
>
> --
> http://www.devlog.be (a belgian developer's logs)
>
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces 


Is it possible to track the user's action?

Posted by liumin HU <lh...@sigems.fr>.
hi all,

I think it is not a really question of myface. but I hope i can get some 
suggestion here.

I want to know ,for analysing the bug,how to collect which action is called 
by user and what is sended from interface. I think i can do it If I add a 
system.out in every method. But it is not very elegant et simple. Can we do 
it in a other way?

Any suggestion is appreciated.

sorry for my poor egnlish and thanks in advance.

liu


----- Original Message ----- 
From: "Martin Marinschek" <ma...@gmail.com>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Wednesday, January 16, 2008 9:36 AM
Subject: Re: Is it possible to use AddResource with my own components?


Thanks a lot!

regards,

Martin

On 1/16/08, David Delbecq <de...@oma.be> wrote:
> http://wiki.apache.org/myfaces/External_Resources
> :)
> En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en
> ces termes:
> > Hi David,
> >
> > would you be willing - if time permits - to post a short outline of your
> > solution on our Wiki?
> >
> > Thanks very much in advance!
> >
> > regards,
> >
> > Martin
> >
> > On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
> >
> >
> >> Did here, nothing difficult or fancy about it. Just use the
> >> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> >> Then use on it, methods with signature addXXX(...., ResourceHandler
> >> resourceHandler);
> >> You just have to code your own resourceHandler class. Main job of this
> >> class is to split and check the ressources requested. It then returns a
> >> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> >> which serve the requested content. Overall here, we had just a few 
> >> lines
> >> of code.
> >>
> >> Another more stupid solution is to indeed put your resources in a
> >> subpackage of org.apache.myfaces.custom :)
> >>
> >> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >>
> >>> Hi,
> >>>
> >>>
> >>>
> >>> I've written a custom component that requires some Javascript. I have
> >>> the js in an external file but I was hoping to have it included in the
> >>> tag, kind of like the myfaces tags do. I tried using the AddResource
> >>> class, basically looked at the myfaces source and tried to do the same
> >>> thing, but it fails on the component validation. It checks if the
> >>> package starts with org.apache.myfaces.custom… or something like that
>
>
> --
> http://www.devlog.be (a belgian developer's logs)
>
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces 


Re: Is it possible to use AddResource with my own components?

Posted by David Delbecq <de...@oma.be>.
http://wiki.apache.org/myfaces/External_Resources
:)
En l'instant précis du 15/01/08 21:33, Martin Marinschek s'exprimait en 
ces termes:
> Hi David,
>
> would you be willing - if time permits - to post a short outline of your
> solution on our Wiki?
>
> Thanks very much in advance!
>
> regards,
>
> Martin
>
> On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:
>
>   
>> Did here, nothing difficult or fancy about it. Just use the
>> addResourcesFactory.getInstance(...) to get an instance of AddResource.
>> Then use on it, methods with signature addXXX(...., ResourceHandler
>> resourceHandler);
>> You just have to code your own resourceHandler class. Main job of this
>> class is to split and check the ressources requested. It then returns a
>> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
>> which serve the requested content. Overall here, we had just a few lines
>> of code.
>>
>> Another more stupid solution is to indeed put your resources in a
>> subpackage of org.apache.myfaces.custom :)
>>
>> Matt.Rossner-prest@sanofi-aventis.com a écrit :
>>     
>>> Hi,
>>>
>>>
>>>
>>> I've written a custom component that requires some Javascript. I have
>>> the js in an external file but I was hoping to have it included in the
>>> tag, kind of like the myfaces tags do. I tried using the AddResource
>>> class, basically looked at the myfaces source and tried to do the same
>>> thing, but it fails on the component validation. It checks if the
>>> package starts with org.apache.myfaces.custom… or something like that


-- 
http://www.devlog.be (a belgian developer's logs)



Re: Is it possible to use AddResource with my own components?

Posted by Martin Marinschek <ma...@gmail.com>.
Hi David,

would you be willing - if time permits - to post a short outline of your
solution on our Wiki?

Thanks very much in advance!

regards,

Martin

On Jan 12, 2008 2:33 PM, David Delbecq <de...@oma.be> wrote:

> Did here, nothing difficult or fancy about it. Just use the
> addResourcesFactory.getInstance(...) to get an instance of AddResource.
> Then use on it, methods with signature addXXX(...., ResourceHandler
> resourceHandler);
> You just have to code your own resourceHandler class. Main job of this
> class is to split and check the ressources requested. It then returns a
> class of type org.apache.myfaces.renderkit.html.util.ResourceLoader
> which serve the requested content. Overall here, we had just a few lines
> of code.
>
> Another more stupid solution is to indeed put your resources in a
> subpackage of org.apache.myfaces.custom :)
>
> Matt.Rossner-prest@sanofi-aventis.com a écrit :
> >
> > Hi,
> >
> >
> >
> > I've written a custom component that requires some Javascript. I have
> > the js in an external file but I was hoping to have it included in the
> > tag, kind of like the myfaces tags do. I tried using the AddResource
> > class, basically looked at the myfaces source and tried to do the same
> > thing, but it fails on the component validation. It checks if the
> > package starts with org.apache.myfaces.custom… or something like that.
> > I can't really get past that unless if I want to rebuild myfaces. Is
> > there a way to get this to work externally? Or is there a way to do
> > this I don't know about. For now I have to just manually include the
> > script in the JSP pages. This will work, but it can lead to
> > complication if someone else is using the tag and neglects to add the
> > javascript.
> >
> >
> >
> > Thanks
> >
> > Matt
> >
>
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Is it possible to use AddResource with my own components?

Posted by David Delbecq <de...@oma.be>.
Did here, nothing difficult or fancy about it. Just use the 
addResourcesFactory.getInstance(...) to get an instance of AddResource.
Then use on it, methods with signature addXXX(...., ResourceHandler 
resourceHandler);
You just have to code your own resourceHandler class. Main job of this 
class is to split and check the ressources requested. It then returns a 
class of type org.apache.myfaces.renderkit.html.util.ResourceLoader 
which serve the requested content. Overall here, we had just a few lines 
of code.

Another more stupid solution is to indeed put your resources in a 
subpackage of org.apache.myfaces.custom :)

Matt.Rossner-prest@sanofi-aventis.com a écrit :
>
> Hi,
>
>  
>
> I’ve written a custom component that requires some Javascript. I have 
> the js in an external file but I was hoping to have it included in the 
> tag, kind of like the myfaces tags do. I tried using the AddResource 
> class, basically looked at the myfaces source and tried to do the same 
> thing, but it fails on the component validation. It checks if the 
> package starts with org.apache.myfaces.custom… or something like that. 
> I can’t really get past that unless if I want to rebuild myfaces. Is 
> there a way to get this to work externally? Or is there a way to do 
> this I don’t know about. For now I have to just manually include the 
> script in the JSP pages. This will work, but it can lead to 
> complication if someone else is using the tag and neglects to add the 
> javascript.
>
>  
>
> Thanks
>
> Matt
>


Re: Is it possible to use AddResource with my own components?

Posted by Rogerio Pereira <ro...@gmail.com>.
The best solution is ask for permission to use myfaces AddResource code into
your component code.
The resource handling will be standardized in JSF 2.0 (I think).

2008/1/11, Matt.Rossner-prest@sanofi-aventis.com <
Matt.Rossner-prest@sanofi-aventis.com>:
>
>  Hi,
>
>
>
> I've written a custom component that requires some Javascript. I have the
> js in an external file but I was hoping to have it included in the tag, kind
> of like the myfaces tags do. I tried using the AddResource class, basically
> looked at the myfaces source and tried to do the same thing, but it fails on
> the component validation. It checks if the package starts with
> org.apache.myfaces.custom… or something like that. I can't really get past
> that unless if I want to rebuild myfaces. Is there a way to get this to work
> externally? Or is there a way to do this I don't know about. For now I have
> to just manually include the script in the JSP pages. This will work, but it
> can lead to complication if someone else is using the tag and neglects to
> add the javascript.
>
>
>
> Thanks
>
> Matt
>



-- 
Yours truly (Atenciosamente),

Rogério (_rogerio_)
http://faces.eti.br

"Faça a diferença! Ajude o seu país a crescer, não retenha conhecimento,
distribua e aprenda mais." (http://faces.eti.br/?p=45)