use of com.opensymphony.xwork2.inject.Container in project onebusaway-application-modules by camsys.
the class UrlFunction method url.
public static String url(String value) {
Dispatcher instance = Dispatcher.getInstance();
if (instance == null)
return null;
Container container = instance.getContainer();
UrlFunction function = new UrlFunction();
container.inject(function);
return function.getUrl(value);
}
use of com.opensymphony.xwork2.inject.Container in project onebusaway-application-modules by camsys.
the class ResourceUrlFunction method resource.
public static String resource(String resourcePath) {
Dispatcher instance = Dispatcher.getInstance();
if (instance == null)
return null;
Container container = instance.getContainer();
ResourceUrlFunction function = new ResourceUrlFunction();
container.inject(function);
return function.getExternalUrlForResource(resourcePath);
}
use of com.opensymphony.xwork2.inject.Container in project entando-core by entando.
the class PrepareOperations method findActionMapping.
@Override
public ActionMapping findActionMapping(HttpServletRequest request, HttpServletResponse response, boolean forceLookup) {
ActionMapping mapping = (ActionMapping) request.getAttribute(STRUTS_ACTION_MAPPING_KEY);
if (mapping == null || forceLookup) {
try {
Container container = this._dispatcher.getContainer();
ActionMapper mapper = container.getInstance(ActionMapper.class);
String entandoActionName = EntandoActionUtils.extractEntandoActionName(request);
mapping = mapper.getMapping(request, this._dispatcher.getConfigurationManager());
if (null != entandoActionName) {
mapping.setName(entandoActionName);
}
if (mapping != null) {
request.setAttribute(STRUTS_ACTION_MAPPING_KEY, mapping);
}
} catch (Exception ex) {
this._dispatcher.sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex);
}
}
return mapping;
}
use of com.opensymphony.xwork2.inject.Container in project entando-core by entando.
the class PluginsSubMenuTag method doStartTag.
@Override
public int doStartTag() throws JspException {
HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
WebApplicationContext wac = ApsWebApplicationUtils.getWebApplicationContext(request);
List<PluginSubMenuContainer> containters = new ArrayList<PluginSubMenuContainer>();
ValueStack stack = this.getStack();
try {
String[] beanNames = wac.getBeanNamesForType(PluginSubMenuContainer.class);
for (int i = 0; i < beanNames.length; i++) {
PluginSubMenuContainer container = (PluginSubMenuContainer) wac.getBean(beanNames[i]);
containters.add(container);
}
if (containters.size() > 0) {
stack.getContext().put(this.getObjectName(), containters);
stack.setValue("#attr['" + this.getObjectName() + "']", containters, false);
return EVAL_BODY_INCLUDE;
}
} catch (Throwable t) {
throw new JspException("Error creating the plugins menu list", t);
}
return super.doStartTag();
}
use of com.opensymphony.xwork2.inject.Container in project entando-core by entando.
the class ApsAdminBaseTestCase method createContainer.
protected Container createContainer() {
ContainerBuilder builder = new ContainerBuilder();
builder.constant("devMode", "false");
return builder.create(true);
}
Aggregations