clnt-struts request

Raoul Pierre <[email protected]>
Newsgroups gmane.comp.java.keel.devel
Message-ID <[email protected]>
Hello,


May I request some additions/modifications to be able to use:
- Tiles with Struts
- JSTL 1.1

Here is a proposition:
- put in clnt-struts\conf\client\snippets directory the files
  * tiles-defs1.xml
  * tiles-defs2.xml
  * tiles-defs3.xml
- split clnt-struts\conf\client\snippets\struts-config1.xml in
  * struts-config0-v1.1.xml
  * struts-config0-v1.2.xml
  * struts-config1.xml
- split clnt-struts\conf\client\snippets\struts-config3.xml in
  * struts-config-tiles-v1.1.xml
  * struts-config-tiles-v1.2.xml
  * struts-config3.xml
- split keel-client\conf\client\snippets\web-1.xml in
  * web-0-servlet-2.2.xml
  * web-0-servlet-2.4.xml
  * web-1.xml
- changes in plugin.jelly (herewith diff -c2 with 1.2.12).

Regards

Pierre
tiles-defs3.xml (text/xml, 21 B)
</tiles-definitions>
tiles-defs1.xml (text/xml, 231 B)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tiles-definitions PUBLIC 
	"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
	"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">

<tiles-definitions>
tiles-defs2.xml (text/xml, 273 B)
	<definition name="default" path="/layouts/defaultLayout.jsp">
	  <put name="title" value="My Title"/>
	  <put name="header" value="/tiles/header.jsp"/>
	  <put name="footer" value="/tiles/footer.jsp"/>
	  <put name="message" value="/tiles/message.jsp"/>  
	</definition>
struts-config1.xml (text/xml, 790 B)
<struts-config>


  <!-- ========== Form Bean Definitions =================================== -->
  <form-beans>

    <form-bean      name="none"
                    type="org.apache.struts.action.DynaActionForm"/>

  </form-beans>


  <!-- ========== Global Forward Definitions ============================== -->
  <global-forwards>

 
     <!-- Default forward for Keel models that do not otherwise specify a forward -->
     <!-- When specifying a "forward" to be associated with a particular model, edit the configuration -->
     <!-- for that model in the system.xconf file, and add an "attribute" element with a name of "forward" -->
     <!-- Use the "crud" model configurations as an example of what to do -->
     <forward   name="default"                path="/keel.jsp"/>
struts-config0-v1.1.xml (text/xml, 227 B)
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
struts-config0-v1.2.xml (text/xml, 232 B)
<?xml version="1.0" encoding="ISO-8859-1" ?>

    <!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
              "http://struts.apache.org/dtds/struts-config_1_2.dtd">
struts-config-tiles-v1.2.xml (text/xml, 344 B)
<!-- Enable Tiles -->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" 
                  value="/WEB-INF/tiles-defs.xml" 
                  />
    <set-property property="definitions-parser-validate" value="true" />
    <set-property property="moduleAware" value="true" />
</plug-in>
struts-config-tiles-v1.1.xml (text/xml, 402 B)
<!-- Enable Tiles -->
  <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" 
                  value="/WEB-INF/tiles-defs.xml" />
    <set-property property="definitions-debug" value="0" />
    <set-property property="definitions-parser-details" value="0" />
    <set-property property="definitions-parser-validate" value="true" />
  </plug-in>
struts-config3.xml (text/xml, 18 B)
</struts-config>
web-1.xml (text/xml, 128 B)

  <context-param>
     <param-name>keel.client.timeout</param-name>
     <param-value>60000</param-value>
  </context-param>
web-0-servlet-2.2.xml (text/xml, 194 B)
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
  
<web-app>
web-0-servlet-2.4.xml (text/xml, 335 B)
<?xml version="1.0" encoding="ISO-8859-1"?>
  
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4"
         >
diff-c2-1.2.12.txt (text/plain, 6.5 KB)
*** plugin.jelly-1.2.12	Wed Mar 09 12:32:55 2005
--- plugin.jelly	Sun Mar 13 18:50:45 2005
***************
*** 8,12 ****
  
      <goal name="keel:version" description="Display the version of this Keel plugin">
!        <echo>Keel plugin v1.2.12</echo>
      </goal>
  
--- 8,12 ----
  
      <goal name="keel:version" description="Display the version of this Keel plugin">
!        <echo>Keel plugin v1.2.12 (modified)</echo>
      </goal>
  
***************
*** 369,372 ****
--- 369,389 ----
                </j:if>
            </j:if>
+          <j:if test="${dep.getArtifactId()=='servletapi'}">
+            <echo>Servlet API version detected</echo>
+            <j:choose>
+              <j:set var="servletApi" value="${dep.getVersion()}" />
+              <j:when test="${!empty(servletApi)}">
+                <property name="servlet.api" value="${dep.getVersion()}"/>
+              </j:when>
+            </j:choose>
+            <echo>Servlet API version: ${servlet.api} (${dep.getVersion()})</echo>
+           </j:if>
+          <j:if test="${dep.getArtifactId()=='struts'}">
+            <echo>Struts version detected</echo>
+            <j:if test="${!empty(dep.getVersion())}">
+              <property name="struts.version" value="${dep.getVersion()}"/>
+            </j:if>
+            <echo>Struts version: ${struts.version} (${dep.getVersion()})</echo>
+          </j:if>
          </j:forEach>
  
