You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "David H. DeWolf (JIRA)" <ji...@apache.org> on 2006/11/16 04:45:57 UTC

[jira] Created: (WW-1508) Tiles Plugin / Freemarker Tag Support throws NullPointerException

Tiles Plugin / Freemarker Tag Support throws NullPointerException
-----------------------------------------------------------------

                 Key: WW-1508
                 URL: http://issues.apache.org/struts/browse/WW-1508
             Project: Struts 2
          Issue Type: Bug
          Components: Plugins
    Affects Versions: 2.0.2
            Reporter: David H. DeWolf
         Assigned To: David H. DeWolf


The FreemarkerResult now throws a NullPointerException when executed from the tiles plugin due to a missing FreemarkerManager.  This appears to be a result of the Guice integration.

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

        

[jira] Commented: (WW-1508) Tiles Plugin / Freemarker Tag Support throws NullPointerException

Posted by "tm_jee (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1508?page=comments#action_38717 ] 
            
tm_jee commented on WW-1508:
----------------------------

Hi Dave, 

just a thought, maybe we could try having 

@Inject
public void setContainer(Container container) { 
    this.container = container;
}

in ObjectFactory and inject result object created like

public Result buildResult(.....) {
  ....
  Result result = // result build
  container.inject(result);
  ...
}

Just a guess, didn't actually tried it out.



> Tiles Plugin / Freemarker Tag Support throws NullPointerException
> -----------------------------------------------------------------
>
>                 Key: WW-1508
>                 URL: http://issues.apache.org/struts/browse/WW-1508
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugins
>    Affects Versions: 2.0.2
>            Reporter: David H. DeWolf
>         Assigned To: David H. DeWolf
>
> The FreemarkerResult now throws a NullPointerException when executed from the tiles plugin due to a missing FreemarkerManager.  This appears to be a result of the Guice integration.

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

        

[jira] Commented: (WW-1508) Tiles Plugin / Freemarker Tag Support throws NullPointerException

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/struts/browse/WW-1508?page=comments#action_38720 ] 
            
Don Brown commented on WW-1508:
-------------------------------

What Toby describes is how the ObjectFactory works today.  The problem here is that StrutsTilesRequestContext creates a FreemarkerResult itself, not using the ObjectFactory, which would handle the automatic injection.  What is needed here is to either use the ObjectFactory to create the result or have the FreeMarkerManager statically injected into the request context object and use it to initialize the freemarker result properly.

I'm curious why the class is tied to the FreemarkerResult in the first place. I wonder if a better approach would be to allow the result type name to be a parameter for the tiles result, then we'd have the ObjectFactory create the result using the ResultConfig from the PackageConfig.  This way, we'd leverage the defined result types for the package and any customizations the user has made to them.  Also, we'd get Velocity or any other result rendering support for free.

> Tiles Plugin / Freemarker Tag Support throws NullPointerException
> -----------------------------------------------------------------
>
>                 Key: WW-1508
>                 URL: http://issues.apache.org/struts/browse/WW-1508
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugins
>    Affects Versions: 2.0.2
>            Reporter: David H. DeWolf
>         Assigned To: David H. DeWolf
>
> The FreemarkerResult now throws a NullPointerException when executed from the tiles plugin due to a missing FreemarkerManager.  This appears to be a result of the Guice integration.

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

        

[jira] Resolved: (WW-1508) Tiles Plugin / Freemarker Tag Support throws NullPointerException

Posted by "David H. DeWolf (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/struts/browse/WW-1508?page=all ]

David H. DeWolf resolved WW-1508.
---------------------------------

    Fix Version/s: 2.0.2
       Resolution: Fixed

I've resolved the first issue and now use the container to inject dependencies.  I will create another issue in order to expand the implementation to utilize the ObjectFactory for creating results.

The complexity that needs to be considered is related to the fact that there could be multiple "result types" associated with a single tiles result.  For instance, it wouldn't be unheard of to do all layout/decoration with jsp but use freemarker/velocity for the actual content (to leverage the classload-ability of templates for example).

See WW-1516


> Tiles Plugin / Freemarker Tag Support throws NullPointerException
> -----------------------------------------------------------------
>
>                 Key: WW-1508
>                 URL: http://issues.apache.org/struts/browse/WW-1508
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugins
>    Affects Versions: 2.0.2
>            Reporter: David H. DeWolf
>         Assigned To: David H. DeWolf
>             Fix For: 2.0.2
>
>
> The FreemarkerResult now throws a NullPointerException when executed from the tiles plugin due to a missing FreemarkerManager.  This appears to be a result of the Guice integration.

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