John, what kind of problems did you encounter? Cataloging them here will likely elicit solutions, and this may help others in the future who encounter the same problems.

Frank

John Henry Xu wrote:
Craig, I had XML editors to do that. I will try the Struts Console you
mentioned.

----- Original Message -----
From: "Craig McClanahan"
To: "Struts Users Mailing List"
Subject: Re: long struts-config.xml file
Date: Sat, 18 Jun 2005 12:13:56 -0700


On 6/18/05, John Henry Xu wrote:

Craig wrote:


"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"

"http://struts.apache.org/dtds/struts-config_1_2.dtd"; [



...
]>



&package-a;
&package-b;
...



where "package-a.xml", "package-b.xml" and so on contain the form
beans and actions for some logical subset of your overall

application.

Craig, thank you for this info.


Craig, does this confirm with the dtd file?


Validation against the DTD requires two things:

* Using the DOCTYPE declaration (as shown above) in the outer
configuration file

* Setting the servlet init parameter "validating" to "true" in
/WEB-INF/web.xml
for the Struts ActionServlet

It doesn't matter whether you use XML entities or not.


Also, can you tell us the site link on Internet that uses
hundreds actions?


I'm afraid I don't have permission to do that. But let's think for a
moment about what the difference between a Struts app with two actions
and a Struts app with 2000 actions would be. There's certainly going
to be a longer startup time (lots more stuff to parse), and more
memory required for all the classes. But, at runtime while the app is
executing, the only difference this makes is how long it takes to look
up the particular Action definition in a HashMap keyed by action
paths. Even with 2000 entries, such a lookup is pretty fast (and CPU
time on the server tends not to be the bottleneck in most web
applications anyway).


It seems this approach the best in all the options we discussed.

In fact, when I develop an knowlege site with forums in java. I first
used struts, then I had some problems on configure file so I used
another MVC approach. If I know I could do this way, I may stick with
struts in this large project.


If you had struggles with editing a large configuration file, I would
also suggest using one of the many tools available that provides a GUI
front end for this purpose. For example, a standalone tool that is
quite popular for editing configuration files is Struts Console:

http://www.jamesholmes.com/struts/console/


Jack H. Xu
Technology columnist and author

http://www.usanalyst.com

http://www.getusjobs.com

(Both sites are developed in java and on open source).


Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Jack H. Xu
Technology columnist and author

http://www.usanalyst.com

http://www.getusjobs.com


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to