RRoman
RRoman

Reputation: 751

shorten type names in struts config

i have this really big struts-based web app that i have to maintain, and the package names follow this convention (more or less):

[app-name].[module].[module-variant].[layer].[activity].[activity-variant]

the jsp files are arranged in a similar fashion:

Web-Content/jsp/[app-name]/[module]/[module-variant]/[activity]/[activity-variant]

so when i have to add another action mapping to the struts-config.xml i have to write again this :

[app-name].[module].[module-variant].[layer]

and this for the foward:

/jsp/[app-name]/[module]/[module-variant]/

with a couple of action mappings, the struts-config.xml file gets really noisy, and its hard to understand the action fowards at a glance.

So, is there any way to specify globaly a package name so i dont have to write the fully qualified name for each action class in the struts-config.xml ?, for example in a hibernate mapping you can specify "package" and "schema" and refer to the table/classes with their short name

btw im using struts 1.3

Upvotes: 1

Views: 132

Answers (1)

user159088
user159088

Reputation:

As far as I know there is no way to do that; Struts expects fully qualified class name for the ActionForms, Actions etc.

What you could do is write a "your's special" struts-config.xml file with global names and stuff, then pass it through a tool at build time to re-generate the actual struts-config.xml that Struts is expecting.

You could also have the struts-config.xml file generated entirely at build time by placing some "annotations" (not Java 5 annotations :D) in the Action classes using XDoclet.

Or you could resort to a nice formatting of the xml and just get used to it.

Upvotes: 1

Related Questions