You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Toncart <jo...@gmail.com> on 2011/12/05 19:12:52 UTC

urlFor()

Hi guys,

with 1.4 I was doing:
ResourceReference resourceImg = new ResourceReference(name + ".jpg");
String urlString = RequestCycle.get().urlFor(imageResource).toString();

Now with 1.5 I can't do this, not know where is problem.

Does anyone know how to do this in 1.5 please?

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by Igor Vaynberg <ig...@gmail.com>.
actually, request handler has: public final CharSequence
urlFor(ResourceReference reference, PageParameters params)

-igor

On Mon, Dec 5, 2011 at 10:29 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> urlfor(new ResourceReferenceRequestHandler(ref))
>
> -igor
>
> On Mon, Dec 5, 2011 at 10:26 AM, John Toncart <jo...@gmail.com> wrote:
>> PackageResourceReference resourceImg = new PackageResourceReference(name +
>> ".jpg");
>> String urlString = RequestCycle.get().urlFor(imageResource).toString();
>>
>> gives me error:
>> The method urlFor(IRequestHandler) in the type RequestCycle is not
>> applicable for the arguments (PackageResourceReference)
>>
>> which is exact problem I have :-( So exact question is: how to get url from
>> PackageResourceReference? "1.4 method" won't work anymore or I miss
>> somethink.
>>
>>
>>
>> Martin Grigorov wrote:
>>>
>>>
>>> org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)
>>>
>>>
>>> 2011/12/5 John Toncart <jo...@gmail.com>:
>>>>
>>>> Hi guys,
>>>>
>>>> with 1.4 I was doing: ResourceReference resourceImg = new
>>>> ResourceReference(name + ".jpg"); String urlString =
>>>> RequestCycle.get().urlFor(imageResource).toString();
>>>>
>>>> Now with 1.5 I can't do this, not know where is problem.
>>>>
>>>> Does anyone know how to do this in 1.5 please?
>>>>
>>>> John
>>>>
>>>> ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For
>>>> additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by Igor Vaynberg <ig...@gmail.com>.
urlfor(new ResourceReferenceRequestHandler(ref))

-igor

On Mon, Dec 5, 2011 at 10:26 AM, John Toncart <jo...@gmail.com> wrote:
> PackageResourceReference resourceImg = new PackageResourceReference(name +
> ".jpg");
> String urlString = RequestCycle.get().urlFor(imageResource).toString();
>
> gives me error:
> The method urlFor(IRequestHandler) in the type RequestCycle is not
> applicable for the arguments (PackageResourceReference)
>
> which is exact problem I have :-( So exact question is: how to get url from
> PackageResourceReference? "1.4 method" won't work anymore or I miss
> somethink.
>
>
>
> Martin Grigorov wrote:
>>
>>
>> org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)
>>
>>
>> 2011/12/5 John Toncart <jo...@gmail.com>:
>>>
>>> Hi guys,
>>>
>>> with 1.4 I was doing: ResourceReference resourceImg = new
>>> ResourceReference(name + ".jpg"); String urlString =
>>> RequestCycle.get().urlFor(imageResource).toString();
>>>
>>> Now with 1.5 I can't do this, not know where is problem.
>>>
>>> Does anyone know how to do this in 1.5 please?
>>>
>>> John
>>>
>>> ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For
>>> additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by John Toncart <jo...@gmail.com>.
Martin, mea culpa, I overlook PageParams in urlFor(). Thanks for your
hint.


