Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Interceptor - Dynamically Add Result Config to Action Config

Stephen Turner

2010-08-24

Replies: Find Java Web Hosting

Author LoginPost Reply
I have a Struts 2.0 interceptor that dynamically creates a result config
and adds it to the action config. It does it like this:

 String newResult = "shRes";
 ResultConfig cfg = new ResultConfig(newResult,
ServletRedirectResult.class.getName());
 cfg.addParam("location", "SearchHelp.action?"+request.getQueryString());
     
 actionInvocation.getProxy().getConfig().addResultConfig(cfg);

 return newResult;

Now I'm upgrading to Struts 2.2 and I'm finding that this no longer
compiles due to Struts/Xwork refactoring.

I've been able to create a ResultConfig object using ResultConfig.Builder
but I can't find how to add this to the interceptor's action config /
context.

Can anyone give me a pointer?

Thanks,
Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.