Glad you actually got this tested against Struts 1.1.
:)
I'll try to get that stuff wired back up in the next couple of days...
Eddie
[EMAIL PROTECTED] wrote:
Author: rich
Date: Tue Nov 1 14:45:16 2005
New Revision: 330142
URL: http://svn.apache.org/viewcvs?rev=330142&view=rev
Log:
As discussed on the dev list, I've changed things so that the field validation annotations cause
Validator XML config files to be referenced through the classloader, as
"/_pageflow/pageflow-validation-*.xml" instead of through the servlet context as
"/WEB-INF/classes/_pageflow/pageflow-validation-*.xml". I added doc on the simple
workaround for use with Struts 1.1.
tests: bvt in netui, bvt.struts11 in netui/test/webapps/drt (WinXP) (before
Eddie disabled it :) )
BB: bvt in netui (linux) [bvt.struts11 to follow later]
Modified:
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
beehive/trunk/netui/test/webapps/drt/build.xml
Modified:
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
URL:
http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java?rev=330142&r1=330141&r2=330142&view=diff
==============================================================================
---
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
(original)
+++
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/FlowControllerGenerator.java
Tue Nov 1 14:45:16 2005
@@ -172,14 +172,20 @@
{
e.printDiagnostic( getDiagnostics() );
}
- catch ( Exception e )
+ catch ( FileNotFoundException e )
+ {
+ getDiagnostics().addError( publicClass, "error.could-not-generate",
+ strutsConfigFile != null ? strutsConfigFile.getPath() :
null,
+ e.getMessage() );
+ }
+ catch ( IOException e )
+ {
+ getDiagnostics().addError( publicClass, "error.could-not-generate",
+ strutsConfigFile != null ? strutsConfigFile.getPath() :
null,
+ e.getMessage() );
+ }
+ catch ( XmlModelWriterException e )
{
- e.printStackTrace(); // @TODO get rid of this
- assert e instanceof FileNotFoundException
- || e instanceof IOException
- || e instanceof XmlModelWriterException
- : e.getClass().getName();
-
getDiagnostics().addError( publicClass, "error.could-not-generate",
strutsConfigFile != null ?
strutsConfigFile.getPath() : null,
e.getMessage() );
Modified:
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
URL:
http://svn.apache.org/viewcvs/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java?rev=330142&r1=330141&r2=330142&view=diff
==============================================================================
---
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
(original)
+++
beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/StrutsApp.java
Tue Nov 1 14:45:16 2005
@@ -596,7 +596,7 @@
if ( _validationModel != null && ! _validationModel.isEmpty() )
{
- pathNames.append( ",/WEB-INF/classes/" ).append(
_validationModel.getOutputFileURI() );
+ pathNames.append( ",/" ).append(
_validationModel.getOutputFileURI() );
}
if ( _additionalValidatorConfigs != null )
Modified: beehive/trunk/netui/test/webapps/drt/build.xml
URL:
http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/build.xml?rev=330142&r1=330141&r2=330142&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/build.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/build.xml Tue Nov 1 14:45:16 2005
@@ -207,6 +207,14 @@
<property name="struts.version" value="1.1"/>
<antcall target="clean"/>
<antcall target="build"/>
+ <!-- This is the documented workaround for using declarative
validation with Struts 1.1.
+ We need to copy the resources so they can be loaded from *servlet
context* as
+ /_pageflow/pageflow-validation-*.xml. -->
+ <delete dir="${webapp.dir}/_pageflow"/>
+ <mkdir dir="${webapp.dir}/_pageflow"/>
+ <copy todir="${webapp.dir}/_pageflow">
+ <fileset dir="${webapp.dir}/WEB-INF/classes/_pageflow"
includes="*-validation*.xml"/>
+ </copy>
<ant dir="${testrecorder.dir}" antfile="testRecorder.xml" inheritAll="false"
target="server.test">
<property name="app.build.dir" location="${basedir}"/>
<property name="waitfor.url" value="${server.root.url}"/>
@@ -216,6 +224,7 @@
<property name="formatter.type" value="xml"/>
<property name="formatter.usefile" value="true"/>
</ant>
+ <delete dir="${webapp.dir}/_pageflow"/>
</target>
<target name="suite.running" description="Playback a test recorder test suite against a running server">