On Fri, Mar 9, 2012 at 4:03 PM, grazia <grazia.russolass...@gmail.com> wrote:
> Still not clear what I did wrong.
> With wicket 1.4 my code was:
>
> public final class PageHeaderComponent extends WebComponent {
>
>     public PageHeaderComponent(final String id, final String
> changeDestination) {
>        super(id);
>        add(CSSPackageResource.getHeaderContribution("/css/header.css"));
>    }
> (...)
> }
>
> and it created what I needed
> <link rel="stylesheet" type="text/css" href="/css/header.css" />
>
> Now with wicket 1.5, my code is:
>
> public final class PageHeaderComponent extends WebComponent {
>

No need of Behavior, no need of PackageResourceReference.

    public PageHeaderComponent(final String id, final String
changeDestination) {
       super(id);

       @Override
       public void renderHead(Component component, IHeaderResponse response) {
           response.renderCSSReference("/css/header.css");
       }
   });


>    }
> (...)
> }
>
> and it creates:
> <link rel="stylesheet" type="text/css"
> href="wicket/resource/org.apache.wicket.Application/css/header.css" />
>
> The warning being logged is:
>
> WARNING: Asked to auto-create a ResourceReference, but
> ResourceReferenceRegistry
> .createDefaultResourceReference() return null.  [scope:
> org.apache.wicket.Application; name: css/header.css; locale: null; style:
> null; variation: null]
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-to-include-a-link-to-a-css-file-not-in-classpath-not-in-WEB-INF-tp4459528p4459528.html
> Sent from the Users forum 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
>



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

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

Reply via email to