alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (jetty-test-jndi.xml)

This example Jetty source code file (jetty-test-jndi.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

arg, arg, atomikos, call, change-me, configure, jotm, new, new, of, put, put, set, set

The Jetty jetty-test-jndi.xml source code

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<!-- =============================================================== -->
<!-- Configure the test-jndi webapp                                  -->
<!-- =============================================================== -->
<Configure class="org.mortbay.jetty.webapp.WebAppContext">

<!-- Ensure Jetty Plus features are enabled for this webapp                      -->
  <Set name="configurationClasses">
    <Array type="java.lang.String">
      <Item>org.mortbay.jetty.webapp.WebInfConfiguration
      <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration
      <Item>org.mortbay.jetty.plus.webapp.Configuration
      <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration
      <Item>org.mortbay.jetty.webapp.TagLibConfiguration
    </Array>
  </Set>

  <Set name="contextPath">/test-jndi
  <Set name="war">/contexts/test-jndi.d
  <Set name="extractWAR">false
  <Set name="copyWebDir">false
  <Set name="descriptor">/contexts/test-jndi.d/WEB-INF/instruction-web.xml



<!-- Define a couple of system properties. These are jdbc and jta impl specific.  -->
  <Call class="java.lang.System" name="setProperty">
    <Arg>derby.system.home
    <Arg>
  </Call>

  <Call class="java.lang.System" name="setProperty">
    <Arg>com.atomikos.icatch.file
    <Arg>/contexts/test-jndi.d/WEB-INF/classes/jta.properties
  </Call>

  <!-- Define some env entries for java:comp/env                                  -->
  <New id="woggle"  class="org.mortbay.jetty.plus.naming.EnvEntry">
    <Arg>woggle
    <Arg type="java.lang.Integer">4000
  </New>

  <New id="wiggle"  class="org.mortbay.jetty.plus.naming.EnvEntry">
    <Arg>wiggle
    <Arg type="java.lang.Double">100
    <Arg type="boolean">true
  </New>

 <!-- Mail Session setup                                          -->
 <New id="xxxmail" class="org.mortbay.jetty.plus.naming.Resource">
     <Arg>mail/Session
     <Arg>
       <New class="org.mortbay.naming.factories.MailSessionReference">
         <Set name="user">CHANGE-ME
         <Set name="password">CHANGE-ME
         <Set name="properties">
           <New class="java.util.Properties">
             <Put name="mail.smtp.auth">false 
             <Put name="mail.smtp.host">CHANGE-ME
             <Put name="mail.from">CHANGE-ME
             <Put name="mail.debug">true
           </New>
          </Set>
       </New>
     </Arg>
 </New>

  <!-- =============================================================== -->
  <!-- Configuring Transactions and XA Datasources                     -->
  <!-- Uncomment EITHER the setup for Atomikos OR for Jotm             -->
  <!-- =============================================================== -->


  <!-- Atomikos        
  @ATOMIKOS-TRANSACTIONMANAGER@

  <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">
   <Arg>
     @ATOMIKOS-USERTRANSACTION@
   </Arg>
  </New>


  @ATOMIKOS-DATASOURCE1-PRE@


  <New id="mydatasource" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/mydatasource
    <Arg>
     @ATOMIKOS-DATASOURCE1@
    </Arg>
   </New>


  @ATOMIKOS-DATASOURCE2-PRE@

  <New id="mydatasource2" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/mydatasource2
    <Arg>
       @ATOMIKOS-DATASOURCE2@
    </Arg>
   </New>
   END OF ATOMIKOS -->

  <!-- JOTM
  @JOTM-TRANSACTIONMANAGER@

  <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">
   <Arg>
     @JOTM-USERTRANSACTION@
   </Arg>
  </New>


  @JOTM-DATASOURCE1-PRE@


  <New id="mydatasource" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/mydatasource
    <Arg>
     @JOTM-DATASOURCE1@
    </Arg>
   </New>


  @JOTM-DATASOURCE2-PRE@

  <New id="mydatasource2" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/mydatasource2
    <Arg>
       @JOTM-DATASOURCE2@
    </Arg>
   </New>
  END OF JOTM -->

</Configure>

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty jetty-test-jndi.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.