You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Chris Lewis (JIRA)" <de...@tapestry.apache.org> on 2008/01/29 23:42:34 UTC

[jira] Created: (TAPESTRY-2106) Cannot inject (and use) Request or RequestGlobals into app module contribution methods

Cannot inject (and use) Request or RequestGlobals into app module contribution methods
--------------------------------------------------------------------------------------

                 Key: TAPESTRY-2106
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2106
             Project: Tapestry
          Issue Type: Bug
    Affects Versions: 5.0, 5.0.10
            Reporter: Chris Lewis


I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:


public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
    request.getContextPath(); //null!
}


I've tried these other methods of injection as well, with the same results:

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2106) Cannot inject (and use) Request or RequestGlobals into app module contribution methods

Posted by "Chris Lewis (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Lewis updated TAPESTRY-2106:
----------------------------------

    Description: 
I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:


public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
    request.getContextPath(); //throws NPE!
}


I've tried these other methods of injection as well, with the same results:

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 



  was:
I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:


public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
    request.getContextPath(); //null!
}


I've tried these other methods of injection as well, with the same results:

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}

public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 




> Cannot inject (and use) Request or RequestGlobals into app module contribution methods
> --------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2106
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2106
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0, 5.0.10
>            Reporter: Chris Lewis
>
> I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
>     request.getContextPath(); //throws NPE!
> }
> I've tried these other methods of injection as well, with the same results:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAPESTRY-2106) Cannot inject (and use) Request or RequestGlobals into app module contribution methods

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-2106.
------------------------------------------

    Resolution: Won't Fix
      Assignee: Howard M. Lewis Ship

As the Tapestry filter is currently implemented, the HttpServletRequest is not available at application startup.  Although we could change the filter to defer initialization until the first request arrives, that is not ideal for other reasons.  I would suggest using a symbol to store the context path and just keeping that in sync with your actual deployment.

> Cannot inject (and use) Request or RequestGlobals into app module contribution methods
> --------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2106
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2106
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0, 5.0.10
>            Reporter: Chris Lewis
>            Assignee: Howard M. Lewis Ship
>
> I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
>     request.getContextPath(); //throws NPE!
> }
> I've tried these other methods of injection as well, with the same results:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2106) Cannot inject (and use) Request or RequestGlobals into app module contribution methods

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564833#action_12564833 ] 

Howard M. Lewis Ship commented on TAPESTRY-2106:
------------------------------------------------

An issue here is that the Request object (and underlying HttpServletRequest) is not available yet at the time the ApplicationDefaults configuration is constructed ... the first request will not have arrived yet.

> Cannot inject (and use) Request or RequestGlobals into app module contribution methods
> --------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2106
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2106
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0, 5.0.10
>            Reporter: Chris Lewis
>
> I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
>     request.getContextPath(); //throws NPE!
> }
> I've tried these other methods of injection as well, with the same results:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-2106) Cannot inject (and use) Request or RequestGlobals into app module contribution methods

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564834#action_12564834 ] 

Howard M. Lewis Ship commented on TAPESTRY-2106:
------------------------------------------------

Starting in Sevlet API 2.5, you can get the context path from the ServletContext.

> Cannot inject (and use) Request or RequestGlobals into app module contribution methods
> --------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2106
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2106
>             Project: Tapestry
>          Issue Type: Bug
>    Affects Versions: 5.0, 5.0.10
>            Reporter: Chris Lewis
>
> I have been trying to use Request or RequestGlobals in a contribution method for resolving a path, but am unable to do so:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {
>     request.getContextPath(); //throws NPE!
> }
> I've tried these other methods of injection as well, with the same results:
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @Inject Request request) {}
> public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration, @InjectService("Request") Request request) {} 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org