take a closer look at ContextImage's contructor and its javadoc:

        /**
         * Constructor
         *
         * @param id
         * @param contextRelativePath
         *            context-relative path eg <code>images/border.jpg</code>
         */
        public ContextImage(String id, String contextRelativePath)


so try changing your code to the following:
form.add(new ContextImage("images", "image/calendarIcon.gif"));

that sould work just fine.
I think ResourceReference is only applicable if the resource is accessible on
the webapps classpath, thus not directly accessible via context and to
be served by wicket.


On Tue, Jan 5, 2010 at 8:45 AM, vela <vela....@gmail.com> wrote:
>
> Hello again,
>
> In the project setup, the Page class and their corresponding html files are
> not placed in the same directory. The Page class are placed under the
> package com.image and their corresponding html files are placed inside the
> html directory under the context root.
>
> If I place the image file inside the com.image directory or html directory,
> it is getting called. But I need to call the image file inside the image
> directory under the context root.
>
> In the Page class, the context image has call been called as
>
> form.add(new ContextImage("images", new Model(new
> ResourceReference("image/calendarIcon.gif"))));
>
>
>
>
> --
> View this message in context: 
> http://old.nabble.com/Referring-image-using-Resource-Reference-tp27014229p27024782.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to