Re: getting context from java Class

2013-04-08 Thread Ivan Khalopik
If you need context path you can inject Request:

@Inject
private Request request;

public String getContextPath() {
return request.getContextPath()
}




On Mon, Apr 8, 2013 at 10:25 AM, Taha Hafeez Siddiqi <
tawus.tapes...@gmail.com> wrote:

>
> Hi
>
> You can use assets in your page using @Path annotation.
>
> @Inject
> @Path("context:images/tapestry_banner.gif")
> private Asset banner;
>
> Read more about it at
>
> http://tapestry.apache.org/assets.html
>
> regards
> Taha
>
> On 08-Apr-2013, at 12:28 PM, Alberto Fernández 
> wrote:
>
> > Context is already working on my .tml classes, but I would like to invoke
> > it from .java
> >
> > Alberto Fernández
> >
> > Consultoría Informática EASIS, SL 
> > Email: afernan...@easis.es 
> >
> >
> > 2013/4/7 Dmitry Gusev 
> >
> >> Hi,
> >>
> >> "context" is a binding prefix, your code should be:
> >>
> >> 
> >>
> >> Look here:
> >> http://tapestry.apache.org/assets.html
> >>
> >>
> >>
> >> On Sun, Apr 7, 2013 at 7:44 PM, Alberto Fernández  >>> wrote:
> >>
> >>> Hi everybody,
> >>>
> >>> From .tml classes I can get my images url usring context. For example:
> >>>
> >>> 
> >>>
> >>> But now I need the context in my .java class
> >>>
> >>> Are there a way to call context from here?
> >>>
> >>> Thanks a lot
> >>>
> >>
> >>
> >>
> >> --
> >> Dmitry Gusev
> >>
> >> AnjLab Team
> >> http://anjlab.com
> >>
>
>


-- 
BR
Ivan


Re: getting context from java Class

2013-04-08 Thread Taha Hafeez Siddiqi

Hi

You can use assets in your page using @Path annotation.

@Inject
@Path("context:images/tapestry_banner.gif")
private Asset banner;

Read more about it at

http://tapestry.apache.org/assets.html

regards
Taha

On 08-Apr-2013, at 12:28 PM, Alberto Fernández  wrote:

> Context is already working on my .tml classes, but I would like to invoke
> it from .java
> 
> Alberto Fernández
> 
> Consultoría Informática EASIS, SL 
> Email: afernan...@easis.es 
> 
> 
> 2013/4/7 Dmitry Gusev 
> 
>> Hi,
>> 
>> "context" is a binding prefix, your code should be:
>> 
>> 
>> 
>> Look here:
>> http://tapestry.apache.org/assets.html
>> 
>> 
>> 
>> On Sun, Apr 7, 2013 at 7:44 PM, Alberto Fernández >> wrote:
>> 
>>> Hi everybody,
>>> 
>>> From .tml classes I can get my images url usring context. For example:
>>> 
>>> 
>>> 
>>> But now I need the context in my .java class
>>> 
>>> Are there a way to call context from here?
>>> 
>>> Thanks a lot
>>> 
>> 
>> 
>> 
>> --
>> Dmitry Gusev
>> 
>> AnjLab Team
>> http://anjlab.com
>> 



Re: getting context from java Class

2013-04-07 Thread Alberto Fernández
Context is already working on my .tml classes, but I would like to invoke
it from .java

Alberto Fernández

Consultoría Informática EASIS, SL 
Email: afernan...@easis.es 


2013/4/7 Dmitry Gusev 

> Hi,
>
> "context" is a binding prefix, your code should be:
>
> 
>
> Look here:
> http://tapestry.apache.org/assets.html
>
>
>
> On Sun, Apr 7, 2013 at 7:44 PM, Alberto Fernández  >wrote:
>
> > Hi everybody,
> >
> > From .tml classes I can get my images url usring context. For example:
> >
> > 
> >
> > But now I need the context in my .java class
> >
> > Are there a way to call context from here?
> >
> > Thanks a lot
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>


Re: getting context from java Class

2013-04-07 Thread Dmitry Gusev
Hi,

"context" is a binding prefix, your code should be:



Look here:
http://tapestry.apache.org/assets.html



On Sun, Apr 7, 2013 at 7:44 PM, Alberto Fernández wrote:

> Hi everybody,
>
> From .tml classes I can get my images url usring context. For example:
>
> 
>
> But now I need the context in my .java class
>
> Are there a way to call context from here?
>
> Thanks a lot
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


getting context from java Class

2013-04-07 Thread Alberto Fernández
Hi everybody,

>From .tml classes I can get my images url usring context. For example:



But now I need the context in my .java class

Are there a way to call context from here?

Thanks a lot