There was also just a new strategy added in 1.4 (I know you're on 1.3.5 -
but just so you or others are aware of it) for creating very nice URLs for
resources.  See this commit:

http://fisheye6.atlassian.com/changelog/wicket/?cs=729078

-- 
Jeremy Thomerson
http://www.wickettraining.com

On Thu, Dec 25, 2008 at 7:18 PM, jWeekend <[email protected]>wrote:

>
> Take a look at Wicket's shared resources if you need a stable URL.
> You may get some ideas
> http://www.nabble.com/Re%3A-Mounting-shared-resources-p15236047.html here
> too.
>
> Regards - Cemal
> http://www.jWeekend.co.uk <http://www.jweekend.co.uk/> jWeekend
>
>
> smallufo wrote:
> >
> > Hi
> >
> > I hope I can use wicket to serve image data.
> > I know I can extend org.apache.wicket.markup.html.image.Image and provide
> > a
> > DynamicImageResource
> > but the generated image link is
> > http://localhost/app/?wicket:interface=:0:customImage::IResourceListener
> ::
> > The image data is stored in the session and not bookmarkable, which is
> not
> > what I want.
> >
> >
> > I then created an ImagePage extends WebPage and override onBeforeRender()
> > ,
> > and coding below :
> > HttpServletResponse response = ((WebResponse)
> > getWebRequestCycle().getResponse()).getHttpServletResponse();
> >     try
> >     {
> >       response.setContentType("image/png");
> >
> >       OutputStream responseOutputStream = response.getOutputStream();
> >
> >       responseOutputStream.write(myImageBytes);
> >       responseOutputStream.flush();
> >       responseOutputStream.close();
> >     }
> >     catch (IOException e)
> >     {
> >       e.printStackTrace();
> >     }
> >
> > It works !!! And I can bookmark the image.
> >
> > But there are warning output :
> >
> > 2008-12-26 02:20:42,919 ERROR wicket.RequestCycle -
> > org.apache.wicket.Component has not been properly rendered. Something in
> > the
> > hierarchy of foo.bar.ImagePage has not called super.onBeforeRender() in
> > the
> > override of onBeforeRender() method
> > java.lang.IllegalStateException: org.apache.wicket.Component has not been
> > properly rendered. Something in the hierarchy of foo.bar.ImagePage has
> not
> > called super.onBeforeRender() in the override of onBeforeRender() method
> >         at
> > org.apache.wicket.Component.internalBeforeRender(Component.java:1006)
> >         at org.apache.wicket.Component.beforeRender(Component.java:1034)
> >         at
> > org.apache.wicket.Component.prepareForRender(Component.java:2160)
> >
> > Is this the "standard" way of outputing binary data ?
> > If not , what is the better way  (wicket 1.3.5) ?
> >
> > thanks.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/WebPage-for-serving-binary-image-data-tp21169289p21171044.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to