Matt Ho wrote:
2. register each subapp via web.xml

        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>config/admin</param-name>
            <param-value>/WEB-INF/struts-config-admin.xml</param-value>
        </init-param>
        <init-param>
            <param-name>config/voice</param-name>
            <param-value>/WEB-INF/struts-config-voice.xml</param-value>
        </init-param>

This sounds like a good idea.


The main challenge I saw to this model was having a shared JSP space.
The sub-application developers need to coordinate with one another to
ensure that there aren't any conflicts in JSP path selection.  For
example, if one project wants to place its views in /WEB-INF/jsp/, then
none of the other subprojects should place their views there.  The same
is true of resources such as images and js files, etc.

Yes, and the right way to do this is probably to enforce that views have this style "/WEB-INF/foo" where "foo" is the name of the subapp, i.e. do a "hard prefixing". This will ensure that you can always get them to play along nicely, with a little admin if necessary.


Here's a suggested solution:

* Each application should have its own xwork.xml file that is placed at
the root level of the project.  For example,
com/indigoegg/myproject/xwork.xml for a project with a root of
com.indigoegg.myproject

* Allow xwork.xml to include other xml files via the follow (or similar)
construct:

<package namespace="subapp">
  <subapp name="com.indigoegg.myproject"/>
</package>

* These included configuration files should be able to to, in turn call
other configuration files to allow creation of applications by
composition.
* The subapp need only be aware of its defined namespace. For example,
if an Action from the subapp calls


        ActionInvocation invocation = new ActionInvocation("/", "login")
;

They should get a reference to /subapp/login essentially.

* In addition to the <subapp> tag, there should also be an <include>
tag, peered with <package>, to allow developers to break up large
xwork.xml files.

Why not use the standard XML way to include files in other files, i.e. using entities? The above seems a bit like reinventing the wheel.


/Rickard

--
Rickard Öberg
[EMAIL PROTECTED]
Senselogic

Got blog? I do. http://dreambean.com



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to