本文整理汇总了Java中org.apache.struts2.StrutsConstants类的典型用法代码示例。如果您正苦于以下问题:Java StrutsConstants类的具体用法?Java StrutsConstants怎么用?Java StrutsConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StrutsConstants类属于org.apache.struts2包,在下文中一共展示了StrutsConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadCustomResourceBundles
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
private void loadCustomResourceBundles(LocatableProperties props) {
String bundles = props.getProperty(StrutsConstants.STRUTS_CUSTOM_I18N_RESOURCES);
if (bundles != null && bundles.length() > 0) {
StringTokenizer customBundles = new StringTokenizer(bundles, ", ");
while (customBundles.hasMoreTokens()) {
String name = customBundles.nextToken();
try {
LOG.trace("Loading global messages from [{}]", name);
LocalizedTextUtil.addDefaultResourceBundle(name);
} catch (Exception e) {
LOG.error("Could not find messages file {}.properties. Skipping", name);
}
}
}
}
开发者ID:txazo,项目名称:struts2,代码行数:17,代码来源:DefaultBeanSelectionProvider.java
示例2: setChainedContexts
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
/**
* allow users to specify via the struts.properties file a set of additional VelocityContexts to chain to the
* the StrutsVelocityContext. The intent is to allow these contexts to store helper objects that the ui
* developer may want access to. Examples of reasonable VelocityContexts would be an IoCVelocityContext, a
* SpringReferenceVelocityContext, and a ToolboxVelocityContext
*
* @param contexts comma separated velocity context's
*/
@Inject(StrutsConstants.STRUTS_VELOCITY_CONTEXTS)
public void setChainedContexts(String contexts) {
// we expect contexts to be a comma separated list of classnames
StringTokenizer st = new StringTokenizer(contexts, ",");
List<String> contextList = new ArrayList<>();
while (st.hasMoreTokens()) {
String classname = st.nextToken();
contextList.add(classname);
}
if (contextList.size() > 0) {
String[] chainedContexts = new String[contextList.size()];
contextList.toArray(chainedContexts);
this.chainedContextNames = chainedContexts;
}
}
开发者ID:txazo,项目名称:struts2,代码行数:25,代码来源:VelocityManager.java
示例3: init_FileManager
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
private void init_FileManager() throws ClassNotFoundException {
if (initParams.containsKey(StrutsConstants.STRUTS_FILE_MANAGER)) {
final String fileManagerClassName = initParams.get(StrutsConstants.STRUTS_FILE_MANAGER);
final Class<FileManager> fileManagerClass = (Class<FileManager>) Class.forName(fileManagerClassName);
LOG.info("Custom FileManager specified: {}", fileManagerClassName);
configurationManager.addContainerProvider(new FileManagerProvider(fileManagerClass, fileManagerClass.getSimpleName()));
} else {
// add any other Struts 2 provided implementations of FileManager
configurationManager.addContainerProvider(new FileManagerProvider(JBossFileManager.class, "jboss"));
}
if (initParams.containsKey(StrutsConstants.STRUTS_FILE_MANAGER_FACTORY)) {
final String fileManagerFactoryClassName = initParams.get(StrutsConstants.STRUTS_FILE_MANAGER_FACTORY);
final Class<FileManagerFactory> fileManagerFactoryClass = (Class<FileManagerFactory>) Class.forName(fileManagerFactoryClassName);
LOG.info("Custom FileManagerFactory specified: {}", fileManagerFactoryClassName);
configurationManager.addContainerProvider(new FileManagerFactoryProvider(fileManagerFactoryClass));
}
}
开发者ID:txazo,项目名称:struts2,代码行数:18,代码来源:Dispatcher.java
示例4: setPrefixBasedActionMappers
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionMappers(String list) {
String[] mappers = StringUtils.split(StringUtils.trimToEmpty(list), ",");
for (String mapper : mappers) {
String[] thisMapper = mapper.split(":");
if (thisMapper.length == 2) {
String mapperPrefix = thisMapper[0].trim();
String mapperName = thisMapper[1].trim();
Object obj = container.getInstance(ActionMapper.class, mapperName);
if (obj != null) {
actionMappers.put(mapperPrefix, (ActionMapper) obj);
} else {
LOG.debug("invalid PrefixBasedActionMapper config entry: [{}]", mapper);
}
}
}
}
开发者ID:txazo,项目名称:struts2,代码行数:18,代码来源:PrefixBasedActionMapper.java
示例5: setPrefixBasedActionProxyFactories
import org.apache.struts2.StrutsConstants; //导入依赖的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);
}
}
}
}
}
开发者ID:txazo,项目名称:struts2,代码行数:20,代码来源:PrefixBasedActionProxyFactory.java
示例6: switchDevMode
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
/**
* Enables/disables devMode and related settings if they aren't explicit set in struts.xml/struts.properties
*
* @param props configured properties
*/
private void switchDevMode(LocatableProperties props) {
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
if (props.getProperty(StrutsConstants.STRUTS_I18N_RELOAD) == null) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
}
if (props.getProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD) == null) {
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
}
if (props.getProperty(StrutsConstants.STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY) == null) {
props.setProperty(StrutsConstants.STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY, "0");
}
// Convert struts properties into ones that xwork expects
props.setProperty(XWorkConstants.DEV_MODE, "true");
} else {
props.setProperty(XWorkConstants.DEV_MODE, "false");
}
}
开发者ID:txazo,项目名称:struts2,代码行数:23,代码来源:DefaultBeanSelectionProvider.java
示例7: isUseAltSyntax
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
/**
* Return true if either Configuration's altSyntax is on or the stack context's useAltSyntax is on
* @param context stack's context
* @return boolean
*/
public static boolean isUseAltSyntax(Map context) {
// We didn't make altSyntax static cause, if so, struts.configuration.xml.reload will not work
// plus the Configuration implementation should cache the properties, which the framework's
// configuration implementation does
return "true".equals(((Container)context.get(ActionContext.CONTAINER)).getInstance(String.class, StrutsConstants.STRUTS_TAG_ALTSYNTAX)) ||(
(context.containsKey("useAltSyntax") &&
context.get("useAltSyntax") != null &&
"true".equals(context.get("useAltSyntax").toString())));
}
开发者ID:txazo,项目名称:struts2,代码行数:15,代码来源:ContextUtil.java
示例8: init_PreloadConfiguration
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
private Container init_PreloadConfiguration() {
// 源码解析: 获取容器
Container container = getContainer();
// 源码解析: 是否reload资源文件
boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));
LocalizedTextUtil.setReloadBundles(reloadi18n);
// 源码解析: 是否开发模式
boolean devMode = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_DEVMODE));
LocalizedTextUtil.setDevMode(devMode);
return container;
}
开发者ID:txazo,项目名称:struts2,代码行数:15,代码来源:Dispatcher.java
示例9: init_CheckWebLogicWorkaround
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
private void init_CheckWebLogicWorkaround(Container container) {
// test whether param-access workaround needs to be enabled
if (servletContext != null && StringUtils.contains(servletContext.getServerInfo(), "WebLogic")) {
LOG.info("WebLogic server detected. Enabling Struts parameter access work-around.");
paramsWorkaroundEnabled = true;
} else {
paramsWorkaroundEnabled = "true".equals(container.getInstance(String.class,
StrutsConstants.STRUTS_DISPATCHER_PARAMETERSWORKAROUND));
}
}
开发者ID:txazo,项目名称:struts2,代码行数:11,代码来源:Dispatcher.java
示例10: setExtensions
import org.apache.struts2.StrutsConstants; //导入依赖的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;
}
}
开发者ID:txazo,项目名称:struts2,代码行数:15,代码来源:DefaultActionMapper.java
示例11: CompositeActionMapper
import org.apache.struts2.StrutsConstants; //导入依赖的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);
}
}
}
开发者ID:txazo,项目名称:struts2,代码行数:12,代码来源:CompositeActionMapper.java
示例12: GxbObjectFactory
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject
public GxbObjectFactory(
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_AUTOWIRE,required=false) String autoWire,
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_AUTOWIRE_ALWAYS_RESPECT,required=false) String alwaysAutoWire,
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_USE_CLASS_CACHE,required=false) String useClassCacheStr,
@Inject ServletContext servletContext,
@Inject(StrutsConstants.STRUTS_DEVMODE) String devMode,
@Inject Container container) {
super(autoWire, alwaysAutoWire, useClassCacheStr, servletContext, devMode,
container);
}
开发者ID:gxbcj,项目名称:GroovyAction,代码行数:12,代码来源:GxbObjectFactory.java
示例13: TavernSpringObjectFactory
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject
public TavernSpringObjectFactory(
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_AUTOWIRE,required=false) String autoWire,
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_AUTOWIRE_ALWAYS_RESPECT,required=false) String alwaysAutoWire,
@Inject(value=StrutsConstants.STRUTS_OBJECTFACTORY_SPRING_USE_CLASS_CACHE,required=false) String useClassCacheStr,
@Inject ServletContext servletContext,
@Inject(StrutsConstants.STRUTS_DEVMODE) String devMode,
@Inject Container container) {
super(autoWire,alwaysAutoWire,useClassCacheStr,servletContext,devMode,container);
useClassCache = "true".equals(useClassCacheStr);
}
开发者ID:code4craft,项目名称:tavern,代码行数:13,代码来源:TavernSpringObjectFactory.java
示例14: setNoCache
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_XSLT_NOCACHE)
public void setNoCache(String xsltNoCache) {
this.noCache = BooleanUtils.toBoolean(xsltNoCache);
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:XSLTResult.java
示例15: setUIThemeExpansionToken
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_UI_THEME_EXPANSION_TOKEN)
public void setUIThemeExpansionToken(String token) {
themeExpansionToken = token;
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerThemeTemplateLoader.java
示例16: setEncoding
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_I18N_ENCODING)
public void setEncoding(String encoding) {
this.encoding = encoding;
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java
示例17: setWrapperAltMap
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_FREEMARKER_WRAPPER_ALT_MAP)
public void setWrapperAltMap(String val) {
altMapWrapper = "true".equals(val);
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java
示例18: setCacheBeanWrapper
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_FREEMARKER_BEANWRAPPER_CACHE)
public void setCacheBeanWrapper(String val) {
cacheBeanWrapper = "true".equals(val);
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java
示例19: setMruMaxStrongSize
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(StrutsConstants.STRUTS_FREEMARKER_MRU_MAX_STRONG_SIZE)
public void setMruMaxStrongSize(String size) {
mruMaxStrongSize = Integer.parseInt(size);
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java
示例20: setTemplateUpdateDelay
import org.apache.struts2.StrutsConstants; //导入依赖的package包/类
@Inject(value = StrutsConstants.STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY, required = false)
public void setTemplateUpdateDelay(String delay) {
templateUpdateDelay = delay;
}
开发者ID:txazo,项目名称:struts2,代码行数:5,代码来源:FreemarkerManager.java
注:本文中的org.apache.struts2.StrutsConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论