I started this process, but I have not taken it all the way. I think the main issue is that with Struts 2.1.1 and Xwork 2.1.1 we have an opportunity to change the Struts actions to be less Http dependent. This is a good thing. Struts gives you access to the Request and Response through interfaces like RequestAware or ServletRequestAware. Using these in our actions means we won't have to use ActionContext.getContext() to get what we need.

So far, I found the package name change in DateConverter.java to import com.opensymphony.xwork2.conversion.TypeConversionException. I also was able to get the tests to pass with an NPE by adding the following to BaseActionTestCase to setup the Xwork context:

ConfigurationManager configurationManager = new ConfigurationManager(); configurationManager.addContainerProvider(new XWorkConfigurationProvider());
        Configuration config = configurationManager.getConfiguration();
        Container container = config.getContainer();

ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
        stack.getContext().put(ActionContext.CONTAINER, container);
ActionContext.setContext(new ActionContext(stack.getContext()));

That fixed the NPE, but that is as far as I got. My ultimate plan was to retool the Appfuse Struts actions to use the new Rest plugin and remove all the xml, and then take it even further with example apps for Facebook, etc! Let me know if you can start up your webapp once you get the tests to pass. Also if you have a different NPE from the dojo plugin, put the stacktrace up and we can work it out.

-D

On Apr 10, 2008, at 4:48 AM, oscar perez wrote:

Hi all,
I am running into this problem when upgrading appfuse to use struts 2.1 and the dojo plugin:

http://www.nabble.com/Getting-ready-for-Struts-2.1.1-td16231688s2369.html
http://www.mail-archive.com/[EMAIL PROTECTED]/msg29571.html

Anybody knows of a quick-and-dirty workaround to solve this issue?
Thanks
Oscar



Reply via email to