Hi List,

I have a rather annoying problem with the ValidatorPlugIn in a project using Struts:

1) I implement the ValidatorPlugIn as stated in James Holmes "Struts. The Complete Reference" (and several other
places).


2) In struts-config.xml I have

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

3) In the validator-rules.xml file and validation.xml file I have this

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>


The reference "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd"; is mapped to the validator_1_1.dtd in the
application directory.



3) Running the application in Oracle OC4J at one site behind a usual Linux PC firewall works.


4) Remove the internet connection and rerun the application.

Result: it fails when it loads validator.xml with a java.net.Exception: http.//jakarta.apache.org could not be contacted.

Remove the ValidatorPlugin from theapplication and the rerun. Result the application does not fail.

4) Run the application from Tomcat 5.0 behind a rather restrictive firewall with ValidatorPlugIn enabled.

Result: The application fails with a timeout exception from java.net because http://jakarta.apache.org could not be contacted.

5) Run the application from Tomcat 5.0 behind a rather restrictive firewall without ValidatorPlugIn enabled.

    Result: The applicaiton does not fail.

6) Put in a "hard" reference like this and rerun the application behind the firewall

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
"/usr/local/Struts/dtds/commons/dtds/validator_1_1.dtd">


   Result: The application runs.

Conclusion: The mapping in 2) does not require the xml parser to validate the document against
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd


but the ValidatorPlugIn forces the xml parser to validate the document against
http://jakarta.apache.org/commons/dtds/validator_1_1.dtd


So my question is simple:

How do I configure the application server so it does not validate against the "real" dtd?
Why is ValidatorPlugIn a special case in this context?



Regards

Flemming G. Jensen


-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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



Reply via email to