tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woodchuck <woodchuc...@yahoo.com>
Subject Re: web.xml pointing to other xml files?
Date Tue, 29 Jun 2004 18:55:30 GMT
hi QM,

just thought i'd follow up on how i ended up doing mine.  it's
essentially the same strategy but instead of including everything in
the jspc generated file, i'm only including the exact segment that i
need and i'm using the plain <replace> task.

build file:

<loadfile srcfile="web.xml" property="myfile">
<filterchain>
<headfilter lines="-1" skip="10"/>
<tailfilter lines="-1" skip="3"/>
</filterchain>
</loadfile>

<replace file="${webapp.build}/WEB-INF/web.xml" 
token="&lt;!-- @SERVLET_MAPPINGS@ --&gt;" 
value="${myfile}"/>


web.xml file:

<servlet>
    <servlet-name>action</servlet-name>
   
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>

  <!-- @SERVLET_MAPPINGS@ -->

  <!-- Standard Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

by replacing the my entire 'placeholder' string "<!--
@SERVLET_MAPPINGS@ -->" with the servlet mappings from jspc, my web.xml
file is still valid even if i never pre-compile.

thanks again for your help!  "TMTOWTDI" is really true for Ant!

woodchuck
 

--- QM <qm300@brandxdev.net> wrote:
> On Mon, Jun 28, 2004 at 09:45:55AM -0700, Woodchuck wrote:
> : actually i'm using Ant too.  i'm pre-compiling using the <jspc>
> task
> : and it generates a file containing <servlet> and <servlet-mapping>
> : tags.  that's exactly what i need to do really, is to merge this
> file
> : with my web.xml file.  if you can show me how you're doing it that
> : would be great, thanks!
> 
> Appended below.  Perl's "TMTOWTDI" motto reigns here, because I'm
> certain there are other (and gmore elegant) ways to do this...
> 
> -QM
> 
> 
> ... from build.xml ...
> 	<!--
> 	make the contents of the precompiled JSP mappings
> 	(from the "jspc" task) available as a replacement
> 	variable "@PRECOMPILED_JSPS@" in web.xml
> 	-->
> 
> 	<loadfile
> 		property="jsp.precomp.data"
> 		srcFile="${warfile.build_dir}/WEB-INF/precompiled_jsps.xml"
> 	/>
> 
> 	<!--
> 	copy the web.xml to its destination, and in the process,
> 	replace "@PRECOMPILED_JSPS@" with the content of the
> 	precompiled_jsps.xml file
> 	-->
> 
> 	<copy
> 		file="files.WEB-INF/web.xml"
> 		overwrite="true"
> 		toFile="${warfile.build_dir}/WEB-INF/web.xml"
> 	>
> 		<filterset>
> 			<filter
> 				token="PRECOMPILED_JSPS"
> 				value="${jsp.precomp.data}"
> 			/>
> 		</filterset>
> 
> 	</copy>
> 
> ... from web.xml (before it's copied with Ant's <copy> task ...
> 
> 	<!-- BEGIN: precompiled JSPs -->
> 	@PRECOMPILED_JSPS@
> 	<!-- END: precompiled JSPs -->
> 
> 
> -- 
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message