Re: Locating CSS under WEB-INF, please help
Hello Jason, You're welcome :-) I'm glad it helped you. And I'm keen to hear from your experiences as well! -- greetings from Berlin, Rüdiger Schulz www.2rue.de 2007/9/12, Jason Mihalick <[EMAIL PROTECTED]>: > > > Rüdiger, > > Thanks for posting this information. It's given me some new ideas on how > I > want to work with Wicket and Dreamweaver, as it just so happens that we > are > using Dreamweaver as well. > > -- > Jason > > > Rüdiger_Schulz wrote: > > > > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: > >> > >> > >> Thanks Rüdiger. I'm trying the method now. Very > clever. > >> > >> Do you know of any links to documentation or examples on how to use the > >> "live" method for css, js, and image resources? > > > > > > I don't have a real example I can give you at the moment, sorry. I > blogged > > a > > little about how we used Dreamweaver and Wicket in our project here: > > > http://www.2rue.de/hacking/wicket/leveraging-wicket-templates-for-offline-viewing-with-dreamweaver/ > > > > We use a lot of and other stuff in our templates, > because > > that way we can do most of the styling and cross-browser testing (which > is > > always a PITA) using just an html editor and a browser. And as far as I > am > > concerned, it is really worth it. > > > > You can point all your links and images to offline resources, as long as > > you > > bind that tag to a wicket component. Wicket normally doesn't care what > > your > > src attribute in an is when you e.g. bind it to a > > org.apache.wicket.markup.html.image.Image > > > > I planned to write more about this topic though, as I'm really convinced > > that this is one of the really great features of Wicket. > > > > > > -- > >> Jason > >> > >> > >> Rüdiger_Schulz wrote: > >> > > >> > Another tipp on this topic: > >> > > >> > You could provide the CSS twice. Once within a for > >> offline > >> > preview and editing, and again outside that pointing to an url which > >> works > >> > only on your live environment. Or you can add the "live" CSS with a > >> header > >> > contributor in your base page. > >> > > >> > I use the latter one, but I have my CSS located along with my java > >> > files... > >> > > >> > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: > >> >> > >> >> > >> >> Thanks for the reply. > >> >> > >> >> Where are your css resources located under this configuration? I > have > >> a > >> >> similar setup. I have a BasePage.html that refers to the css: > >> >> > >> >> > >> >> >> >> /> > >> >> > >> >> > >> >> >> >> type="text/css" > >> >> /> > >> >> ... > >> >> > >> >> > >> >> But since my BasePage.html is located with my Java classes (at > >> >> src/main/java/com///ui/web/page/BasePage.html) and my css > >> >> resources > >> >> are located at src/main/webapp/css , if I try to load the > >> >> BasePage.htmlfile > >> >> in an HTML editor, it will be unable to resolve the css resources. > >> >> > >> >> -- > >> >> Jason > >> >> > >> >> > >> >> Johan Maasing-2 wrote: > >> >> > > >> >> > Perhaps template inheritance can help you here. I have a 'base' > page > >> >> > that contains the HTML head tag that all my pages use. For example > I > >> >> > have a Basepage.html: > >> >> > > >> >> > http://www.w3.org/1999/xhtml"; > >> >> > xmlns:wicket="http://wicket.apache.org/";> > >> >> > > >> >> >>> >> href="css/main.css"/> > >> >> >>> >> href="css/header.css"/> > >> >> > > >> >> > > >> >> > > >> >> > ... > >> >> > > >> >> > and a Basepage.java (which does some stuff common to all pages, > like > >> >> > setting a feedbackpanel or whatever you like to have for all > pages) > >> >> > > >> >> > Then in my "real" pages I do like this > >> >> > > >> >> > RealPage.java > >> >> > public class Index extends BasePage { > >> >> > public Index() { > >> >> > ... > >> >> > > >> >> > but the real funny stuff goes on in the template for the real > page: > >> >> > http://www.w3.org/1999/xhtml"; > >> >> > xmlns:wicket="http://wicket.apache.org/";> > >> >> > > >> >> > >> >> > href="../../../../../../WebContent/css/main.css"/> > >> >> > >> >> > href="../../../../../../WebContent/css/header.css"/> > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > Real content here > >> >> > > >> >> > > >> >> > > >> >> > ... > >> >> > > >> >> > In this way the template can be edited as a static HTML and > include > >> >> > the right CSS relative to the sources in the filesystem. In > runtime > >> >> > wicket will discard anythiong outside the wicket:extend in the > >> >> > template and use the HTML from the 'base' page. > >> >> > > >> >> > Hope this can help you somewhat. > >> >> > > >> >> > Cheers, > >> >> > Johan M > >> >> > > >> >> > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> >> >> > >> >> >> Ok, thanks for the help on this. My objective was to be > >> able > >> >> to > >> >> >> have > >> >> >> a structure of HTML and resource dependencies (css, js, img, etc) > >>
Re: Locating CSS under WEB-INF, please help
Rüdiger, Thanks for posting this information. It's given me some new ideas on how I want to work with Wicket and Dreamweaver, as it just so happens that we are using Dreamweaver as well. -- Jason Rüdiger_Schulz wrote: > > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: >> >> >> Thanks Rüdiger. I'm trying the method now. Very clever. >> >> Do you know of any links to documentation or examples on how to use the >> "live" method for css, js, and image resources? > > > I don't have a real example I can give you at the moment, sorry. I blogged > a > little about how we used Dreamweaver and Wicket in our project here: > http://www.2rue.de/hacking/wicket/leveraging-wicket-templates-for-offline-viewing-with-dreamweaver/ > > We use a lot of and other stuff in our templates, because > that way we can do most of the styling and cross-browser testing (which is > always a PITA) using just an html editor and a browser. And as far as I am > concerned, it is really worth it. > > You can point all your links and images to offline resources, as long as > you > bind that tag to a wicket component. Wicket normally doesn't care what > your > src attribute in an is when you e.g. bind it to a > org.apache.wicket.markup.html.image.Image > > I planned to write more about this topic though, as I'm really convinced > that this is one of the really great features of Wicket. > > > -- >> Jason >> >> >> Rüdiger_Schulz wrote: >> > >> > Another tipp on this topic: >> > >> > You could provide the CSS twice. Once within a for >> offline >> > preview and editing, and again outside that pointing to an url which >> works >> > only on your live environment. Or you can add the "live" CSS with a >> header >> > contributor in your base page. >> > >> > I use the latter one, but I have my CSS located along with my java >> > files... >> > >> > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: >> >> >> >> >> >> Thanks for the reply. >> >> >> >> Where are your css resources located under this configuration? I have >> a >> >> similar setup. I have a BasePage.html that refers to the css: >> >> >> >> >> >> > >> /> >> >> >> >> >> >> > >> type="text/css" >> >> /> >> >> ... >> >> >> >> >> >> But since my BasePage.html is located with my Java classes (at >> >> src/main/java/com///ui/web/page/BasePage.html) and my css >> >> resources >> >> are located at src/main/webapp/css , if I try to load the >> >> BasePage.htmlfile >> >> in an HTML editor, it will be unable to resolve the css resources. >> >> >> >> -- >> >> Jason >> >> >> >> >> >> Johan Maasing-2 wrote: >> >> > >> >> > Perhaps template inheritance can help you here. I have a 'base' page >> >> > that contains the HTML head tag that all my pages use. For example I >> >> > have a Basepage.html: >> >> > >> >> > http://www.w3.org/1999/xhtml"; >> >> > xmlns:wicket="http://wicket.apache.org/";> >> >> > >> >> > > >> href="css/main.css"/> >> >> > > >> href="css/header.css"/> >> >> > >> >> > >> >> > >> >> > ... >> >> > >> >> > and a Basepage.java (which does some stuff common to all pages, like >> >> > setting a feedbackpanel or whatever you like to have for all pages) >> >> > >> >> > Then in my "real" pages I do like this >> >> > >> >> > RealPage.java >> >> > public class Index extends BasePage { >> >> > public Index() { >> >> > ... >> >> > >> >> > but the real funny stuff goes on in the template for the real page: >> >> > http://www.w3.org/1999/xhtml"; >> >> > xmlns:wicket="http://wicket.apache.org/";> >> >> > >> >> > > >> > href="../../../../../../WebContent/css/main.css"/> >> >> > > >> > href="../../../../../../WebContent/css/header.css"/> >> >> > >> >> > >> >> > >> >> > >> >> > Real content here >> >> > >> >> > >> >> > >> >> > ... >> >> > >> >> > In this way the template can be edited as a static HTML and include >> >> > the right CSS relative to the sources in the filesystem. In runtime >> >> > wicket will discard anythiong outside the wicket:extend in the >> >> > template and use the HTML from the 'base' page. >> >> > >> >> > Hope this can help you somewhat. >> >> > >> >> > Cheers, >> >> > Johan M >> >> > >> >> > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> Ok, thanks for the help on this. My objective was to be >> able >> >> to >> >> >> have >> >> >> a structure of HTML and resource dependencies (css, js, img, etc) >> that >> >> >> could >> >> >> be easily edited in an HTML editor such that the editor doesn't >> have >> >> >> problems resolving the resources and such that Wicket doesn't have >> >> >> problems >> >> >> resolving the resources. From reading your comments and those of >> >> others, >> >> >> however, this doesn't seem to be an easy task at all. So, I've >> gone >> >> back >> >> >> to >> >> >> the standard Wicket approach where I have placed all HTML files >> along >> >> >> side >> >> >> my Java classes and have located my resources (css, js, img
Re: Locating CSS under WEB-INF, please help
2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: > > > Thanks Rüdiger. I'm trying the method now. Very clever. > > Do you know of any links to documentation or examples on how to use the > "live" method for css, js, and image resources? I don't have a real example I can give you at the moment, sorry. I blogged a little about how we used Dreamweaver and Wicket in our project here: http://www.2rue.de/hacking/wicket/leveraging-wicket-templates-for-offline-viewing-with-dreamweaver/ We use a lot of and other stuff in our templates, because that way we can do most of the styling and cross-browser testing (which is always a PITA) using just an html editor and a browser. And as far as I am concerned, it is really worth it. You can point all your links and images to offline resources, as long as you bind that tag to a wicket component. Wicket normally doesn't care what your src attribute in an is when you e.g. bind it to a org.apache.wicket.markup.html.image.Image I planned to write more about this topic though, as I'm really convinced that this is one of the really great features of Wicket. -- > Jason > > > Rüdiger_Schulz wrote: > > > > Another tipp on this topic: > > > > You could provide the CSS twice. Once within a for > offline > > preview and editing, and again outside that pointing to an url which > works > > only on your live environment. Or you can add the "live" CSS with a > header > > contributor in your base page. > > > > I use the latter one, but I have my CSS located along with my java > > files... > > > > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: > >> > >> > >> Thanks for the reply. > >> > >> Where are your css resources located under this configuration? I have > a > >> similar setup. I have a BasePage.html that refers to the css: > >> > >> > >> >> /> > >> > >> > >> >> type="text/css" > >> /> > >> ... > >> > >> > >> But since my BasePage.html is located with my Java classes (at > >> src/main/java/com///ui/web/page/BasePage.html) and my css > >> resources > >> are located at src/main/webapp/css , if I try to load the > >> BasePage.htmlfile > >> in an HTML editor, it will be unable to resolve the css resources. > >> > >> -- > >> Jason > >> > >> > >> Johan Maasing-2 wrote: > >> > > >> > Perhaps template inheritance can help you here. I have a 'base' page > >> > that contains the HTML head tag that all my pages use. For example I > >> > have a Basepage.html: > >> > > >> > http://www.w3.org/1999/xhtml"; > >> > xmlns:wicket="http://wicket.apache.org/";> > >> > > >> >>> href="css/main.css"/> > >> >>> href="css/header.css"/> > >> > > >> > > >> > > >> > ... > >> > > >> > and a Basepage.java (which does some stuff common to all pages, like > >> > setting a feedbackpanel or whatever you like to have for all pages) > >> > > >> > Then in my "real" pages I do like this > >> > > >> > RealPage.java > >> > public class Index extends BasePage { > >> > public Index() { > >> > ... > >> > > >> > but the real funny stuff goes on in the template for the real page: > >> > http://www.w3.org/1999/xhtml"; > >> > xmlns:wicket="http://wicket.apache.org/";> > >> > > >> > >> > href="../../../../../../WebContent/css/main.css"/> > >> > >> > href="../../../../../../WebContent/css/header.css"/> > >> > > >> > > >> > > >> > > >> > Real content here > >> > > >> > > >> > > >> > ... > >> > > >> > In this way the template can be edited as a static HTML and include > >> > the right CSS relative to the sources in the filesystem. In runtime > >> > wicket will discard anythiong outside the wicket:extend in the > >> > template and use the HTML from the 'base' page. > >> > > >> > Hope this can help you somewhat. > >> > > >> > Cheers, > >> > Johan M > >> > > >> > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> >> > >> >> Ok, thanks for the help on this. My objective was to be > able > >> to > >> >> have > >> >> a structure of HTML and resource dependencies (css, js, img, etc) > that > >> >> could > >> >> be easily edited in an HTML editor such that the editor doesn't have > >> >> problems resolving the resources and such that Wicket doesn't have > >> >> problems > >> >> resolving the resources. From reading your comments and those of > >> others, > >> >> however, this doesn't seem to be an easy task at all. So, I've gone > >> back > >> >> to > >> >> the standard Wicket approach where I have placed all HTML files > along > >> >> side > >> >> my Java classes and have located my resources (css, js, img, etc) at > >> the > >> >> root of my web context (in the maven world, this is under the webapp > >> dir, > >> >> as > >> >> a sibling to WEB-INF). This keeps Wicket very happy at runtime, but > >> >> makes > >> >> it difficult for me to edit my site using a HTML editor. Maybe this > >> >> won't > >> >> be that big of a deal in practice. I guess I will find out in time. > >> >> > >> >> Thanks again guys! > >>
Re: Locating CSS under WEB-INF, please help
Thanks Rüdiger. I'm trying the method now. Very clever. Do you know of any links to documentation or examples on how to use the "live" method for css, js, and image resources? -- Jason Rüdiger_Schulz wrote: > > Another tipp on this topic: > > You could provide the CSS twice. Once within a for offline > preview and editing, and again outside that pointing to an url which works > only on your live environment. Or you can add the "live" CSS with a header > contributor in your base page. > > I use the latter one, but I have my CSS located along with my java > files... > > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: >> >> >> Thanks for the reply. >> >> Where are your css resources located under this configuration? I have a >> similar setup. I have a BasePage.html that refers to the css: >> >> >> > /> >> >> >> > type="text/css" >> /> >> ... >> >> >> But since my BasePage.html is located with my Java classes (at >> src/main/java/com///ui/web/page/BasePage.html) and my css >> resources >> are located at src/main/webapp/css , if I try to load the >> BasePage.htmlfile >> in an HTML editor, it will be unable to resolve the css resources. >> >> -- >> Jason >> >> >> Johan Maasing-2 wrote: >> > >> > Perhaps template inheritance can help you here. I have a 'base' page >> > that contains the HTML head tag that all my pages use. For example I >> > have a Basepage.html: >> > >> > http://www.w3.org/1999/xhtml"; >> > xmlns:wicket="http://wicket.apache.org/";> >> > >> > > href="css/main.css"/> >> > > href="css/header.css"/> >> > >> > >> > >> > ... >> > >> > and a Basepage.java (which does some stuff common to all pages, like >> > setting a feedbackpanel or whatever you like to have for all pages) >> > >> > Then in my "real" pages I do like this >> > >> > RealPage.java >> > public class Index extends BasePage { >> > public Index() { >> > ... >> > >> > but the real funny stuff goes on in the template for the real page: >> > http://www.w3.org/1999/xhtml"; >> > xmlns:wicket="http://wicket.apache.org/";> >> > >> > > > href="../../../../../../WebContent/css/main.css"/> >> > > > href="../../../../../../WebContent/css/header.css"/> >> > >> > >> > >> > >> > Real content here >> > >> > >> > >> > ... >> > >> > In this way the template can be edited as a static HTML and include >> > the right CSS relative to the sources in the filesystem. In runtime >> > wicket will discard anythiong outside the wicket:extend in the >> > template and use the HTML from the 'base' page. >> > >> > Hope this can help you somewhat. >> > >> > Cheers, >> > Johan M >> > >> > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> Ok, thanks for the help on this. My objective was to be able >> to >> >> have >> >> a structure of HTML and resource dependencies (css, js, img, etc) that >> >> could >> >> be easily edited in an HTML editor such that the editor doesn't have >> >> problems resolving the resources and such that Wicket doesn't have >> >> problems >> >> resolving the resources. From reading your comments and those of >> others, >> >> however, this doesn't seem to be an easy task at all. So, I've gone >> back >> >> to >> >> the standard Wicket approach where I have placed all HTML files along >> >> side >> >> my Java classes and have located my resources (css, js, img, etc) at >> the >> >> root of my web context (in the maven world, this is under the webapp >> dir, >> >> as >> >> a sibling to WEB-INF). This keeps Wicket very happy at runtime, but >> >> makes >> >> it difficult for me to edit my site using a HTML editor. Maybe this >> >> won't >> >> be that big of a deal in practice. I guess I will find out in time. >> >> >> >> Thanks again guys! >> >> >> >> >> >> igor.vaynberg wrote: >> >> > >> >> > oi. the basic problem is that WEB-INF is inaccessible via direct >> urls. >> >> > this >> >> > is because it houses stuff like classes and you dont want the user >> to >> >> have >> >> > access to those. >> >> > >> >> > so there is a way to make it work, but it will involve wicket or >> >> another >> >> > servlet streaming those static resources, which is a lot of >> overhead. >> >> > >> >> > my suggestion is to move all the css/js/foo out of WEB-INF >> >> > >> >> > -igor >> >> > >> >> > >> >> > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> 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.h
Re: Locating CSS under WEB-INF, please help
Thanks Rüdiger. I'm trying the method now. Very clever. Do you know of any links to documentation or examples on how to use the "live" method for css, js, and image resources? -- Jason Rüdiger_Schulz wrote: > > Another tipp on this topic: > > You could provide the CSS twice. Once within a for offline > preview and editing, and again outside that pointing to an url which works > only on your live environment. Or you can add the "live" CSS with a header > contributor in your base page. > > I use the latter one, but I have my CSS located along with my java > files... > > 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: >> >> >> Thanks for the reply. >> >> Where are your css resources located under this configuration? I have a >> similar setup. I have a BasePage.html that refers to the css: >> >> >> > /> >> >> >> > type="text/css" >> /> >> ... >> >> >> But since my BasePage.html is located with my Java classes (at >> src/main/java/com///ui/web/page/BasePage.html) and my css >> resources >> are located at src/main/webapp/css , if I try to load the >> BasePage.htmlfile >> in an HTML editor, it will be unable to resolve the css resources. >> >> -- >> Jason >> >> >> Johan Maasing-2 wrote: >> > >> > Perhaps template inheritance can help you here. I have a 'base' page >> > that contains the HTML head tag that all my pages use. For example I >> > have a Basepage.html: >> > >> > http://www.w3.org/1999/xhtml"; >> > xmlns:wicket="http://wicket.apache.org/";> >> > >> > > href="css/main.css"/> >> > > href="css/header.css"/> >> > >> > >> > >> > ... >> > >> > and a Basepage.java (which does some stuff common to all pages, like >> > setting a feedbackpanel or whatever you like to have for all pages) >> > >> > Then in my "real" pages I do like this >> > >> > RealPage.java >> > public class Index extends BasePage { >> > public Index() { >> > ... >> > >> > but the real funny stuff goes on in the template for the real page: >> > http://www.w3.org/1999/xhtml"; >> > xmlns:wicket="http://wicket.apache.org/";> >> > >> > > > href="../../../../../../WebContent/css/main.css"/> >> > > > href="../../../../../../WebContent/css/header.css"/> >> > >> > >> > >> > >> > Real content here >> > >> > >> > >> > ... >> > >> > In this way the template can be edited as a static HTML and include >> > the right CSS relative to the sources in the filesystem. In runtime >> > wicket will discard anythiong outside the wicket:extend in the >> > template and use the HTML from the 'base' page. >> > >> > Hope this can help you somewhat. >> > >> > Cheers, >> > Johan M >> > >> > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> Ok, thanks for the help on this. My objective was to be able >> to >> >> have >> >> a structure of HTML and resource dependencies (css, js, img, etc) that >> >> could >> >> be easily edited in an HTML editor such that the editor doesn't have >> >> problems resolving the resources and such that Wicket doesn't have >> >> problems >> >> resolving the resources. From reading your comments and those of >> others, >> >> however, this doesn't seem to be an easy task at all. So, I've gone >> back >> >> to >> >> the standard Wicket approach where I have placed all HTML files along >> >> side >> >> my Java classes and have located my resources (css, js, img, etc) at >> the >> >> root of my web context (in the maven world, this is under the webapp >> dir, >> >> as >> >> a sibling to WEB-INF). This keeps Wicket very happy at runtime, but >> >> makes >> >> it difficult for me to edit my site using a HTML editor. Maybe this >> >> won't >> >> be that big of a deal in practice. I guess I will find out in time. >> >> >> >> Thanks again guys! >> >> >> >> >> >> igor.vaynberg wrote: >> >> > >> >> > oi. the basic problem is that WEB-INF is inaccessible via direct >> urls. >> >> > this >> >> > is because it houses stuff like classes and you dont want the user >> to >> >> have >> >> > access to those. >> >> > >> >> > so there is a way to make it work, but it will involve wicket or >> >> another >> >> > servlet streaming those static resources, which is a lot of >> overhead. >> >> > >> >> > my suggestion is to move all the css/js/foo out of WEB-INF >> >> > >> >> > -igor >> >> > >> >> > >> >> > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> 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.h
Re: Locating CSS under WEB-INF, please help
On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > But since my BasePage.html is located with my Java classes (at > src/main/java/com///ui/web/page/BasePage.html) and my css resources > are located at src/main/webapp/css , if I try to load the BasePage.html file > in an HTML editor, it will be unable to resolve the css resources. I have the same layout (almost). I guess it depends on how your editor works. I usually just open the templates in firefox and mess about with the CSS in webdeveloper or a separate text editor. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Locating CSS under WEB-INF, please help
Another tipp on this topic: You could provide the CSS twice. Once within a for offline preview and editing, and again outside that pointing to an url which works only on your live environment. Or you can add the "live" CSS with a header contributor in your base page. I use the latter one, but I have my CSS located along with my java files... 2007/9/10, Jason Mihalick <[EMAIL PROTECTED]>: > > > Thanks for the reply. > > Where are your css resources located under this configuration? I have a > similar setup. I have a BasePage.html that refers to the css: > > > /> > > > type="text/css" > /> > ... > > > But since my BasePage.html is located with my Java classes (at > src/main/java/com///ui/web/page/BasePage.html) and my css > resources > are located at src/main/webapp/css , if I try to load the BasePage.htmlfile > in an HTML editor, it will be unable to resolve the css resources. > > -- > Jason > > > Johan Maasing-2 wrote: > > > > Perhaps template inheritance can help you here. I have a 'base' page > > that contains the HTML head tag that all my pages use. For example I > > have a Basepage.html: > > > > http://www.w3.org/1999/xhtml"; > > xmlns:wicket="http://wicket.apache.org/";> > > > >href="css/main.css"/> > >href="css/header.css"/> > > > > > > > > ... > > > > and a Basepage.java (which does some stuff common to all pages, like > > setting a feedbackpanel or whatever you like to have for all pages) > > > > Then in my "real" pages I do like this > > > > RealPage.java > > public class Index extends BasePage { > > public Index() { > > ... > > > > but the real funny stuff goes on in the template for the real page: > > http://www.w3.org/1999/xhtml"; > > xmlns:wicket="http://wicket.apache.org/";> > > > > > href="../../../../../../WebContent/css/main.css"/> > > > href="../../../../../../WebContent/css/header.css"/> > > > > > > > > > > Real content here > > > > > > > > ... > > > > In this way the template can be edited as a static HTML and include > > the right CSS relative to the sources in the filesystem. In runtime > > wicket will discard anythiong outside the wicket:extend in the > > template and use the HTML from the 'base' page. > > > > Hope this can help you somewhat. > > > > Cheers, > > Johan M > > > > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> > >> Ok, thanks for the help on this. My objective was to be able > to > >> have > >> a structure of HTML and resource dependencies (css, js, img, etc) that > >> could > >> be easily edited in an HTML editor such that the editor doesn't have > >> problems resolving the resources and such that Wicket doesn't have > >> problems > >> resolving the resources. From reading your comments and those of > others, > >> however, this doesn't seem to be an easy task at all. So, I've gone > back > >> to > >> the standard Wicket approach where I have placed all HTML files along > >> side > >> my Java classes and have located my resources (css, js, img, etc) at > the > >> root of my web context (in the maven world, this is under the webapp > dir, > >> as > >> a sibling to WEB-INF). This keeps Wicket very happy at runtime, but > >> makes > >> it difficult for me to edit my site using a HTML editor. Maybe this > >> won't > >> be that big of a deal in practice. I guess I will find out in time. > >> > >> Thanks again guys! > >> > >> > >> igor.vaynberg wrote: > >> > > >> > oi. the basic problem is that WEB-INF is inaccessible via direct > urls. > >> > this > >> > is because it houses stuff like classes and you dont want the user to > >> have > >> > access to those. > >> > > >> > so there is a way to make it work, but it will involve wicket or > >> another > >> > servlet streaming those static resources, which is a lot of overhead. > >> > > >> > my suggestion is to move all the css/js/foo out of WEB-INF > >> > > >> > -igor > >> > > >> > > >> > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> >> > >> >> > >> >> 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()
Re: Locating CSS under WEB-INF, please help
Thanks for the reply. Where are your css resources located under this configuration? I have a similar setup. I have a BasePage.html that refers to the css: ... But since my BasePage.html is located with my Java classes (at src/main/java/com///ui/web/page/BasePage.html) and my css resources are located at src/main/webapp/css , if I try to load the BasePage.html file in an HTML editor, it will be unable to resolve the css resources. -- Jason Johan Maasing-2 wrote: > > Perhaps template inheritance can help you here. I have a 'base' page > that contains the HTML head tag that all my pages use. For example I > have a Basepage.html: > > http://www.w3.org/1999/xhtml"; > xmlns:wicket="http://wicket.apache.org/";> > > > > > > > ... > > and a Basepage.java (which does some stuff common to all pages, like > setting a feedbackpanel or whatever you like to have for all pages) > > Then in my "real" pages I do like this > > RealPage.java > public class Index extends BasePage { > public Index() { > ... > > but the real funny stuff goes on in the template for the real page: > http://www.w3.org/1999/xhtml"; > xmlns:wicket="http://wicket.apache.org/";> > > href="../../../../../../WebContent/css/main.css"/> > href="../../../../../../WebContent/css/header.css"/> > > > > > Real content here > > > > ... > > In this way the template can be edited as a static HTML and include > the right CSS relative to the sources in the filesystem. In runtime > wicket will discard anythiong outside the wicket:extend in the > template and use the HTML from the 'base' page. > > Hope this can help you somewhat. > > Cheers, > Johan M > > On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> Ok, thanks for the help on this. My objective was to be able to >> have >> a structure of HTML and resource dependencies (css, js, img, etc) that >> could >> be easily edited in an HTML editor such that the editor doesn't have >> problems resolving the resources and such that Wicket doesn't have >> problems >> resolving the resources. From reading your comments and those of others, >> however, this doesn't seem to be an easy task at all. So, I've gone back >> to >> the standard Wicket approach where I have placed all HTML files along >> side >> my Java classes and have located my resources (css, js, img, etc) at the >> root of my web context (in the maven world, this is under the webapp dir, >> as >> a sibling to WEB-INF). This keeps Wicket very happy at runtime, but >> makes >> it difficult for me to edit my site using a HTML editor. Maybe this >> won't >> be that big of a deal in practice. I guess I will find out in time. >> >> Thanks again guys! >> >> >> igor.vaynberg wrote: >> > >> > oi. the basic problem is that WEB-INF is inaccessible via direct urls. >> > this >> > is because it houses stuff like classes and you dont want the user to >> have >> > access to those. >> > >> > so there is a way to make it work, but it will involve wicket or >> another >> > servlet streaming those static resources, which is a lot of overhead. >> > >> > my suggestion is to move all the css/js/foo out of WEB-INF >> > >> > -igor >> > >> > >> > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> 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: >> >> >> >> > type="text/css"/> >> >> >> >> I expected the href value to instead be "css/styles.css" (wi
Re: Locating CSS under WEB-INF, please help
Perhaps template inheritance can help you here. I have a 'base' page that contains the HTML head tag that all my pages use. For example I have a Basepage.html: http://www.w3.org/1999/xhtml"; xmlns:wicket="http://wicket.apache.org/";> ... and a Basepage.java (which does some stuff common to all pages, like setting a feedbackpanel or whatever you like to have for all pages) Then in my "real" pages I do like this RealPage.java public class Index extends BasePage { public Index() { ... but the real funny stuff goes on in the template for the real page: http://www.w3.org/1999/xhtml"; xmlns:wicket="http://wicket.apache.org/";> Real content here ... In this way the template can be edited as a static HTML and include the right CSS relative to the sources in the filesystem. In runtime wicket will discard anythiong outside the wicket:extend in the template and use the HTML from the 'base' page. Hope this can help you somewhat. Cheers, Johan M On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > > Ok, thanks for the help on this. My objective was to be able to have > a structure of HTML and resource dependencies (css, js, img, etc) that could > be easily edited in an HTML editor such that the editor doesn't have > problems resolving the resources and such that Wicket doesn't have problems > resolving the resources. From reading your comments and those of others, > however, this doesn't seem to be an easy task at all. So, I've gone back to > the standard Wicket approach where I have placed all HTML files along side > my Java classes and have located my resources (css, js, img, etc) at the > root of my web context (in the maven world, this is under the webapp dir, as > a sibling to WEB-INF). This keeps Wicket very happy at runtime, but makes > it difficult for me to edit my site using a HTML editor. Maybe this won't > be that big of a deal in practice. I guess I will find out in time. > > Thanks again guys! > > > igor.vaynberg wrote: > > > > oi. the basic problem is that WEB-INF is inaccessible via direct urls. > > this > > is because it houses stuff like classes and you dont want the user to have > > access to those. > > > > so there is a way to make it work, but it will involve wicket or another > > servlet streaming those static resources, which is a lot of overhead. > > > > my suggestion is to move all the css/js/foo out of WEB-INF > > > > -igor > > > > > > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> > >> > >> 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: > >> > >> > >> > >> 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-tf4408084.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] > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Locating-CSS-under-WEB-INF%2C-please-help-tf4408084.html#a12592027 > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe,
Re: Locating CSS under WEB-INF, please help
I believe that the Wicket Bench for Eclipse does enable you to work with your stylesheet and the html inside the packages. Martijn On 9/10/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > > Ok, thanks for the help on this. My objective was to be able to have > a structure of HTML and resource dependencies (css, js, img, etc) that could > be easily edited in an HTML editor such that the editor doesn't have > problems resolving the resources and such that Wicket doesn't have problems > resolving the resources. From reading your comments and those of others, > however, this doesn't seem to be an easy task at all. So, I've gone back to > the standard Wicket approach where I have placed all HTML files along side > my Java classes and have located my resources (css, js, img, etc) at the > root of my web context (in the maven world, this is under the webapp dir, as > a sibling to WEB-INF). This keeps Wicket very happy at runtime, but makes > it difficult for me to edit my site using a HTML editor. Maybe this won't > be that big of a deal in practice. I guess I will find out in time. > > Thanks again guys! > > > igor.vaynberg wrote: > > > > oi. the basic problem is that WEB-INF is inaccessible via direct urls. > > this > > is because it houses stuff like classes and you dont want the user to have > > access to those. > > > > so there is a way to make it work, but it will involve wicket or another > > servlet streaming those static resources, which is a lot of overhead. > > > > my suggestion is to move all the css/js/foo out of WEB-INF > > > > -igor > > > > > > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > >> > >> > >> 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: > >> > >> > >> > >> 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-tf4408084.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] > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Locating-CSS-under-WEB-INF%2C-please-help-tf4408084.html#a12592027 > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.0-beta3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Locating CSS under WEB-INF, please help
Ok, thanks for the help on this. My objective was to be able to have a structure of HTML and resource dependencies (css, js, img, etc) that could be easily edited in an HTML editor such that the editor doesn't have problems resolving the resources and such that Wicket doesn't have problems resolving the resources. From reading your comments and those of others, however, this doesn't seem to be an easy task at all. So, I've gone back to the standard Wicket approach where I have placed all HTML files along side my Java classes and have located my resources (css, js, img, etc) at the root of my web context (in the maven world, this is under the webapp dir, as a sibling to WEB-INF). This keeps Wicket very happy at runtime, but makes it difficult for me to edit my site using a HTML editor. Maybe this won't be that big of a deal in practice. I guess I will find out in time. Thanks again guys! igor.vaynberg wrote: > > oi. the basic problem is that WEB-INF is inaccessible via direct urls. > this > is because it houses stuff like classes and you dont want the user to have > access to those. > > so there is a way to make it work, but it will involve wicket or another > servlet streaming those static resources, which is a lot of overhead. > > my suggestion is to move all the css/js/foo out of WEB-INF > > -igor > > > On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: >> >> >> 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: >> >> >> >> 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-tf4408084.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] >> >> > > -- View this message in context: http://www.nabble.com/Locating-CSS-under-WEB-INF%2C-please-help-tf4408084.html#a12592027 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Locating CSS under WEB-INF, please help
oi. the basic problem is that WEB-INF is inaccessible via direct urls. this is because it houses stuff like classes and you dont want the user to have access to those. so there is a way to make it work, but it will involve wicket or another servlet streaming those static resources, which is a lot of overhead. my suggestion is to move all the css/js/foo out of WEB-INF -igor On 9/8/07, Jason Mihalick <[EMAIL PROTECTED]> wrote: > > > 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: > > > > 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-tf4408084.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] > >
Re: AW: Locating CSS under WEB-INF, please help
put your html files beside your java files: e.g: org/dummy/here -> MyPage.java -> MyPage.html I tried your suggestion below: > href="WEB-INF/content/css/style.css"/> WEB-INF is NOT for public content! - usually you should put your css files either aside your htmland java files and supply an Resource or you put it on the root of your webapp and can access it from there (usually under Web Pages or any name you configured) Regards Jason Mihalick schrieb: If I remove this code: IResourceSettings resourceSettings = this.getResourceSettings(); resourceSettings.addResourceFolder( "WEB-INF/content" ); resourceSettings.setResourceStreamLocator( new then Wicket cannot find my pages (i.e., BasePage.html, Page1.html, Page2.html), which are located under the content dir. I.e., my pages are located at: WEB-INF/content/BasePage.html WEB-INF/content/Page1.html WEB-INF/content/Page2.html Exception that I get: WicketMessage: Markup of type 'html' for component 'com.x.ui.web.page.HomePage' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: I tried your suggestion below: and I still have the same problem. The css resources are not resolved, and Wicket is altering the link tag to this: Can you think of anything else that I should look at? Thanks for the continued help. -- Jason Stefan Lindner wrote: 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 If your style.css is at WEB-INF/ +--- content/ +--- css/ 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: Page Title 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 -part of your BasePage? Wicket does not touch thie header if it's the 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 -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
RE: AW: Locating CSS under WEB-INF, please help
If I remove this code: IResourceSettings resourceSettings = this.getResourceSettings(); resourceSettings.addResourceFolder( "WEB-INF/content" ); resourceSettings.setResourceStreamLocator( new then Wicket cannot find my pages (i.e., BasePage.html, Page1.html, Page2.html), which are located under the content dir. I.e., my pages are located at: WEB-INF/content/BasePage.html WEB-INF/content/Page1.html WEB-INF/content/Page2.html Exception that I get: WicketMessage: Markup of type 'html' for component 'com.x.ui.web.page.HomePage' not found. Enable debug messages for org.apache.wicket.util.resource to get a list of all filenames tried: I tried your suggestion below: and I still have the same problem. The css resources are not resolved, and Wicket is altering the link tag to this: Can you think of anything else that I should look at? Thanks for the continued help. -- Jason Stefan Lindner wrote: > > 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 > > > > > > > If your style.css is at >> WEB-INF/ >> +--- content/ >>+--- css/ > > >href="WEB-INF/content/css/style.css"/> > > > > 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: > > > > >type="text/css" > /> > > Page Title > > > 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 -part of your >> BasePage? >> >> >> > /> >> >> >> Wicket does not touch thie header if it's the 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 >> >> >> >> > href="yourpath/yourpanel.css"/> >> > src="yourpath/yourscript.js"> >> >> >> >> >> >> >> -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 ini
RE: AW: Locating CSS under WEB-INF, please help
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 If your style.css is at > WEB-INF/ > +--- content/ >+--- css/ 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: Page Title 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 -part of your > BasePage? > > >/> > > > Wicket does not touch thie header if it's the 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 > > > >href="yourpath/yourpanel.css"/> >src="yourpath/yourscript.js"> > > > > > > > -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: > > > > 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]
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: Page Title 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 -part of your > BasePage? > > >/> > > > Wicket does not touch thie header if it's the 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 > > > >href="yourpath/yourpanel.css"/> >src="yourpath/yourscript.js"> > > > > > > > -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: > > > > 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-tf4408084.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]
AW: Locating CSS under WEB-INF, please help
Why don't you just put the following code into the -part of your BasePage? Wicket does not touch thie header if it's the 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 -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: 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-tf4408084.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]
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: 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-tf4408084.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]