blob: 3e3ef7068341dd716de4bbafaf9ce21536f50569 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EJB 2.1 CMP EntityBeans (CMP2)</title>
<meta name="description" content="Apache TomEE">
<meta name="author" content="Apache TomEE">
<meta name="google-translate-customization" content="f36a520c08f4c9-0a04e86a9c075ce9-g265f3196f697cf8f-10">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="./../../resources/css/bootstrap.css" rel="stylesheet">
<link href="./../../resources/css/prettify.css" rel="stylesheet">
<!--link href="./../../resources/css/bootstrap-mods.css" rel="stylesheet"-->
<link href="./../../resources/css/main.css" rel="stylesheet">
<link href="./../../resources/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
var t = encodeURIComponent(document.title.replace(/^\s+|\s+$/g,""));
var u = encodeURIComponent(""+document.URL);
function fbshare () {
window.open(
"http://www.facebook.com/sharer/sharer.php?u="+u,
'Share on Facebook',
'width=640,height=426');
};
function gpshare () {
window.open(
"https://plus.google.com/share?url="+u,
'Share on Google+',
'width=584,height=385');
};
function twshare () {
window.open(
"https://twitter.com/intent/tweet?url="+u+"&text="+t,
'Share on Twitter',
'width=800,height=526');
};
function pinshare () {
window.open("//www.pinterest.com/pin/create/button/?url="+u+"&media=http%3A%2F%2Ftomee.apache.org%2Fresources%2Fimages%2Ffeather-logo.png&description="+t,
'Share on Pinterest',
'width=800,height=526');
};
</script>
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="./../../favicon.ico">
<link rel="apple-touch-icon" href="./../../resources/images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="./../../resources/images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="./../../resources/images/apple-touch-icon-114x114.png">
<script src="./../../resources/js/prettify.js" type="text/javascript"></script>
<script src="./../../resources/js/jquery-latest.js"></script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<script src="./../../resources/js/common.js"></script>
<script src="./../../resources/js/prettyprint.js"></script>
<!--script src="//assets.pinterest.com/js/pinit.js" type="text/javascript" async></script//-->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2717626-1']);
_gaq.push(['_setDomainName', 'apache.org']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="topbar" data-dropdown="dropdown">
<div class="fill">
<div class="container">
<a class="brand" href="./../../index.html">Apache TomEE</a>
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
Apache
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<!-- <li><a href="./../../misc/whoweare.html">Who we are?</a></li> -->
<!-- <li><a href="./../../misc/heritage.html">Heritage</a></li> -->
<li><a href="http://www.apache.org">Apache Home</a></li>
<!-- <li><a href="./../../misc/resources.html">Resources</a></li> -->
<li><a href="./../../misc/contact.html">Contact</a></li>
<li><a href="./../../misc/legal.html">Legal</a></li>
<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
<li class="divider"/>
<li><a href="http://www.apache.org/security">Security</a></li>
</ul>
</li>
<li><a href="./../../index.html">Home</a></li>
<li><a href="./../../downloads.html">Downloads</a></li>
<li><a href="./../../documentation.html">Documentation</a></li>
<li><a href="./../../examples-trunk/index.html">Examples</a></li>
<li><a href="./../../support.html">Support</a></li>
<li><a href="./../../contribute.html">Contribute</a></li>
<li><a href="./../../security/index.html">Security</a></li>
</ul>
<!-- Google CSE Search Box Begins -->
<FORM class="pull-right" id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
<INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
<INPUT type="hidden" name="cof" value="FORID:0">
<INPUT size="18" width="130" style="width:130px" name="q" type="text" placeholder="Search">
</FORM>
<!--<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>-->
<!-- Google CSE Search Box Ends -->
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span8">
<small><a href="./../../index.html">Home</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/">Examples Trunk</a>&nbsp;&raquo&nbsp;<a href="./../../examples-trunk/simple-cmp2/">Simple Cmp2</a></small><br>
</div>
<div class="span8">
</div>
</div>
&nbsp;
<div class="page-header">
<h1>EJB 2.1 CMP EntityBeans (CMP2)
<div style="float: right; position: relative; bottom: -10px; ">
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<a onclick="javascript:gpshare()" class="gp-share sprite" title="Share on Google+">share [gp]</a>
<a onclick="javascript:fbshare()" class="fb-share sprite" title="Share on Facebook">share [fb]</a>
<a onclick="javascript:twshare()" class="tw-share sprite" title="Share on Twitter">share [tw]</a>
<a onclick="javascript:pinshare()" class="pin-share sprite" title="Share on Pinterest">share [pin]</a>
<a data-toggle="modal" href="#edit" class="edit-page" title="Contribute to this Page">contribute</a>
</div>
</h1>
</div>
<p>OpenEJB, the EJB Container for TomEE and Geronimo, does support all of EJB 1.1 to 3.1, including CMP2.</p>
<p>The CMP2 implementation is actually done by adapting the CMP2 bean into a JPA Entity dynamically at deploy time.</p>
<p>Appropriate subclasses, a JPA persistence.xml file and a mapping.xml file are generated at deployment
time for the CMP2 EntityBeans and all the Entities will be then run on OpenJPA. This innovative code
has been used as the sole CMP2 implementation in Geronimo for its J2EE 1.4, JavaEE 5 and JavaEE 6 certifications.</p>
<p>The persistence.xml and mapping.xml files generated at deploy time can be saved to disk and included
in the application, allowing you to:</p>
<ul>
<li>gain finer control over persistence options</li>
<li>slowly convert individual entities from CMP2 to JPA</li>
</ul>
<p>Let's see an example.</p>
<h1>Movies application</h1>
<p>The following is a basic EJB 2.1 application consisting of one CMP2 Entity. For those that are reading this example
out of curiosity and are not familiar with CMP2 or EJB 2.x, each CMP2 Entity is composed of two parts</p>
<ul>
<li><strong>A Home interface</strong> which has data access methods like "find", "create", and "remove". This is essentially
what people use <code>@Stateless</code> beans for today, but with difference that you do not need to supply
the implementation of the interface -- the container will generate one for you. This is partly what inspired
the creation of the OpenEJB-specific <a href="../dynamic-dao-implementation/README.html">Dynamic DAO</a> feature.</li>
<li><strong>An abstract EntityBean class</strong> which declares the persistent "properties" of the entity without actually
declaring any fields. It is the container's job to implement the actual methods and create the appropriate
fields. OpenEJB will implement this bean as a JPA <code>@Entity</code> bean.</li>
</ul>
<p>As such a CMP2 EntityBean is really just the description of a persistent object and the description of a
data-access object. There is no actual code to write.</p>
<p>The majority of work in CMP2 is done in the xml:</p>
<ul>
<li><strong>ejb-jar.xml</strong> mapping information, which describes the persistent properties of the entity and the queries
for all <em>Home</em> find, create and remove methods. This information will be converted by OpenEJB into
a JPA mapping.xml file. All queries in the cmp2 part of the ejb-jar.xml are converted
into named queries in JPA and generally everything is converted to its JPA equivalent. </li>
</ul>
<h2>CMP2 EntityBean, MovieBean</h2>
<pre><code>package org.superbiz.cmp2;
import javax.ejb.EntityBean;
public abstract class MovieBean implements EntityBean {
public MovieBean() {
}
public Integer ejbCreate(String director, String title, int year) {
this.setDirector(director);
this.setTitle(title);
this.setYear(year);
return null;
}
public abstract java.lang.Integer getId();
public abstract void setId(java.lang.Integer id);
public abstract String getDirector();
public abstract void setDirector(String director);
public abstract String getTitle();
public abstract void setTitle(String title);
public abstract int getYear();
public abstract void setYear(int year);
}
</code></pre>
<h2>CMP2 Home interface, Movies</h2>
<pre><code>package org.superbiz.cmp2;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;
/**
* @version $Revision$ $Date$
*/
interface Movies extends javax.ejb.EJBLocalHome {
Movie create(String director, String title, int year) throws CreateException;
Movie findByPrimaryKey(Integer primarykey) throws FinderException;
Collection&lt;Movie&gt; findAll() throws FinderException;
Collection&lt;Movie&gt; findByDirector(String director) throws FinderException;
}
</code></pre>
<h2>CMP2 mapping in ejb-jar.xml</h2>
<pre><code>&lt;ejb-jar&gt;
&lt;enterprise-beans&gt;
&lt;entity&gt;
&lt;ejb-name&gt;MovieBean&lt;/ejb-name&gt;
&lt;local-home&gt;org.superbiz.cmp2.Movies&lt;/local-home&gt;
&lt;local&gt;org.superbiz.cmp2.Movie&lt;/local&gt;
&lt;ejb-class&gt;org.superbiz.cmp2.MovieBean&lt;/ejb-class&gt;
&lt;persistence-type&gt;Container&lt;/persistence-type&gt;
&lt;prim-key-class&gt;java.lang.Integer&lt;/prim-key-class&gt;
&lt;reentrant&gt;false&lt;/reentrant&gt;
&lt;cmp-version&gt;2.x&lt;/cmp-version&gt;
&lt;abstract-schema-name&gt;MovieBean&lt;/abstract-schema-name&gt;
&lt;cmp-field&gt;
&lt;field-name&gt;id&lt;/field-name&gt;
&lt;/cmp-field&gt;
&lt;cmp-field&gt;
&lt;field-name&gt;director&lt;/field-name&gt;
&lt;/cmp-field&gt;
&lt;cmp-field&gt;
&lt;field-name&gt;year&lt;/field-name&gt;
&lt;/cmp-field&gt;
&lt;cmp-field&gt;
&lt;field-name&gt;title&lt;/field-name&gt;
&lt;/cmp-field&gt;
&lt;primkey-field&gt;id&lt;/primkey-field&gt;
&lt;query&gt;
&lt;query-method&gt;
&lt;method-name&gt;findByDirector&lt;/method-name&gt;
&lt;method-params&gt;
&lt;method-param&gt;java.lang.String&lt;/method-param&gt;
&lt;/method-params&gt;
&lt;/query-method&gt;
&lt;ejb-ql&gt;SELECT m FROM MovieBean m WHERE m.director = ?1&lt;/ejb-ql&gt;
&lt;/query&gt;
&lt;query&gt;
&lt;query-method&gt;
&lt;method-name&gt;findAll&lt;/method-name&gt;
&lt;method-params/&gt;
&lt;/query-method&gt;
&lt;ejb-ql&gt;SELECT m FROM MovieBean as m&lt;/ejb-ql&gt;
&lt;/query&gt;
&lt;/entity&gt;
&lt;/enterprise-beans&gt;
&lt;/ejb-jar&gt;
</code></pre>
<h2>openejb-jar.xml</h2>
<pre><code>&lt;openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"&gt;
&lt;enterprise-beans&gt;
&lt;entity&gt;
&lt;ejb-name&gt;MovieBean&lt;/ejb-name&gt;
&lt;key-generator xmlns="http://www.openejb.org/xml/ns/pkgen-2.1"&gt;
&lt;uuid/&gt;
&lt;/key-generator&gt;
&lt;/entity&gt;
&lt;/enterprise-beans&gt;
&lt;/openejb-jar&gt;
</code></pre>
<h2>MoviesTest</h2>
<pre><code>package org.superbiz.cmp2;
import junit.framework.TestCase;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Collection;
import java.util.Properties;
/**
* @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
*/
public class MoviesTest extends TestCase {
public void test() throws Exception {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
p.put("movieDatabase", "new://Resource?type=DataSource");
p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabase.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
p.put("movieDatabaseUnmanaged.JtaManaged", "false");
Context context = new InitialContext(p);
Movies movies = (Movies) context.lookup("MovieBeanLocalHome");
movies.create("Quentin Tarantino", "Reservoir Dogs", 1992);
movies.create("Joel Coen", "Fargo", 1996);
movies.create("Joel Coen", "The Big Lebowski", 1998);
Collection&lt;Movie&gt; list = movies.findAll();
assertEquals("Collection.size()", 3, list.size());
for (Movie movie : list) {
movies.remove(movie.getPrimaryKey());
}
assertEquals("Movies.findAll()", 0, movies.findAll().size());
}
}
</code></pre>
<h1>Running</h1>
<pre><code>-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.cmp2.MoviesTest
Apache OpenEJB 4.0.0-beta-1 build: 20111002-04:06
http://tomee.apache.org/
INFO - openejb.home = /Users/dblevins/examples/simple-cmp2/target
INFO - openejb.base = /Users/dblevins/examples/simple-cmp2/target
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=movieDatabaseUnmanaged, type=Resource, provider-id=Default JDBC Database)
INFO - Configuring Service(id=movieDatabase, type=Resource, provider-id=Default JDBC Database)
INFO - Found EjbModule in classpath: /Users/dblevins/examples/simple-cmp2/target/classes
INFO - Beginning load: /Users/dblevins/examples/simple-cmp2/target/classes
INFO - Configuring enterprise application: /Users/dblevins/examples/simple-cmp2/target/classpath.ear
INFO - Configuring Service(id=Default CMP Container, type=Container, provider-id=Default CMP Container)
INFO - Auto-creating a container for bean MovieBean: Container(type=CMP_ENTITY, id=Default CMP Container)
INFO - Configuring PersistenceUnit(name=cmp)
INFO - Adjusting PersistenceUnit cmp &lt;jta-data-source&gt; to Resource ID 'movieDatabase' from 'null'
INFO - Adjusting PersistenceUnit cmp &lt;non-jta-data-source&gt; to Resource ID 'movieDatabaseUnmanaged' from 'null'
INFO - Enterprise application "/Users/dblevins/examples/simple-cmp2/target/classpath.ear" loaded.
INFO - Assembling app: /Users/dblevins/examples/simple-cmp2/target/classpath.ear
INFO - PersistenceUnit(name=cmp, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 160ms
INFO - Jndi(name=MovieBeanLocalHome) --&gt; Ejb(deployment-id=MovieBean)
INFO - Jndi(name=global/classpath.ear/simple-cmp2/MovieBean!org.superbiz.cmp2.Movies) --&gt; Ejb(deployment-id=MovieBean)
INFO - Jndi(name=global/classpath.ear/simple-cmp2/MovieBean) --&gt; Ejb(deployment-id=MovieBean)
INFO - Created Ejb(deployment-id=MovieBean, ejb-name=MovieBean, container=Default CMP Container)
INFO - Started Ejb(deployment-id=MovieBean, ejb-name=MovieBean, container=Default CMP Container)
INFO - Deployed Application(path=/Users/dblevins/examples/simple-cmp2/target/classpath.ear)
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.919 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
</code></pre>
<h1>CMP2 to JPA</h1>
<p>As mentioned OpenEJB will implement the abstract CMP2 <code>EntityBean</code> as a JPA <code>@Entity</code>, create a <code>persistence.xml</code> file and convert all <code>ejb-jar.xml</code> mapping and queries to
a JPA <code>entity-mappings.xml</code> file.</p>
<p>Both of these files will be written to disk by setting the system property <code>openejb.descriptors.output</code> to <code>true</code>. In the testcase
above, this can be done via the <code>InitialContext</code> parameters via code like this:</p>
<pre><code>Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.core.LocalInitialContextFactory");
// setup the data sources as usual...
// write the generated descriptors
p.put("openejb.descriptors.output", "true");
Context context = new InitialContext(p);
</code></pre>
<p>Below are the generated <code>persistence.xml</code> and <code>mapping.xml</code> files for our CMP2 <code>EntityBean</code></p>
<h2>CMP2 to JPA generated persistence.xml file</h2>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"&gt;
&lt;persistence-unit name="cmp" transaction-type="JTA"&gt;
&lt;jta-data-source&gt;movieDatabase&lt;/jta-data-source&gt;
&lt;non-jta-data-source&gt;movieDatabaseUnmanaged&lt;/non-jta-data-source&gt;
&lt;mapping-file&gt;META-INF/openejb-cmp-generated-orm.xml&lt;/mapping-file&gt;
&lt;class&gt;openejb.org.superbiz.cmp2.MovieBean&lt;/class&gt;
&lt;properties&gt;
&lt;property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true, Indexes=false, IgnoreErrors=true)"/&gt;
&lt;property name="openjpa.Log" value="DefaultLevel=INFO"/&gt;
&lt;/properties&gt;
&lt;/persistence-unit&gt;
&lt;/persistence&gt;
</code></pre>
<p>All of this <code>persitence.xml</code> can be changed, however the <code>persistence-unit</code> must have the <code>name</code> fixed to <code>cmp</code>.</p>
<h2>CMP2 to JPA generated mapping file</h2>
<p>Note that the <code>persistence.xml</code> above refers to this mappings file as <code>META-INF/openejb-cmp-generated-orm.xml</code>. It is possible
to rename this file to whatever name you prefer, just make sure to update the <code>&lt;mapping-file&gt;</code> element of the <code>cmp</code> persistence unit
accordingly.</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
&lt;entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0"&gt;
&lt;entity class="openejb.org.superbiz.cmp2.MovieBean" name="MovieBean"&gt;
&lt;description&gt;simple-cmp2#MovieBean&lt;/description&gt;
&lt;table/&gt;
&lt;named-query name="MovieBean.findByDirector(java.lang.String)"&gt;
&lt;query&gt;SELECT m FROM MovieBean m WHERE m.director = ?1&lt;/query&gt;
&lt;/named-query&gt;
&lt;named-query name="MovieBean.findAll"&gt;
&lt;query&gt;SELECT m FROM MovieBean as m&lt;/query&gt;
&lt;/named-query&gt;
&lt;attributes&gt;
&lt;id name="id"&gt;
&lt;generated-value strategy="IDENTITY"/&gt;
&lt;/id&gt;
&lt;basic name="director"/&gt;
&lt;basic name="year"/&gt;
&lt;basic name="title"/&gt;
&lt;/attributes&gt;
&lt;/entity&gt;
&lt;/entity-mappings&gt;
</code></pre>
<div class="page-header">&nbsp;</div>
<h4>APIs Used</h4>
<ul><li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/CreateException.html">javax.ejb.CreateException</a></li>
<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/EntityBean.html">javax.ejb.EntityBean</a></li>
<li><a href="http://docs.oracle.com/javaee/6/api/javax/ejb/FinderException.html">javax.ejb.FinderException</a></li>
<li><a href="http://docs.oracle.com/javaee/6/api/javax/naming/Context.html">javax.naming.Context</a></li>
<li><a href="http://docs.oracle.com/javaee/6/api/javax/naming/InitialContext.html">javax.naming.InitialContext</a></li>
</ul>
<h3>Source</h3>
<ul>
<li>Apache <a href="http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/simple-cmp2">simple-cmp2</a></li>
<li>Github <a href="https://github.com/apache/tomee/tree/trunk/examples/simple-cmp2">simple-cmp2</a></li>
</ul>
<pre>
svn co http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/simple-cmp2
cd simple-cmp2
mvn clean install
</pre>
<div id="edit" class="modal hide fade in" style="display: none; ">
<div class="modal-header">
<a class="close" data-dismiss="modal">x</a>
<h3>Thank you for contributing to the documentation!</h3>
</div>
<div class="modal-body">
<h4>Any help with the documentation is greatly appreciated.</h4>
<p>All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)</p>
<small>NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.</small>
<!--[if gt IE 6]>
<h4>Internet Explorer Users</h4>
<p>If you are not an Apache committer, click the Yes link and enter a <i>anonymous</i> for the username and leave the password empty</p>
<![endif]-->
</div>
<div class="modal-footer">
Do you have an Apache ID?
<a href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))" class="btn">Yes</a>
<a href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))" class="btn">No</a>
</div>
</div>
<script src="./../../resources/js/bootstrap-modal.js"></script>
<footer>
<p>Copyright &copy; 1999-2016 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
Apache TomEE, TomEE, Apache, the Apache feather logo, and the Apache TomEE project logo are trademarks of The Apache Software Foundation.
All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p>
</footer>
</div> <!-- /container -->
<!-- Javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./../../resources/js/bootstrap-dropdown.js"></script>
</body>
</html>