You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2010/05/20 18:03:08 UTC

Re: Null from urlFor() on

urlfor does not guarantee a url for every irequesttarget
implementation you throw at it. only a "standard" subset of targets is
supported, mainly the ones that provide the "standard" functionality
such as page, component, and resource urls.

if wicket does not provide a way to build the url you may do so
yourself by subclassing webrequestcodingstrategy and adding the
instanceof check for the particular target type.

as far as this particular cases, i would defintely say that this
particular target is outside the standard requirements and as such i
dont think we need to provide url building for it out of the box.
however, should you choose to implement it you are more then welcome
to submit a patch.

-igor


On 5/20/10, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
> We are trying to "tunnel" some images from a content system, and run into a
> problem trying to make URLs for them via UrLResourceStream: Stepping through
> the code we see some instanceof-testing but none which deals with this
> particular resource type. Is there some missing code somewhere or a better
> approach to use?
>
>                 WebMarkupContainer cont = new WebMarkupContainer("image");
>                 try {
>                         URL image = new
> URL("http://servername/servletname/path?parameter=velue");
>                         UrlResourceStream stream = new
> UrlResourceStream(image);
>                         ResourceStreamRequestTarget target = new
> ResourceStreamRequestTarget(stream);
>                         CharSequence link = urlFor(target); // RETURNS NULL
>                         cont.add(new SimpleAttributeModifier("src", link));
>                 } catch (MalformedURLException e) {
>                         e.printStackTrace();
>                 }
>                 this.add(cont);
>
>
> Med vennlig hilsen
>
> TOR IVER WILHELMSEN
> Senior systemutvikler
> Arrive AS
> T (+47) 48 16 06 18
> E-post: toriverw@arrive.no
> http://www.arrive.no
> http://servicedesk.arrive.no
>
>
>
>

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