Wait a second do you use wicket:id tags in the

<link href="" rel="Stylesheet" type="text/css"/>
and
 <img src="">
Then you have to do it yourself!
We don't touch urls generated by developer code.

so when i see this:

public Object getObject( final Component c )
           {
               if ( ContentPage.this.isLocaleJapan
ese() )
                   return "styles/main_jp.css";
               else
                   return "styles/main_en.css";
           }

then you have to append the context path youreself.

public Object getObject( final Component c )
           {
               if ( ContentPage.this.isLocaleJapan
ese() )
                   return ApplicationSettings.getContextPath() + "/styles/main_jp.css";
               else
                   return ApplicationSettings.getContextPath() + "/styles/main_en.css";
           }


Maybe you do need some test to see where the contextpath ends with like "/"

johan



On 2/28/06, David Leangen <[EMAIL PROTECTED]> wrote:

Hello!

I just tried the latest snapshot (20060227-0200). Still the same
problem, unfortunately.

> what does youre html look like?
> If you have non absolute paths in src or href attributes of tags then
> they will be made absolute in the latest snapshots.

My (relevant) html looks like this:

    <div id="header-area">
        <div class="logo-top">
            <a wicket:id="topPageLink" class="image-link"><img
src="">        </div>
        <div class="menu">
            <div class="menubar">
                <img src=""
            </div>
            <span wicket:id="topMenu"/>
        </div>
    </div>

The context root is ".temp/www", and the resulting html (for one of my
pages as an example) is as below.

You'll notice that the "menu" links are properly rendered, but the image
links and the css are not. So, is this a "feature" or a "bug", I
wonder...


<?xml version='1.0' encoding='UTF-8'?>
    <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <link href="" rel="Stylesheet" type="text/css"/>
        <title>Page Title</title>
    </head>
    <body>

....
      <div id="header-area">
          <div class="logo-top">
              <a href="" class="image-link"><img src=""
          </div>
          <div class="menu">
              <div class="menubar">
                  <img src="">              </div>
              <span>

      <div class="menu1"><a href="" class="menu-link">LSD</a></div>
      <div class="menu2"><a href="" class="menu-link">PubMed</a></div>
      <div class="menu3"><a href="" class="menu-link">Company</a></div>
      <div class="menu4"><a href="" class="menu-link">Contact</a></div>

    </span>
          </div><!-- menu -->
      </div><!-- header-area -->

....

    </body>
</html>


BTW, the CSS is like this:

    <head>
        <link wicket:id="css" rel="Stylesheet" type="text/css" href="">        <title>Page Title</title>
    </head>

        final WebComponent c = new WebComponent( "css" );
        final IModel model = new Model()
        {
            private static final long serialVersionUID = 1L;

            public Object getObject( final Component c )
            {
                if ( ContentPage.this.isLocaleJapanese() )
                    return "styles/main_jp.css";
                else
                    return "styles/main_en.css";
            }
        };
         c.add( new AttributeModifier( "href", model ) );
        add( c );




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to