You don't need the
IResourceSettings resourceSettings = this.getResourceSettings();
resourceSettings.addResourceFolder( "WEB-INF/content" );
resourceSettings.setResourceStreamLocator( new
In your application. The path to your resource is the relative to the root
of your war file. In your example:
If your style.css is at to level just write
<head>
<wicket:head>
<link rel="stylesheet" type="text/css" href="style.css"/>
</wicket:head>
</head>
If your style.css is at
WEB-INF/
+--- content/
+--- css/
<head>
<wicket:head>
<link rel="stylesheet" type="text/css"
href="WEB-INF/content/css/style.css"/>
</wicket:head>
</head>
This works perfectly for me.
WEB-INF/
+--- content/
+--- css/
+--- help/
+--- img/
+--- js/
BasePage.html
Page1.html
Page2.html
etc.
web.xml
-----Ursprüngliche Nachricht-----
Von: Jason Mihalick [mailto:[EMAIL PROTECTED]
Gesendet: Sonntag, 9. September 2007 13:59
An: users@wicket.apache.org
Betreff: Re: AW: Locating CSS under WEB-INF, please help
Hi Stefan. Thanks for the reply. What you suggest is exactly what I have
in my BasePage.html, which renders my css and js resources just fine when
I point a browser directly at BasePage.html. Is that what you meant by
"yourpath/your.css"?
Here is my raw markup from BasePage.html:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Stylesheets -->
<link href="css/styles.css" rel="stylesheet"
type="text/css"
/>
<title>Page Title</title>
</head>
For some reason, the Wicket runtime is changing the above href from
"css/styles.css" to "../css/styles.css"
Any other ideas?
Thanks,
Jason
Stefan Lindner wrote:
Why don't you just put the following code into the <head>-part of your
BasePage?
<head>
<link rel="stylesheet" type="text/css" href="yourpath/your.css"
/>
</head>
Wicket does not touch thie header if it's the <head> in your BasePage.
If you place some panels at your page and the panels should use their
own css files you can make wicket add the panel's head to the main
head section with
<head>
<wicket:head>
<link rel="stylesheet" type="text/css"
href="yourpath/yourpanel.css"/>
<script language="JavaScript" type="text/javascript"
src="yourpath/yourscript.js"></script>
</wicket:head>
</head>
-----Ursprüngliche Nachricht-----
Von: Jason Mihalick [mailto:[EMAIL PROTECTED]
Gesendet: Sonntag, 9. September 2007 06:37
An: users@wicket.apache.org
Betreff: Locating CSS under WEB-INF, please help
I've been searching the forums and wiki on this half the night and I
just can't figure out what I'm doing wrong here, so please bear with
me if there
is an obvious answer to this.
Wicket is not finding my css or js resources when the application is
deployed.
I followed the wiki instructions for Wicket 1.3 on how to "Control
where HTML files are loaded from"
(http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3).
I have the following structure under WEB-INF:
WEB-INF/
+--- content/
+--- css/
+--- help/
+--- img/
+--- js/
BasePage.html
Page1.html
Page2.html
etc.
web.xml
In the init() method of my application class, I have added this code
as per the wiki:
IResourceSettings resourceSettings = this.getResourceSettings();
resourceSettings.addResourceFolder( "WEB-INF/content" );
resourceSettings.setResourceStreamLocator( new
PathStripperLocator() );
My implementation of the PathStripperLocator class matches that found
on the wiki.
When I view the source of Page1.html (which inherits from my BasePage)
in my browser after wicket has served it, I see that Wicket is
rewriting the location of the css resources as follows:
<link href="../css/styles.css" rel="stylesheet" type="text/css"/>
I expected the href value to instead be "css/styles.css" (without the
"../").
What do I need to do here in order to make this work?
Your help is greatly appreciated!
--
Jason
--
View this message in context:
http://www.nabble.com/Locating-CSS-under-WEB-INF%2C-please-help-tf4408
084.html#a12575952 Sent from the Wicket - User mailing list archive at
Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/Locating-CSS-under-WEB-INF%2C-please-help-tf4408084.html#a12578151
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]