Brockman Bulger wrote:
One of the biggest disconnects I had when moving from Struts to WebWork (I really like WebWork) was getting a handle on the actions.xml file. To elaborate a little, when you declare an action in Struts you're using the fully qualified classname in the config file. The example actions.xml listed the action name and alias but it wasn't immediately clear how that name related to the action class it referred to. The lightbulb finally went off when I found the webwork.action.packages property in the default.properties file.
<snip>

I just ran into the same thing in my own AOP framework. The problem is with global package prefix declarations, which also makes it more difficult to do subpackages.

Here's another way to do it, which is more scalable I think:
<actions>

<package prefixes="webwork.action.standard">
<action name="Redirect" alias="redirect"/>
</package>

<package prefixes="com.example.weblog.actions">
<action name="entry.CreateEntry" alias="CreateEntry">
<view name="input">addentry.jsp</view>
<view name="error">addentry.jsp</view>
<view name="success">viewentry.jsp</view>
</action>
</package>
</actions>

The advantage of that is that it now becomes possible to have many XML fragments that together construct the total using XML entities. Like so:
<actions>
&default;
&myactions;
</actions>

The cool thing about this is that the entity resolvers could be constructed to access XML (as default) or a properties file, or a database, or whatever. The input to WebWork would always be XML though.

The above approach would allow us to make WebWork more componentized since several different packages can now be easily assembled into one application.

Another thing that is probably a good idea is to change so that the above is not loaded through the ordinary configuration utility, but rather through a custom action configuration API, which should also have two parts: the class that loads XML, and the registry/factory. By separating the two it becomes easier to have programmatic access to adding/removing action definitions.

These are fairly simple changes, but I think they would have a good impact on the usability and scalability of XWork.

/Rickard

--
Rickard Öberg
[EMAIL PROTECTED]
Senselogic

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



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


Reply via email to