|
A non-empty <distributable> element is also invalid wrt servlet spec 2.3 (http://java.sun.com/dtd/web-app_2_3.dtd):
<!-- The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container Used in: web-app --> <!ELEMENT distributable EMPTY> Improved the handling of the <distributable/> element by Castor and the Admin portlet. The patch attached to this issue was the basis for the fix, but was modified before it was committed.
Here's a summary of the changes: Added descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java + Models the <distributable/> web-app element Modified descriptors/src/test/org/apache/pluto/descriptors/servlet/WebAppDDTest.java + Added test for the Distributable object Modified descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java + Changed distributable field type from boolean to DistributableDD + Updated accessors Modified descriptors/src/conf/org/apache/pluto/descriptors/servlet/castor-web-xml-mapping.xml + Changed the Distributable field to be a DistributableDD object + Added a the DistributableDDCastorFieldHandler to the Distributable field + Added the Distributable class, with its field handler DistributableCastorFieldHandler Added descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java + Intercepts Castor access to the distributable field. + Places an empty <distributable/> element in web.xml if a web-app is marked distributable Added descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java + Intercepts Castor access to the DistributableDD field Modified portal/src/java/org/apache/pluto/portlet/admin/services/DeployWarService.java + Updated the error message thrown when extractFile(String,String) obtains a null InputStream + Updated addRecordsToWebXml method - it now checks for elements with no bodies. E.g. a "<distributable/>" element |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This patch adds:
descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDD.java
A class for modeling the <distributable> element of the web.xml
descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableDDCastorFieldHandler.java
A custom Castor field handler which intercepts the getValue() call to the "Distributable" field.
It returns null if the underlying DistributableDD field is set to false so that the <distributable>
element won't be printed out when it isn't supposed to be.
descriptors/src/java/org/apache/pluto/descriptors/servlet/DistributableCastorFieldHandler.java
A custom Castor field handler which intercepts the getValue() call to the DistributableDD field.
It always returns null because the <distributable> element cannot carry content.
This patch modifies:
descriptors/src/test/org/apache/pluto/descriptors/servlet/WebAppDDTest.java
Added a test for the the WebAppDD getDistributable() method
descriptors/src/java/org/apache/pluto/descriptors/servlet/WebAppDD.java
Changes the type of the distributable field from boolean to DistributableDD and updates accessors appropriately.
descriptors/src/conf/org/apache/pluto/descriptors/servlet/castor-web-xml-mapping.xml
Updates the Distributeable <field>'s type, and adds a custom handler for the field.
Adds a <class> mapping for the DistributableDD type which also includes a custom handler.