***************
*** 385,391 ****
               </fileset>
            </copy>
!           <copy tofile="${maven.war.webapp.dir}/WEB-INF/struts-config.xml" overwrite="true"
!                file="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets/struts-config1.xml"/>
!           <concat destfile="${maven.war.webapp.dir}/WEB-INF/struts-config.xml" append="true">
               <fileset dir="${basedir}/target/temp/lib">
                   <include name="**/conf/client/struts/struts-config.xml"/>
--- 402,424 ----
               </fileset>
            </copy>
!           <j:choose>
!             <j:set var="strutsVersion" value="${struts.version}" />
!             <j:when test="${strutsVersion.substring(0, 3) == '1.2'}">
!               <property name="start_struts_config_xml" value="-v1.2"/>
!             </j:when>
!             <j:otherwise>
!               <property name="start_struts_config_xml" value="-v1.1"/>
!             </j:otherwise>
!           </j:choose>
!           <copy tofile="${maven.war.webapp.dir}/WEB-INF/struts-config.xml" 
!                 overwrite="true"
!                 file="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets/struts-config0${start_struts_config_xml}.xml"
!                 />
!           <concat destfile="${maven.war.webapp.dir}/WEB-INF/struts-config.xml" 
!                   append="true"
!                   >
!              <fileset dir="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets">
!                  <include name="struts-config1.xml"/>
!              </fileset>
               <fileset dir="${basedir}/target/temp/lib">
                       <include name="**/conf/client/struts/struts-config.xml"/>
***************
*** 398,404 ****
--- 431,459 ----
               </fileset>
               <fileset dir="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets">
+                  <include name="struts-config-tiles${start_struts_config_xml}.xml"/>
+              </fileset>
+              <fileset dir="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets">
                   <include name="struts-config3.xml"/>
               </fileset>
            </concat>
+ 
+           <copy tofile="${maven.war.webapp.dir}/WEB-INF/tiles-defs.xml" 
+                 overwrite="true"
+                 file="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets/tiles-defs1.xml"
+                 />
+           <concat destfile="${maven.war.webapp.dir}/WEB-INF/tiles-defs.xml" 
+                   append="true"
+                   >
+              <fileset dir="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets">
+                  <include name="tiles-defs2.xml"/>
+              </fileset>
+              <fileset dir="${basedir}/target/temp/lib">
+                      <include name="**/conf/client/struts/tiles-defs.xml"/>
+              </fileset>
+              <fileset dir="${basedir}/target/temp/lib/clnt-struts/conf/client/snippets">
+                  <include name="tiles-defs3.xml"/>
+              </fileset>
+           </concat>
+ 
          </j:if>
  
***************
*** 415,423 ****
          </j:if>
  
          <copy tofile="${maven.war.webapp.dir}/WEB-INF/web.xml"
            overwrite="true" 
!           file="${basedir}/target/temp/lib/keel-client/conf/client/snippets/web-1.xml" >
        </copy>
  
        <j:if test="${context.getVariable('direct') == 'true'}">
          <concat destfile="${maven.war.webapp.dir}/WEB-INF/web.xml"
--- 470,495 ----
          </j:if>
  
+         <j:choose>
+           <j:set var="servletApi" value="${servlet.api}" />
+           <j:when test="${servletApi.substring(0, 3) == '2.4'}">
+             <property name="start_web_xml" value="-servlet-2.4"/>
+           </j:when>
+           <j:otherwise>
+             <property name="start_web_xml" value="-servlet-2.2"/>
+           </j:otherwise>
+         </j:choose>
          <copy tofile="${maven.war.webapp.dir}/WEB-INF/web.xml"
            overwrite="true" 
!               file="${basedir}/target/temp/lib/keel-client/conf/client/snippets/web-0${start_web_xml}.xml"
!               >
          </copy>
  
+       <concat destfile="${maven.war.webapp.dir}/WEB-INF/web.xml"
+           append="true">
+           <fileset dir="${basedir}/target/temp/lib/keel-client/conf/client/snippets/">
+               <include name="web-1.xml"/>
+           </fileset>
+       </concat>
+ 
        <j:if test="${context.getVariable('direct') == 'true'}">
          <concat destfile="${maven.war.webapp.dir}/WEB-INF/web.xml"
***************
*** 467,473 ****
--- 539,550 ----
                <include name="**/conf/client/webapp/web-error-page.xml"/>
            </fileset>
+           <j:choose>
+             <j:set var="strutsVersion" value="${struts.version}" />
+             <j:when test="${strutsVersion.substring(0, 3) != '1.2'}">
                <fileset dir="${basedir}/target/temp/lib/">
                  <include name="**/conf/client/webapp/web-taglib.xml"/>
                </fileset>
+             </j:when>
+           </j:choose>
            <fileset dir="${basedir}/target/temp/lib/">
                <include name="**/conf/client/webapp/web-resource-ref.xml"/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.