struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Mitchell <jmitch...@apache.org>
Subject Re: entity references in struts config xml
Date Wed, 18 Jun 2003 23:40:24 GMT
On Wednesday 18 June 2003 17:14, Derek Scherger wrote:
> James Mitchell wrote:
> >On Wednesday 18 June 2003 15:23, Derek Scherger wrote:
> >>Does anyone know how to get entity references to work with struts 1.0.2
> >>under tomcat 4.1.24?
> >>
> >>The first few lines of my struts-config.xml look like this:
> >>
> >><?xml version="1.0" encoding="ISO-8859-1" ?>
> >><!DOCTYPE struts-config PUBLIC
> >>          "-//Apache Software Foundation//DTD Struts Configuration
> >> 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"
> >> [<!ENTITY barfoo SYSTEM "barfoo.xml">]
> >>
> >>
> >><struts-config>
> >>    &barfoo;
> >></struts-config>
> >>
> >>When it comes to processing the &barfoo; entity reference it fails with
> >>a file not found exception. Running tomcat with strace under linux I can
> >>see it trying to find barfoo.xml in the tomcat/bin directory rather than
> >>under the appropriate context's WEB-INF directory. Note that the same
> >>entity reference in web.xml works fine (i.e. it looks for barfoo.xml
> >>under the appropriate context's WEB-INF directory which is where I would
> >>expect a relative reference to be relative to).
> >>
> >>Using an absolute reference for the file isn't really a solution because
> >>the environment this app has to run in is a mix of linux, windows and
> >>solaris. (i.e.
> >>"C:\\foo\\bar\\tomcat\\webapps\\foobarcontext\\WEB-INF\\barfoo.xml"
> >>won't work on all platforms that is has to work on.).
> >
> >While not an exact solution to your dilema, why don't you just use
> > multiple config files?
>
> I'm not entirely sure what you mean by this, it might only be available
> in struts 1.1.
> The problem we have at the moment is that we have multiple web apps that
> share
> a bunch of common struts (and tiles) configuration. Rather than having
> multiple copies
> of this shared configuration in various config files I'd like to have on
> copy of the shared
> stuff referenced by the various config files.

Yes, I undertand your requirements.  There are patches available to enable 
backward compatibility to Struts 1.0.  See http://jamesholmes.com/struts/ for 
complete details.

Should you choose to use the Struts Console (also available from that same 
url), it doesn't work with entity refs.  That's one of the items standing in 
the way of supporting OJB configuration in the near future.

Good luck with whatever you choose.

>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

-- 
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message