You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/02/01 18:23:09 UTC
[jira] Commented: (TAPESTRY-2106) Cannot inject (and use) Request
or RequestGlobals into app module contribution methods
[ 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