reference resource problem

classic Classic list List threaded Threaded
2 messages Options
hcr
Reply | Threaded
Open this post in threaded view
|

reference resource problem

hcr
 
Hi,
    I have a problem with referenceing resource. I want to reference resource with path-relative.
For example, the dir like that:
    ----apps
          ----demo
              -----view.xhtml
              -----img.gif
              -----style.css
 
   in "view.xhtml":
          <img src="img.gif">              //that is wrong
          <img src="/apps/demo/img.gif"/>  //that is right
  
   in "style.css":
          background-image:url(img.gif);                 //that is wrong       
          background-image:url(/apps/demo/img.gif);      //that is right  
 
   Why "<img src='img.gif'>" is wrong? This is useful. How can I support it?
 
 



网 易 Yeah.net 免 费 邮 箱 全 新 改 版,珍 藏 帐 号 开 放,快 来 抢 注 >>

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: reference resource problem

Alessandro Vernet
Administrator
On 8/15/07, hechengrong <[hidden email]> wrote:

> For example, the dir like that:
>     ----apps
>           ----demo
>               -----view.xhtml
>               -----img.gif
>               -----style.css
>
>    in "view.xhtml":
>           <img src="img.gif">              //that is wrong
>           <img src="/apps/demo/img.gif"/>  //that is right
>
>    in "style.css":
>           background-image:url(img.gif);                 //that is wrong
>
>           background-image:url(/apps/demo/img.gif);
> //that is right
>
>    Why "<img src='img.gif'>" is wrong? This is useful. How can I support it?
Because with  <img src='img.gif'>, since the URL for your page is
/demo/something, the browser loads /demo/img.gif, which and Orbeon
Forms looks for a file /demo/img.gif in the resources. This file does
not exist and Orbeon Forms responds with a 404.

Maybe you just want to have your code under /demo instead of apps/demo
in the resources, which you can do by modifying the main page flow
(directly under resources).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws