On Wed, 11 Sep 2002, Forrester, Tom wrote:

> Date: Wed, 11 Sep 2002 11:58:05 +0100
> From: "Forrester, Tom" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: How to access the file mappings in struts-config.xml from a none
>      struts servlet
>
>
> Does anyone know if there is a way that I can obtain a file mapping that
> resides in the struts-config.xml, from a servlet that is outside of the
> struts framework? This is using Struts1.01
>

Two basic approaches are available:

* Perform your own XML parse of the "/WEB-INF/struts-config.xml" file,
  and extract what you need.

* Nearly everything in struts-config.xml gets translated into a set of
  JavaBeans that are accessible via findXxx() methods in ActionServlet,
  so see if you can find one (pun intended :-) that gives you the info
  you seek.

In addition, some of the info is stored in collection beans as servlet
context attributes.  You'll need to be more specific about what you're
trying to look up before we can point you to a specific destination.

(For Struts 1.1 users, the entire contents of struts-config.xml ends up
being translated into a tree of beans rooted at
org.apache.struts.config.ApplicationConfig -- and this whole tree of
objects is exposed to each request flowing through the controller under
key Action.APPLICATION_KEY.)

> Best wishes
>
> Tom Forrester

Craig


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

Reply via email to