本文整理汇总了Java中com.opensymphony.xwork2.inject.Inject类的典型用法代码示例。如果您正苦于以下问题:Java Inject类的具体用法?Java Inject怎么用?Java Inject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Inject类属于com.opensymphony.xwork2.inject包,在下文中一共展示了Inject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPrefixBasedActionProxyFactories
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionProxyFactories(String list) {
if (list != null) {
String[] factories = list.split(",");
for (String factory : factories) {
String[] thisFactory = factory.split(":");
if (thisFactory.length == 2) {
String factoryPrefix = thisFactory[0].trim();
String factoryName = thisFactory[1].trim();
ActionProxyFactory obj = container.getInstance(ActionProxyFactory.class, factoryName);
if (obj != null) {
actionProxyFactories.put(factoryPrefix, obj);
} else {
LOG.warn("Invalid PrefixBasedActionProxyFactory config entry: [{}]", factory);
}
}
}
}
}
示例2: setContainer
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setContainer(Container container) {
this.container = container;
try {
build();
} catch (Exception e) {
throw new ConfigurationException(e);
}
}
示例3: setContainer
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setContainer(Container container) {
Map<String, TagLibraryModelProvider> map = new HashMap<>();
Set<String> prefixes = container.getInstanceNames(TagLibraryModelProvider.class);
for (String prefix : prefixes) {
map.put(prefix, container.getInstance(TagLibraryModelProvider.class, prefix));
}
this.tagLibraries = Collections.unmodifiableMap(map);
}
示例4: setExtensions
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_ACTION_EXTENSION)
public void setExtensions(String extensions) {
if (StringUtils.isNotEmpty(extensions)) {
List<String> list = new ArrayList<>();
String[] tokens = extensions.split(",");
Collections.addAll(list, tokens);
if (extensions.endsWith(",")) {
list.add("");
}
this.extensions = Collections.unmodifiableList(list);
} else {
this.extensions = null;
}
}
示例5: CompositeActionMapper
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public CompositeActionMapper(Container container,
@Inject(value = StrutsConstants.STRUTS_MAPPER_COMPOSITE) String list) {
String[] arr = StringUtils.split(StringUtils.trimToEmpty(list), ",");
for (String name : arr) {
Object obj = container.getInstance(ActionMapper.class, name);
if (obj != null) {
actionMappers.add((ActionMapper) obj);
}
}
}
示例6: setEnableEvalExpression
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value = XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION, required = false)
public void setEnableEvalExpression(String evalExpression) {
enableEvalExpression = "true".equals(evalExpression);
if(enableEvalExpression){
LOG.warn("Enabling OGNL expression evaluation may introduce security risks " +
"(see http://struts.apache.org/release/2.3.x/docs/s2-013.html for further details)");
}
}
示例7: setMultiTextvalueSeparator
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value=MULTI_TEXTVALUE_SEPARATOR_CONFIG_KEY, required = false)
public void setMultiTextvalueSeparator(String type) {
multiTextvalueSeparator = type;
}
示例8: setTextProvider
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setTextProvider(TextProvider textProvider) {
this.textProvider = textProvider;
}
示例9: setFreemarkerManager
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setFreemarkerManager(FreemarkerManager mgr) {
this.freemarkerManager = mgr;
}
示例10: setActionMapper
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setActionMapper(ActionMapper mapper) {
this.actionMapper = mapper;
}
示例11: setTemplateEngine
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject("ftl")
public void setTemplateEngine(TemplateEngine templateEngine) {
this.templateEngine = templateEngine;
}
示例12: setWrapperAltMap
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_FREEMARKER_WRAPPER_ALT_MAP)
public void setWrapperAltMap(String val) {
altMapWrapper = "true".equals(val);
}
示例13: setApplicationContextPath
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject(value="applicationContextPath",required=false)
public void setApplicationContextPath(String ctx) {
if (ctx != null) {
setApplicationContext(new ClassPathXmlApplicationContext(ctx));
}
}
示例14: setObjectFactory
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setObjectFactory(ObjectFactory objectFactory) {
this.objectFactory = objectFactory;
}
示例15: setReflectionProvider
import com.opensymphony.xwork2.inject.Inject; //导入依赖的package包/类
@Inject
public void setReflectionProvider(ReflectionProvider reflectionProvider) {
this.reflectionProvider = reflectionProvider;
}