[seam-issues] [JBoss JIRA] (JBSEAM-4905) parseStylesheet does not work on JBoss AS 7

Philippe Guinot (JIRA) jira-events at lists.jboss.org
Thu Mar 8 10:04:36 EST 2012


    [ https://issues.jboss.org/browse/JBSEAM-4905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675165#comment-12675165 ] 

Philippe Guinot commented on JBSEAM-4905:
-----------------------------------------

A solution I can see is the replace getClass() by FacesContext.getCurrentInstance().getExternalContext(), then it may be able to load from current WebContent.

However, I'm not really sure that everyone deploys the css into the WebContent...
                
> parseStylesheet does not work on JBoss AS 7
> -------------------------------------------
>
>                 Key: JBSEAM-4905
>                 URL: https://issues.jboss.org/browse/JBSEAM-4905
>             Project: Seam 2
>          Issue Type: Bug
>          Components: Excel
>    Affects Versions: 2.2.2.Final
>         Environment: JBoss AS 7, Seam 2.2.2
>            Reporter: Philippe Guinot
>              Labels: classloader, css, jndi, resource, stream, stylesheet, url
>
> In the method org.jboss.seam.excel.css.CSSParser.parseStylesheet(String)
> the following code
> {code}
>       if (urlString.indexOf("://") < 0) {
>          cssStream = getClass().getResourceAsStream(urlString);
>       } else {
>          cssStream = new URL(urlString).openStream();
>       }
> {code}
> does not work.
> Indeed, if the urlString is a relative url, the current class' classLoader won't be able to get the resource from the WebContent. The current application context should be used instead.
> As a workaround I tried to pass the JNDI path of the resource which is an absolute URL. But it does not work, indeed such an URL as the following form 'jndi:/default-host/mypath/mystyle.css' and so does not include the '://' pattern.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list