[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1246) Make ServletContext available during startup

Arron Ferguson (JIRA) jira-events at lists.jboss.org
Sun Aug 24 04:36:38 EDT 2008


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

Arron Ferguson commented on JBSEAM-1246:
----------------------------------------

One work around is to do the following:

String pathOfFile = 
    Thread.currentThread().getContextClassLoader().getResource("../somethinginWEBINFdir.txt");
// ... use path to do whatever like load a properties file.

Which will grab something in the WEB-INF directory (notice the '..'). But this is messy and it would be nice to see a servlet context available. I need it for the same reason which is to load configuration files at start up time.

> Make ServletContext available during startup
> --------------------------------------------
>
>                 Key: JBSEAM-1246
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-1246
>             Project: Seam
>          Issue Type: Feature Request
>          Components: Core
>    Affects Versions: 1.2.1.GA
>         Environment: Any
>            Reporter: Mike Quilleash
>
> pages.xml will not be found by the resource loader when the Pages component is @Created during startup ie outside a JSF request.  One of my components that queries the Pages component is causing the component to be created and look for its pages outside a JSF request.
> The only resource lookup that can succeed for something in WEB-INF is the ExternalContext.getResource() but this is not available outside a JSF request. 
> Using ServletContext.getResource() will work instead however this is not portable to Portlets etc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list