struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Lee" <Allen....@asu.edu>
Subject using CompositeActionMapper
Date Fri, 26 Sep 2008 20:33:33 GMT
Hey there,

I'm trying to get the CompositeActionMapper working with Struts 2.1.2
(combining the Restful2ActionMapper and our own custom action mapper to
handle the default index page where the Action name is null in namespace
"/", i.e., http://localhost/our-app/ <http://localhost:8080/our-app/>) and
am encountering some problems with the configuration.  After perusing the
code and searching nabble it appears that the configuration elements
described in the JavaDocs for the CompositeActionMapper are incorrect in two
ways:

1. struts.mapper.composite needs to be set to the bean names, not the FQCN
of the mappers to be composited
2. setting the "struts" bean to be CompositeActionMapper gives an error that
the bean has already been defined (in struts-default.xml)

I'm currently trying to configure our app like so:

<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper"
        name="tdar-action-mapper"
        class="org.tdar.struts.TdarActionMapper"/>
 <constant name="struts.mapper.composite"
value="tdar-action-mapper,restful2" />
 <constant name='struts.mapper.class'
value='org.apache.struts2.dispatcher.mapper.CompositeActionMapper'/>

However, when I load this configuration I get an NPE in
CompositeActionMapper in setActionMappers(), line 102, which seems to
indicate that the com.opensymphony.xwork2.inject.Container (which should be
@Inject-ed) is null.  I'm kind of at a loss at this point.  I'm using Spring
as the objectFactory, could that be the issue?

Has anyone successfully gotten CompositeActionMapper to work and how?

Thanks in advance!

-- 
Allen Lee
Center for the Study of Institutional Diversity [http://csid.asu.edu]
School of Human Evolution and Social Change [http://shesc.asu.edu]
College of Liberal Arts and Sciences
Arizona State University | P.O. Box 872402 | Tempe, Arizona 85287-2402
480.727.0401 | Fax: 480.965.7671 | e-mail: Allen.Lee@asu.edu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message