自定义属性应该是parameter,具体说是parameter="haha"
还有name="test"是指定ActionForm的,照你这样的话得写id="test" 这才是制定的Action<action id="test" class="packageName.Test" parameter="haha" />
然后Action里用....好像是requet.getForwardType("haha")来判定这parameter
还有name="test"是指定ActionForm的,照你这样的话得写id="test" 这才是制定的Action<action id="test" class="packageName.Test" parameter="haha" />
然后Action里用....好像是requet.getForwardType("haha")来判定这parameter
protected List<InterceptorMapping> interceptors;
protected Map<String, Object> params;
protected Map<String, ResultConfig> results;
protected List<ExceptionMappingConfig> exceptionMappings;
protected String className;
protected String methodName;
protected String packageName;
我想做的就是在这里加上一个String mytype,我用自己的类继承了ActionConfig类做了扩展.
然后呢,几个使用到这个ActionConfig的类,我也用自己的类了.问题现在出现在这里:
package org.apache.struts2.config 包下的class Settings中的这个方法:
private static Settings getDefaultInstance() {
if (defaultImpl == null) {
// Create bootstrap implementation
defaultImpl = new DefaultSettings();
// Create default implementation
try {
String className = get(StrutsConstants.STRUTS_CONFIGURATION);
if (!className.equals(defaultImpl.getClass().getName())) {
try {
// singleton instances shouldn't be built accessing request or session-specific
//context data
defaultImpl = (Settings) ObjectFactory.getObjectFactory().
buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
} catch (Exception e) {
LOG.error("Settings: Could not instantiate the struts.configuration object,
substituting the default implementation.", e);
}
}
} catch (IllegalArgumentException ex) {
// ignore
}
} return defaultImpl;
}
问题在这里:
defaultImpl = (Settings) ObjectFactory.getObjectFactory().
buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
类型转换错误,defaultImpl为settings,后面一个到底要怎搞啊?
我很迷茫啊?????