You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Matias Pansa <ma...@hotmail.com> on 2010/03/25 18:08:15 UTC

css resources location



Hi , i'm new to wicket . I been searching in the list archive for css resource problems but i can't found a solution .
My app is developed under netbeans and there's no way to make de css ( file or html embedded ) to work with wicket .
I try almost every way that i found on the archive of this list , but nothing work.
When i preview the html in the browser everything is ok , css ,images etc , but when i deploy to tomcat only css is rendered ok , images are not showed.

here is what i've used :

1 - css embedded in the html file , css is ok but images are no showed , i try almost every path ( background-image : url(" ") ... ) posible to the images , same as the html and java  files , web folder , web-inf , image folder , resources ,etc. I check that resource images are in the war file.

2- <wicket:head> tag with headercontributor.forcss(...) , css and images not working at all in every folder of the app.


I try almost every solution found on the mail list , nothing works to show the images , so now i'm lost , the most basic solution was put all the css code in the html file and nothing.

here is the tree of the app in netbeans :

Shirosecurity -

              -web pages

                   -meta-inf
                   -web-inf

              -configuration files

              -server resources
 
              -sourcepackages

                   -com.myapp.wicket

                       --- java and html files

              -test packages

              -libraries


i would apreciate any help on this.




                 













 		 	   		  
_________________________________________________________________
Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp

RE: css resources location

Posted by Stefan Lindner <li...@visionet.de>.
If you use "background-image : url(' ')", the path of the url is relative to the location of your css.
So if you write "background-image : url('images/myimg.png')" you need a subdirectory imags where your css is
e.g.
   ..../mypackage/mycss.css
   ..../mypackages/images/myimg.png

Do you use images like this:

     <img src="/somePath/myimg.png"/>