Martin Grigorov wrote:
> Why don't use an IDE. It gives you the method signature and even suggests fixes:
> 
> RequestCycle.get().urlFor(imageResource, null).toString();
> 
> On Mon, Dec 5, 2011 at 7:26 PM, John Toncart <jo...@gmail.com> wrote:
>> PackageResourceReference resourceImg = new PackageResourceReference(name +
>> ".jpg");
>> String urlString = RequestCycle.get().urlFor(imageResource).toString();
>>
>> gives me error:
>> The method urlFor(IRequestHandler) in the type RequestCycle is not
>> applicable for the arguments (PackageResourceReference)
>>
>> which is exact problem I have :-( So exact question is: how to get url from
>> PackageResourceReference? "1.4 method" won't work anymore or I miss
>> somethink.
>>
>>
>>
>> Martin Grigorov wrote:
>>>
>>> org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)
>>>
>>>
>>> 2011/12/5 John Toncart <jo...@gmail.com>:
>>>> Hi guys,
>>>>
>>>> with 1.4 I was doing: ResourceReference resourceImg = new
>>>> ResourceReference(name + ".jpg"); String urlString =
>>>> RequestCycle.get().urlFor(imageResource).toString();
>>>>
>>>> Now with 1.5 I can't do this, not know where is problem.
>>>>
>>>> Does anyone know how to do this in 1.5 please?
>>>>
>>>> John
>>>>
>>>> ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For
>>>> additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by Martin Grigorov <mg...@apache.org>.
Why don't use an IDE. It gives you the method signature and even suggests fixes:

RequestCycle.get().urlFor(imageResource, null).toString();

On Mon, Dec 5, 2011 at 7:26 PM, John Toncart <jo...@gmail.com> wrote:
> PackageResourceReference resourceImg = new PackageResourceReference(name +
> ".jpg");
> String urlString = RequestCycle.get().urlFor(imageResource).toString();
>
> gives me error:
> The method urlFor(IRequestHandler) in the type RequestCycle is not
> applicable for the arguments (PackageResourceReference)
>
> which is exact problem I have :-( So exact question is: how to get url from
> PackageResourceReference? "1.4 method" won't work anymore or I miss
> somethink.
>
>
>
> Martin Grigorov wrote:
>>
>>
>> org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)
>>
>>
>> 2011/12/5 John Toncart <jo...@gmail.com>:
>>>
>>> Hi guys,
>>>
>>> with 1.4 I was doing: ResourceReference resourceImg = new
>>> ResourceReference(name + ".jpg"); String urlString =
>>> RequestCycle.get().urlFor(imageResource).toString();
>>>
>>> Now with 1.5 I can't do this, not know where is problem.
>>>
>>> Does anyone know how to do this in 1.5 please?
>>>
>>> John
>>>
>>> ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For
>>> additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by John Toncart <jo...@gmail.com>.
PackageResourceReference resourceImg = new PackageResourceReference(name 
+ ".jpg");
String urlString = RequestCycle.get().urlFor(imageResource).toString();

gives me error:
The method urlFor(IRequestHandler) in the type RequestCycle is not 
applicable for the arguments (PackageResourceReference)

which is exact problem I have :-( So exact question is: how to get url 
from PackageResourceReference? "1.4 method" won't work anymore or I miss
somethink.


Martin Grigorov wrote:
> org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)
> 
> 
> 2011/12/5 John Toncart <jo...@gmail.com>:
>> Hi guys,
>> 
>> with 1.4 I was doing: ResourceReference resourceImg = new
>> ResourceReference(name + ".jpg"); String urlString =
>> RequestCycle.get().urlFor(imageResource).toString();
>> 
>> Now with 1.5 I can't do this, not know where is problem.
>> 
>> Does anyone know how to do this in 1.5 please?
>> 
>> John
>> 
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For
>> additional commands, e-mail: users-help@wicket.apache.org
>> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: urlFor()

Posted by Martin Grigorov <mg...@apache.org>.
org.apache.wicket.request.resource.PackageResourceReference.PackageResourceReference(String)

2011/12/5 John Toncart <jo...@gmail.com>:
> Hi guys,
>
> with 1.4 I was doing:
> ResourceReference resourceImg = new ResourceReference(name + ".jpg");
> String urlString = RequestCycle.get().urlFor(imageResource).toString();
>
> Now with 1.5 I can't do this, not know where is problem.
>
> Does anyone know how to do this in 1.5 please?
>
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org