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

Jetty example source code file (annotations-context.xml)

This example Jetty source code file (annotations-context.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, array, atomikos, call, configure, configure, get, jotm, new, new, of, set, set

The Jetty annotations-context.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-annotations webapp                           -->
<!-- =============================================================== -->

<Configure class="org.mortbay.jetty.webapp.WebAppContext">

  <!-- =========================================================== -->
  <!-- Configurations for WebAppContexts                          -->
  <!-- Sequence of configurations to be applied to a webapp that  -->
  <!-- wants to use Annotations                                   -->
  <!-- ========================================================== -->
  <Array id="annotationConfig" type="java.lang.String">
    <Item>org.mortbay.jetty.webapp.WebInfConfiguration
    <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration
    <Item>org.mortbay.jetty.annotations.Configuration
    <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration
    <Item>org.mortbay.jetty.webapp.TagLibConfiguration
  </Array>


  <!-- =============================================================== -->
  <!-- Configure the webapp                                            -->
  <!-- =============================================================== -->
  <Set name="contextPath">/test-annotations
  <Set name="war">/contexts/test-annotations.d
  <Set name="configurationClasses">

  <Get name="securityHandler">
    <Set name="userRealm">
      <New class="org.mortbay.jetty.security.HashUserRealm">
        <Set name="name">Test Realm
        <Set name="config">/etc/realm.properties
      </New>
    </Set>
  </Get>


  <!-- =============================================================== -->
  <!-- Set up some env entrys                                          -->
  <!-- =============================================================== -->
  <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-annotations.d/WEB-INF/classes/jta.properties
  </Call>


  <New id="maxAmount"  class="org.mortbay.jetty.plus.naming.EnvEntry">
    <Arg>maxAmount
    <Arg type="java.lang.Double">100
    <Arg type="boolean">true
  </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>
   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>


  END OF JOTM -->

</Configure>

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty annotations-context.xml source code file:

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.