File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts validation.xml validator_1_1.dtd problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts validation.xml validator_1_1.dtd problem" Watch "Struts validation.xml validator_1_1.dtd problem" New topic
Author

Struts validation.xml validator_1_1.dtd problem

Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
The validation.xml contains a reference to a DTD file at the top of the file. This section references a DTD file present on the Jakarta web-site.
When there is no net connection available, Tomct throws an exception, saying that the file couldn't be found.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

If that issue is such a concern, delete it from the top of your validation.xml.


A good workman is known by his tools.
Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
Its not just the exception. This would mean that my XML file may contain invalid entries, since its the DTD's job to validate the entries in the struts-config.xml or validation.xml files.
Peter Laurinec
Ranch Hand

Joined: Sep 13, 2004
Posts: 52
Well there is always an option that you download the .dtd file on your local system and place the appropriate SYSTEM "path_to_dtd_file" instead of that PUBLIC reference to the jakarta web site.


SCJP 1.5 (done, at last)<br /> <br />"If everything seems to be going well you have obviously overlooked something."
Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
That's precisely what I want to do.
Here's the entry in my validation.xml file.

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

I have downloaded the struts-config_1_1.dtd file from the Jakarta site.
Assuming I store it in my webapp's root directory, what should the above entry in my .xml file(s) be replaced with?
This might sound too simple, but I have found it quite annoying.
I want a quick solution, and don't really have the time to figure out the solution myself.
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
Note: The path specified for SYSTEM is relative to the xml file
<!DOCTYPE struts-config SYSTEM "struts-config_1_1.dtd">
In this case the dtd is in the same folder as the xml file.


Even this should work, i.e. specifying the SYSTEM identifier following the PUBLIC identifier. The word SYSTEM is implied.
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "../struts-config_1_1.dtd">
In this case the dtd is in the webapp's root directory assuming the xml is in WEB-INF.

I have not tried these, but they should work. Let us know which one worked for you.

Sheldon Fernandes
[ September 22, 2004: Message edited by: Sheldon Fernandes ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts validation.xml validator_1_1.dtd problem
 
Similar Threads
validator.xml doubt
struts1.2.5
Validation doesn' work :cry:
Resource for xml validation
The Validation xml DTD