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 {

     public PageHeaderComponent(final String id, final String
changeDestination) {
        super(id);
        add(new Behavior() {
            private final ResourceReference headerCss = new
PackageResourceReference("/css/header.css");

            @Override
            public void renderHead(Component component, IHeaderResponse
response) {
                response.renderCSSReference(headerCss);
            }
        });
    }
(...)
}

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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to