struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: Split web.xml into multiple files
Date Mon, 03 May 2004 18:37:43 GMT
Prasad, Kamakshya wrote:

>Hi, 
>
>I tried xml entity. It worked though I have few doubts.
>
>This is part of the xml which have that reference
>
><?xml version="1.0" encoding="ISO-8859-1"?>
><!DOCTYPE 
>	web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
>2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"
>	 [<!ENTITY xmlfrag SYSTEM
>"file:///F:/struts/web/WEB-INF/servlet.xml" >]>
><web-app>
>  <display-name>Struts POC</display-name>
>
>  <!-- Action Servlet Configuration -->
>  &xmlfrag;
>
>  
>
I presume that "</web-app>" goes here?

>The "&xmlfrag" contains the servlet specification and everything is
>working fine but when I start the server it always throw this error.
>
><May 3, 2004 4:12:55 PM JST> <Error> <HTTP> <BEA-101306> <Could
not
>resolve entity "null" for the webapp at: "null". Check your DTD
>reference in the corresponding descriptor (web.xml/weblogic.xml).>
>
>What has to be done to get rid of this error?
>
>  
>
Even if this worked, you really don't want to be using absolute paths.  
A more typical scenario would be to put your fragment (say, in a file 
called "action-servlet.xml") in the WEB-INF directory next to web.xml, 
and change the entity declaration to something like:

  <!ENTITY xmlfrag SYSTEM "action-servlet.xml">

This will work *if* your container parses web.xml files in a manner 
where the XML parser knows the absolute URL of the web.xml file itself, 
so that it can resolve relative references.  Tomcat works this way, but 
I don't know if WebLogic does.

>Thanks and Regards,
>KP
>
>  
>
Craig


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


Mime
View raw message