incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeanne Waldman <jeanne.wald...@oracle.com>
Subject Re: Remote stylesheet in adf-faces-skins.xml
Date Sat, 10 Feb 2007 01:08:11 GMT
In StyleSheetNameResolver's _resolveURL, I added the check for http: and 
that fixes it:

  private URL _resolveURL(String name)
  {
    assert ((name != null));

    FacesContext fContext = FacesContext.getCurrentInstance();
    if (fContext != null)
    {
      try
      {
        if (name.startsWith("http:"))
        {
          URL url = new URL(name);
          if (url != null)
            return url;
        }
        else
        {
          String rootName = _getRootName(name);
          URL url = fContext.getExternalContext().getResource(rootName);
          if (url != null)
            return url;
        }
      }
      catch (MalformedURLException e)
      {
        // Eat the MalformedURLException - maybe the name isn't an URL
        ;
      }
    }

I'll go ahead and check this in.

- Jeanne

Adam Winer wrote:
> On 2/6/07, Chad Wittrock <Chad.Wittrock@uni.edu> wrote:
>> OK, I guess I could have asked this a little better. I have actually
>> tried the example listed below and it does not work. Faces looks for the
>> file within the current application and treats the absolute URL as a
>> relative URL within the application.
>>
>> Does anyone have any suggestions on how to make it work or is this a
>> lost cause?
>
> I'm sure it's going to require a patch.  We'd be happy to
> get one.  Jeanne could, I'm sure, give you a pointer
> to the right bit of code to look at.
>
> -- Adam
>
>>
>> Thanks,
>> Chad
>>
>> On Tue, 2007-02-06 at 10:52 -0800, Jeanne Waldman wrote:
>> > I don't know. You can try it and let us know if it works. :)
>> >
>> > Chad Wittrock wrote:
>> > > Is it possible to specify a remote stylesheet in 
>> adf-faces-skins.xml or
>> > > does the stylesheet have to be local to your project?
>> > >
>> > > Example:
>> > > <?xml version="1.0" encoding="ISO-8859-1"?>
>> > >
>> > > <skins xmlns="http://xmlns.oracle.com/adf/view/faces/skin">
>> > >     <skin>
>> > >         <id>uni.desktop</id>
>> > >         <family>uni</family>
>> > >         <render-kit-id>oracle.adf.desktop</render-kit-id>
>> > > 
>> <style-sheet-name>http://myServer/skins/uni/uniSkin.css</style-sheet-name>

>>
>> > >     </skin>
>> > > </skins>
>> > >
>> >
>> -- 
>> --------------------------------------------------------------------
>> Chad M. Wittrock (Chad.Wittrock@uni.edu)
>> Senior Programmer Analyst
>> University of Northern Iowa
>> (319) 273-7437
>>
>>
>


Mime
View raw message