2009-05-28 12 views

答えて

0

おかげで私は私のインターセプタに以下を追加:

/** 
* @param strutsActionExtension the strutsActionExtension to set 
*/ 
@Inject(StrutsConstants.STRUTS_ACTION_EXTENSION) //Note this isn't necessarily supported 
public void setStrutsActionExtension(String strutsActionExtension) { 
    this.strutsActionExtension = strutsActionExtension; 
} 

ウェスWannemacherこのin'tが実際にサポートされ、同じリストに指摘するが、中に変更することは極めてまれであるとして、将来のリリース。

1

私は答えがおそらく以前のバージョンのstrutsであることを認識しています。これは、私が使用しているstrutsのバージョン(struts v2.2)では動作しませんでした。以下は、たActionMappingがorg.apache.struts2.dispatcher.mapper.ActionMappingですが...

final ActionContext context = actionInvocation.getInvocationContext();  
com.opensymphony.xwork2.util.ValueStack vs=context.getValueStack(); 
((ActionMapping)vs.getContext().get("struts.actionMapping")).getExtension(); 

を...仕事をしました。

誰かを助けるかもしれないと思った。

+0

"struts.actionMapping"という文字列を使用する代わりに、将来のリリースで値を変更することを決めた場合は、定数 "ServletActionContext.ACTION_MAPPING"を使用することもできます。 – rveach

関連する問題