Thanks Jan,

But I would like to avoid the server name http://127.0.0.1:XXXX or any
access to a specific server.

When I use Struts in my application, I have the following config file
<?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";>
<struts-config>

If I see the Tomcat log I can see:

register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN',
'jar:file:C:/java/jakarta-tomcat-4.0.1/webapps/strutsjndi/WEB-INF/lib/struts.jar!/org

/apache/struts/resources/struts-config_1_0.dtd'

You can see the struts.jar contains the dtd but in the xml file the
reference is the
following:
    "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";

I want to reproduce this configuration.
Can you help me?

Benoit


Jan Søgaard wrote:

> Hi Benoit
>
> Remember that the resources under /WEB-INF/ is not directly accessible
> for the end user.
> If you place your DTD in a directory TOMCAT_HOME/webapps/myApplication/
> You will have directly access to it, from other applications, accessing
> the DTD through tomcat.
>
> e.g..
>
> I have a dtd placed in TOMCAT_HOME/webapps/myapp/my.dtd
> the receiving XML have the following header:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE message SYSTEM "http://127.0.0.1:8090/myapp/my.dtd";>
>
> And my Servlet is able to validate the document according to this DTD.
>
> So, in short, I don't think you need to register your dtd, just placed
> it, in a directory outside the WEB-INF.
> Then every application can access it, through the URL, not the fully
> qualified path.
>
> If this is not, what you questioned, please explain your problem, and I
> will try to help
>
> Jan
>
> -----Original Message-----
> From: Benoit Segaert [mailto:[EMAIL PROTECTED]]
> Sent: 20. februar 2002 10:39
> To: [EMAIL PROTECTED]
> Subject: How can I register a DTD in a war
>
> I want to validate a XML with a DTD in a War application.
> I have my DTD available in the war file.
>
> I use a XML file like the following:
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE Application SYSTEM
>
> "file:///C:/java/jakarta-tomcat-4.0.1/webapps/myapplication/WEB-INF/Ldap
> Framework.dtd">
>
> <Application>
>     ...
>
> But I want to register my DTD in Tomcat for the using of the following
> XML header
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE Application PUBLIC
>           "-//Uniway Belgium//DTD Application Configuration 1.0//EN"
>          "http://www.uniway.be/application/dtds/application_1_0.dtd";>
> <Application>
>     ...
>
> How can I explain to Tomcat the mapping between this header and the real
>
> place of the DTD in the War of Jar?
>
> I don't know if it is the good mailing list but I can see that Tomcat
> provides
> this feature.
>
> Benoit
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to