You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "MaxGao (JIRA)" <ji...@apache.org> on 2007/06/22 10:49:26 UTC

[jira] Created: (WW-2006) StrutsSpringObjectFactory should create a child Spring ApplicationContext

StrutsSpringObjectFactory should create a child Spring ApplicationContext
-------------------------------------------------------------------------

                 Key: WW-2006
                 URL: https://issues.apache.org/struts/browse/WW-2006
             Project: Struts 2
          Issue Type: Improvement
          Components: Plugins
    Affects Versions: 2.0.8
         Environment: spring 2.0.6
            Reporter: MaxGao


org.apache.struts2.spring.StrutsSpringObjectFactory

use root WebApplicationContext now :
.....
boolean useClassCache = "true".equals(useClassCacheStr);
log.info("Initializing Struts-Spring integration...");
org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
.....


i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
like spring mvc do now:

org.springframework.web.servlet.FrameworkServlet

ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
wac.setParent(parent);
wac.setServletContext(getServletContext());
wac.setServletConfig(getServletConfig());
wac.setNamespace(getNamespace());
if (getContextConfigLocation() != null) {
	wac.setConfigLocations(
	StringUtils.tokenizeToStringArray(
	getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
}
wac.refresh();

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


[jira] Updated: (WW-2006) StrutsSpringObjectFactory should create a child Spring ApplicationContext

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-2006:
---------------------------

    Fix Version/s: Future

Setting Fix Version to "future" for issues without a set fix version. 


> StrutsSpringObjectFactory should create a child Spring ApplicationContext
> -------------------------------------------------------------------------
>
>                 Key: WW-2006
>                 URL: https://issues.apache.org/struts/browse/WW-2006
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugins
>    Affects Versions: 2.0.8
>         Environment: spring 2.0.6
>            Reporter: MaxGao
>            Priority: Trivial
>             Fix For: Future
>
>
> org.apache.struts2.spring.StrutsSpringObjectFactory
> use root WebApplicationContext now :
> .....
> boolean useClassCache = "true".equals(useClassCacheStr);
> log.info("Initializing Struts-Spring integration...");
> org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
> .....
> i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
> like spring mvc do now:
> org.springframework.web.servlet.FrameworkServlet
> ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
> wac.setParent(parent);
> wac.setServletContext(getServletContext());
> wac.setServletConfig(getServletConfig());
> wac.setNamespace(getNamespace());
> if (getContextConfigLocation() != null) {
> 	wac.setConfigLocations(
> 	StringUtils.tokenizeToStringArray(
> 	getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
> }
> wac.refresh();

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


[jira] Commented: (WW-2006) StrutsSpringObjectFactory should create a child Spring ApplicationContext

Posted by "MaxGao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41271 ] 

MaxGao commented on WW-2006:
----------------------------

i think i can use a own fatory to do this

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory

use my own ObjectFactory....i think this will reslove the problem ...

> StrutsSpringObjectFactory should create a child Spring ApplicationContext
> -------------------------------------------------------------------------
>
>                 Key: WW-2006
>                 URL: https://issues.apache.org/struts/browse/WW-2006
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugins
>    Affects Versions: 2.0.8
>         Environment: spring 2.0.6
>            Reporter: MaxGao
>
> org.apache.struts2.spring.StrutsSpringObjectFactory
> use root WebApplicationContext now :
> .....
> boolean useClassCache = "true".equals(useClassCacheStr);
> log.info("Initializing Struts-Spring integration...");
> org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
> .....
> i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
> like spring mvc do now:
> org.springframework.web.servlet.FrameworkServlet
> ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
> wac.setParent(parent);
> wac.setServletContext(getServletContext());
> wac.setServletConfig(getServletConfig());
> wac.setNamespace(getNamespace());
> if (getContextConfigLocation() != null) {
> 	wac.setConfigLocations(
> 	StringUtils.tokenizeToStringArray(
> 	getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
> }
> wac.refresh();

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


[jira] Resolved: (WW-2006) StrutsSpringObjectFactory should create a child Spring ApplicationContext

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted resolved WW-2006.
----------------------------

    Resolution: Not A Problem

> StrutsSpringObjectFactory should create a child Spring ApplicationContext
> -------------------------------------------------------------------------
>
>                 Key: WW-2006
>                 URL: https://issues.apache.org/struts/browse/WW-2006
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugins
>    Affects Versions: 2.0.8
>         Environment: spring 2.0.6
>            Reporter: MaxGao
>            Priority: Trivial
>             Fix For: Future
>
>
> org.apache.struts2.spring.StrutsSpringObjectFactory
> use root WebApplicationContext now :
> .....
> boolean useClassCache = "true".equals(useClassCacheStr);
> log.info("Initializing Struts-Spring integration...");
> org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
> .....
> i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
> like spring mvc do now:
> org.springframework.web.servlet.FrameworkServlet
> ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
> wac.setParent(parent);
> wac.setServletContext(getServletContext());
> wac.setServletConfig(getServletConfig());
> wac.setNamespace(getNamespace());
> if (getContextConfigLocation() != null) {
> 	wac.setConfigLocations(
> 	StringUtils.tokenizeToStringArray(
> 	getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
> }
> wac.refresh();

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


[jira] Updated: (WW-2006) StrutsSpringObjectFactory should create a child Spring ApplicationContext

Posted by "MaxGao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

MaxGao updated WW-2006:
-----------------------

    Priority: Trivial  (was: Major)

> StrutsSpringObjectFactory should create a child Spring ApplicationContext
> -------------------------------------------------------------------------
>
>                 Key: WW-2006
>                 URL: https://issues.apache.org/struts/browse/WW-2006
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugins
>    Affects Versions: 2.0.8
>         Environment: spring 2.0.6
>            Reporter: MaxGao
>            Priority: Trivial
>
> org.apache.struts2.spring.StrutsSpringObjectFactory
> use root WebApplicationContext now :
> .....
> boolean useClassCache = "true".equals(useClassCacheStr);
> log.info("Initializing Struts-Spring integration...");
> org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
> .....
> i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
> like spring mvc do now:
> org.springframework.web.servlet.FrameworkServlet
> ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
> wac.setParent(parent);
> wac.setServletContext(getServletContext());
> wac.setServletConfig(getServletConfig());
> wac.setNamespace(getNamespace());
> if (getContextConfigLocation() != null) {
> 	wac.setConfigLocations(
> 	StringUtils.tokenizeToStringArray(
> 	getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
> }
> wac.refresh();

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