Then perhaps you should use wicket's Image class

     <img wicket:id="myImg"/>

	add(new Image("myImg", ImageResource);

Stefan




-----Ursprüngliche Nachricht-----
Von: Matias Pansa [mailto:matutearg@hotmail.com] 
Gesendet: Donnerstag, 25. März 2010 18:08
An: users@wicket.apache.org
Betreff: css resources location




Hi , i'm new to wicket . I been searching in the list archive for css resource problems but i can't found a solution .
My app is developed under netbeans and there's no way to make de css ( file or html embedded ) to work with wicket .
I try almost every way that i found on the archive of this list , but nothing work.
When i preview the html in the browser everything is ok , css ,images etc , but when i deploy to tomcat only css is rendered ok , images are not showed.

here is what i've used :

1 - css embedded in the html file , css is ok but images are no showed , i try almost every path ( background-image : url(" ") ... ) posible to the images , same as the html and java  files , web folder , web-inf , image folder , resources ,etc. I check that resource images are in the war file.

2- <wicket:head> tag with headercontributor.forcss(...) , css and images not working at all in every folder of the app.


I try almost every solution found on the mail list , nothing works to show the images , so now i'm lost , the most basic solution was put all the css code in the html file and nothing.

here is the tree of the app in netbeans :

Shirosecurity -

              -web pages

                   -meta-inf
                   -web-inf

              -configuration files

              -server resources
 
              -sourcepackages

                   -com.myapp.wicket

                       --- java and html files

              -test packages

              -libraries


i would apreciate any help on this.




                 













 		 	   		  
_________________________________________________________________
Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp

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


Re: css resources location

Posted by Alex Objelean <al...@yahoo.com>.
You may want to consider a different approach: wro4j
(http://code.google.com/p/wro4j/wiki/GettingStarted). It can help you to
keep all you resources organized, minimized & merged.

Alex Objelean


pochoclo wrote:
> 
> 
> 
> 
> Hi , i'm new to wicket . I been searching in the list archive for css
> resource problems but i can't found a solution .
> My app is developed under netbeans and there's no way to make de css (
> file or html embedded ) to work with wicket .
> I try almost every way that i found on the archive of this list , but
> nothing work.
> When i preview the html in the browser everything is ok , css ,images etc
> , but when i deploy to tomcat only css is rendered ok , images are not
> showed.
> 
> here is what i've used :
> 
> 1 - css embedded in the html file , css is ok but images are no showed , i
> try almost every path ( background-image : url(" ") ... ) posible to the
> images , same as the html and java  files , web folder , web-inf , image
> folder , resources ,etc. I check that resource images are in the war file.
> 
> 2- <wicket:head> tag with headercontributor.forcss(...) , css and images
> not working at all in every folder of the app.
> 
> 
> I try almost every solution found on the mail list , nothing works to show
> the images , so now i'm lost , the most basic solution was put all the css
> code in the html file and nothing.
> 
> here is the tree of the app in netbeans :
> 
> Shirosecurity -
> 
>               -web pages
> 
>                    -meta-inf
>                    -web-inf
> 
>               -configuration files
> 
>               -server resources
>  
>               -sourcepackages
> 
>                    -com.myapp.wicket
> 
>                        --- java and html files
> 
>               -test packages
> 
>               -libraries
> 
> 
> i would apreciate any help on this.
> 
> 
> 
> 
>                  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  		 	   		  
> _________________________________________________________________
> Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada
> automáticamente. Ver más
> http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp
> 

-- 
View this message in context: http://old.nabble.com/css-resources-location-tp28032076p28034191.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


RE: css resources location

Posted by "corneliu.petrescu" <co...@theredpoint.ro>.
Hmm...
 Open the resulting war file and check that the path is correct.
 At the project im working on the CSS file is outside the
WEB-INF/classes folder and with the aproach i mentioned it works.
 war structure is like this: 
        project.war -> css
                    -> WEB-INF
                    -> ...

Hope it helps.
 
 
         
On Thu, 2010-03-25 at 18:23 -0300, Matias Pansa wrote:
> Thanks for the quick response , i try this way and it's not working . 
> The href is correct but the css file it's not loaded , even try using the same lines included in the wicket example app for netbeans 
> using StyleSheetReference (...) and nothing.
> In the example app the style.css file is in the same folder with the java and html files , the example works ok.
> 
> By now i just forget the images , just trying to make de css file work ,  href="resources/com.com.myapp.HomePage/My.css" 
> but the page is not showin the css atributes.
>  
> 
> 
> 
> > Subject: Re: css resources location
> > From: corneliu.petrescu@theredpoint.ro
> > To: users@wicket.apache.org
> > Date: Thu, 25 Mar 2010 19:25:03 +0200
> > 
> > You've probably got the path wrong.
> > Try: 
> >  String contextPath =
> > ((WebRequest)getRequest()).getHttpServletRequest().getContextPath();
> >  construct path like this
> >  String path = contextPath + relative_css_path;
> > CSSPackageResource.getHeaderContribution(path);
> > 
> > 
> > On Thu, 2010-03-25 at 14:08 -0300, Matias Pansa wrote:
> > 
> > > 
> > > 
> > > Hi , i'm new to wicket . I been searching in the list archive for css resource problems but i can't found a solution .
> > > My app is developed under netbeans and there's no way to make de css ( file or html embedded ) to work with wicket .
> > > I try almost every way that i found on the archive of this list , but nothing work.
> > > When i preview the html in the browser everything is ok , css ,images etc , but when i deploy to tomcat only css is rendered ok , images are not showed.
> > > 
> > > here is what i've used :
> > > 
> > > 1 - css embedded in the html file , css is ok but images are no showed , i try almost every path ( background-image : url(" ") ... ) posible to the images , same as the html and java  files , web folder , web-inf , image folder , resources ,etc. I check that resource images are in the war file.
> > > 
> > > 2- <wicket:head> tag with headercontributor.forcss(...) , css and images not working at all in every folder of the app.
> > > 
> > > 
> > > I try almost every solution found on the mail list , nothing works to show the images , so now i'm lost , the most basic solution was put all the css code in the html file and nothing.
> > > 
> > > here is the tree of the app in netbeans :
> > > 
> > > Shirosecurity -
> > > 
> > >               -web pages
> > > 
> > >                    -meta-inf
> > >                    -web-inf
> > > 
> > >               -configuration files
> > > 
> > >               -server resources
> > >  
> > >               -sourcepackages
> > > 
> > >                    -com.myapp.wicket
> > > 
> > >                        --- java and html files
> > > 
> > >               -test packages
> > > 
> > >               -libraries
> > > 
> > > 
> > > i would apreciate any help on this.
> > > 
> > > 
> > > 
> > > 
> > >                  
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >  		 	   		  
> > > _________________________________________________________________
> > > Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
> > > http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp
> > 
> > 
>  		 	   		  
> _________________________________________________________________
> Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
> http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp



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


RE: css resources location

Posted by Matias Pansa <ma...@hotmail.com>.
Thanks for the quick response , i try this way and it's not working . 
The href is correct but the css file it's not loaded , even try using the same lines included in the wicket example app for netbeans 
using StyleSheetReference (...) and nothing.
In the example app the style.css file is in the same folder with the java and html files , the example works ok.

By now i just forget the images , just trying to make de css file work ,  href="resources/com.com.myapp.HomePage/My.css" 
but the page is not showin the css atributes.
 



> Subject: Re: css resources location
> From: corneliu.petrescu@theredpoint.ro
> To: users@wicket.apache.org
> Date: Thu, 25 Mar 2010 19:25:03 +0200
> 
> You've probably got the path wrong.
> Try: 
>  String contextPath =
> ((WebRequest)getRequest()).getHttpServletRequest().getContextPath();
>  construct path like this
>  String path = contextPath + relative_css_path;
> CSSPackageResource.getHeaderContribution(path);
> 
> 
> On Thu, 2010-03-25 at 14:08 -0300, Matias Pansa wrote:
> 
> > 
> > 
> > Hi , i'm new to wicket . I been searching in the list archive for css resource problems but i can't found a solution .
> > My app is developed under netbeans and there's no way to make de css ( file or html embedded ) to work with wicket .
> > I try almost every way that i found on the archive of this list , but nothing work.
> > When i preview the html in the browser everything is ok , css ,images etc , but when i deploy to tomcat only css is rendered ok , images are not showed.
> > 
> > here is what i've used :
> > 
> > 1 - css embedded in the html file , css is ok but images are no showed , i try almost every path ( background-image : url(" ") ... ) posible to the images , same as the html and java  files , web folder , web-inf , image folder , resources ,etc. I check that resource images are in the war file.
> > 
> > 2- <wicket:head> tag with headercontributor.forcss(...) , css and images not working at all in every folder of the app.
> > 
> > 
> > I try almost every solution found on the mail list , nothing works to show the images , so now i'm lost , the most basic solution was put all the css code in the html file and nothing.
> > 
> > here is the tree of the app in netbeans :
> > 
> > Shirosecurity -
> > 
> >               -web pages
> > 
> >                    -meta-inf
> >                    -web-inf
> > 
> >               -configuration files
> > 
> >               -server resources
> >  
> >               -sourcepackages
> > 
> >                    -com.myapp.wicket
> > 
> >                        --- java and html files
> > 
> >               -test packages
> > 
> >               -libraries
> > 
> > 
> > i would apreciate any help on this.
> > 
> > 
> > 
> > 
> >                  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >  		 	   		  
> > _________________________________________________________________
> > Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
> > http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp
> 
> 
 		 	   		  
_________________________________________________________________
Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp

Re: css resources location

Posted by "corneliu.petrescu" <co...@theredpoint.ro>.
You've probably got the path wrong.
Try: 
 String contextPath =
((WebRequest)getRequest()).getHttpServletRequest().getContextPath();
 construct path like this
 String path = contextPath + relative_css_path;
CSSPackageResource.getHeaderContribution(path);


On Thu, 2010-03-25 at 14:08 -0300, Matias Pansa wrote:

> 
> 
> Hi , i'm new to wicket . I been searching in the list archive for css resource problems but i can't found a solution .
> My app is developed under netbeans and there's no way to make de css ( file or html embedded ) to work with wicket .
> I try almost every way that i found on the archive of this list , but nothing work.
> When i preview the html in the browser everything is ok , css ,images etc , but when i deploy to tomcat only css is rendered ok , images are not showed.
> 
> here is what i've used :
> 
> 1 - css embedded in the html file , css is ok but images are no showed , i try almost every path ( background-image : url(" ") ... ) posible to the images , same as the html and java  files , web folder , web-inf , image folder , resources ,etc. I check that resource images are in the war file.
> 
> 2- <wicket:head> tag with headercontributor.forcss(...) , css and images not working at all in every folder of the app.
> 
> 
> I try almost every solution found on the mail list , nothing works to show the images , so now i'm lost , the most basic solution was put all the css code in the html file and nothing.
> 
> here is the tree of the app in netbeans :
> 
> Shirosecurity -
> 
>               -web pages
> 
>                    -meta-inf
>                    -web-inf
> 
>               -configuration files
> 
>               -server resources
>  
>               -sourcepackages
> 
>                    -com.myapp.wicket
> 
>                        --- java and html files
> 
>               -test packages
> 
>               -libraries
> 
> 
> i would apreciate any help on this.
> 
> 
> 
> 
>                  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  		 	   		  
> _________________________________________________________________
> Mirá tus emails ¡cuando te llegan! Hotmail actualiza tu bandeja de entrada automáticamente. Ver más
> http://www.descubrewindowslive.com/hotmail/actualizacion-guardado.asp