| <!DOCTYPE html> |
| |
| |
| <!-- |
| | Generated by Apache Maven Doxia Site Renderer 2.0.0 from src/site/xdoc/j2ee-integration.xml at 10 Sep 2025 |
| | Rendered using Apache Maven Fluido Skin 2.1.0 |
| --> |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
| <head> |
| <meta charset="UTF-8" /> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0" /> |
| <title>J2EE Integration – Apache Turbine</title> |
| <link rel="stylesheet" href="./css/apache-maven-fluido-2.1.0.min.css" /> |
| <link rel="stylesheet" href="./css/site.css" /> |
| <link rel="stylesheet" href="./css/print.css" media="print" /> |
| <script src="./js/apache-maven-fluido-2.1.0.min.js"></script> |
| <link rel="icon" type="image/png" sizes="48x48" href="https://apache.org/favicons/favicon.ico"> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <style>.github-fork-ribbon:before { background-color: orange; }</style> |
| </head> |
| <body> |
| <a class="github-fork-ribbon right-top" href="https://github.com/apache/turbine-build" data-ribbon="Fork me on GitHub">Fork me on GitHub</a> |
| <div class="container-fluid container-fluid-top"> |
| <header> |
| <div id="banner"> |
| <div class="pull-left"><div id="bannerLeft"><h1><a href="https://turbine.apache.org/"><img src="https://www.apache.org/img/feather_glyph_notm.png" style="width: 50px;" /> The Apache Turbine project</a></h1></div></div> |
| <div class="pull-right"><div id="bannerRight"><h1><a href="https://turbine.apache.org/"><img src="https://turbine.apache.org/images/logo.gif" alt="Apache Turbine" /></a></h1></div></div> |
| <div class="clear"><hr/></div> |
| </div> |
| |
| <div id="breadcrumbs"> |
| <ul class="breadcrumb"> |
| <li id="publishDate">Last Published: 01 Apr 2025<span class="divider">|</span> |
| </li> |
| <li id="projectVersion">Version: 7.1-SNAPSHOT</li> |
| <li class="pull-right"><span class="divider">|</span> |
| <a href="https://turbine.apache.org/fulcrum/">Fulcrum</a></li> |
| <li class="pull-right"><span class="divider">|</span> |
| <a href="https://turbine.apache.org/">Turbine</a></li> |
| <li class="pull-right"><a href="https://www.apache.org">Apache</a></li> |
| </ul> |
| </div> |
| </header> |
| <div class="row-fluid"> |
| <header id="leftColumn" class="span2"> |
| <nav class="well sidebar-nav"> |
| <ul class="nav nav-list"> |
| <li class="nav-header">General Information</li> |
| <li><a href="index.html">Overview</a></li> |
| <li><a href="features.html">Features</a></li> |
| <li><a href="fsd.html">Specification</a></li> |
| <li><a href="getting-started.html">Getting Started</a></li> |
| <li><a href="how-to-build.html">Howto Build Turbine</a></li> |
| <li><a href="changes-report.html">Changes</a></li> |
| <li class="nav-header">Documentation</li> |
| <li><a href="services/index.html"><span class="icon-chevron-right"></span>Services</a></li> |
| <li><a href="howto/index.html"><span class="icon-chevron-right"></span>Howtos</a></li> |
| <li><a href="https://cwiki.apache.org/confluence/display/TURBINE">Wiki</a></li> |
| <li><a href="apidocs/index.html">JavaDocs</a></li> |
| <li class="nav-header">Development</li> |
| <li><a href="proposals.html">Proposals</a></li> |
| <li><a href="how-to-help.html">How To Help</a></li> |
| <li><a href="todo.html">Todo</a></li> |
| <li class="nav-header">Project Documentation</li> |
| <li><a href="project-info.html"><span class="icon-chevron-right"></span>Project Information</a></li> |
| <li><a href="project-reports.html"><span class="icon-chevron-right"></span>Project Reports</a></li> |
| <li class="nav-header">Apache</li> |
| <li><a href="https://www.apache.org/">Apache Website</a></li> |
| <li><a href="https://www.apache.org/licenses/">License</a></li> |
| <li><a href="https://www.apache.org/foundation/how-it-works.html">How the ASF works</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li><a href="https://www.apache.org/security/">Security</a></li> |
| </ul> |
| </nav> |
| <div class="well sidebar-nav"> |
| <form id="search-form" action="https://www.google.com/search" method="get" > |
| <input value="http://turbine.apache.org/turbine/turbine-7-0" name="sitesearch" type="hidden" /> |
| <input class="search-query" name="q" id="query" type="text" placeholder="Search with Google..." /> |
| </form> |
| <div id="poweredBy"> |
| <div class="clear"></div> |
| <div class="clear"></div> |
| <a href="https://maven.apache.org/" class="builtBy" target="_blank"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a> |
| </div> |
| </div> |
| </header> |
| <main id="bodyColumn" class="span10"> |
| |
| |
| |
| |
| <section><a id="J2EE_Integration"></a> |
| <h1>J2EE Integration</h1> |
| |
| |
| <p> |
| This document serves to answer a few common questions about integration |
| of Turbine with J2EE technologies including Servlets, EJB, Swing, JMS, |
| Transactions, JNDI, XML, JDBC, JSP, and Security. The short answer is |
| that it is all Java code and you can choose to use Turbine's solutions |
| to some things or you can choose to use J2EE solutions to some things. |
| Turbine is increasingly flexible about what parts you choose to use and |
| what parts you don't. The reason is because there has been quite a lot |
| of de coupling of the various Turbine components as a result of years of |
| development and use by people all over the world in various different |
| ways. Wow, isn't that cool? |
| </p> |
| |
| <section><a id="How_does_Turbine_work_with_..._.3F"></a> |
| <h2>How does Turbine work with ... ?</h2> |
| |
| <table class="table table-striped"> |
| |
| <tr class="a"> |
| |
| <td>Servlets</td> |
| |
| <td> |
| |
| <p> |
| It is a servlet. It is also a set of re-usable components assembled into |
| a framework. You can choose to work with just the Servlet, you can |
| choose to work with just the components or you can choose to work with |
| both. In a lot of normal development cases, people start off with a |
| simple servlet and tack on various components (like Connection Pooling, |
| Cron Schedulers, User Management, Services, etc.). That is what we have |
| done as well, however we have done it in such a way that it is very |
| pluggable. Mix and match and use what you want to use. Ignore the rest. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td>EJB</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides a framework for developing web applications - |
| specifically the front end. EJB provides a framework for developing |
| n-tier applications - specifically the back ends - thus Turbine and EJB |
| complement each other well at that level. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td>Swing</td> |
| |
| <td> |
| |
| <p> |
| Turbine is the for the web - Swing is not - not applicable. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td>JMS</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides facilities for plugging in other Services - and thus |
| JMS could be plugged in as a service to that. Even if it isn't plugged |
| in through Turbine's Services facilities, you can still put your JMS |
| related methods into your code. Turbine doesn't prevent you from calling |
| other Java code. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td>Transactions</td> |
| |
| <td> |
| |
| <p> |
| There is nothing in Turbine explicitly using the JTS/JTA - but can use |
| EJB and hence these technologies. That belongs in EJB's anyways. :-) |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td>JNDI</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides access to JNDI via a Service facility. You can always |
| choose to implement your own facility as well (ie: if you have an |
| existing code base that you would like to use, Turbine does not stop you |
| from using it). |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td>XML</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides support for using and working with XML. Again, nothing |
| preventing you from using XML within Turbine or even sending XML out |
| of Turbine. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td>JDBC</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides good support for working with JDBC through the <a href="http://db.apache.org/torque/" class="externalLink">Village API</a>, the <a href="http://db.apache.org/torque/user-guide.html" class="externalLink"> |
| Torque Object Relational Tool</a> and its connection |
| pooling facilities. The connection pool is not yet fully J2EE |
| "compatible" in that it does not support DataSources. However, at some |
| point we may choose to implement that. Note, again, Turbine does not |
| prevent you from using your own Connection pooling mechanism, we simply |
| created one because at the time, we needed one and ours works just fine. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td>JSP</td> |
| |
| <td> |
| |
| <p> |
| Turbine provides excellent support for using JSP in its model of working |
| - which is based on the Model 2 style with enhancements, such as solving |
| the Action portion of the Model. However, we <a href="http://velocity.apache.org/ymtd/ymtd.html" class="externalLink">strongly |
| suggest</a> that you do not use JSP and seek out other alternatives. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="b"> |
| |
| <td>Security</td> |
| |
| <td> |
| |
| <p> |
| Turbine was created long before J2EE was created. Therefore, we needed |
| to implement our own Security Model. This model is based on Users, |
| Roles, Permissions and Object Groups. It is an Access Control List (ACL) |
| based security scheme and can grow to support nearly any level of access |
| control people can come up with. It follows our extensible design |
| pattern and you can use Turbine's code as the basis for any additional |
| security your application requires. |
| </p> |
| </td> |
| </tr> |
| |
| <tr class="a"> |
| |
| <td>Container Managed Security</td> |
| |
| <td> |
| |
| <p> |
| You can use container managed security if you wish, and Turbine provides you with |
| mechanism for application manged security, in case you need them. |
| </p> |
| |
| <p> |
| The main problem with container managed security is that it cannot be managed |
| from the inside of the application. Whenever you want to add/remove users to |
| your application (or suite of them) or want to modify user's roles, you need |
| to use whatever tool your application server provides for that. |
| </p> |
| |
| <p> |
| Now, this could work just fine for closed-public applications and intranets, |
| but would be really unacceptable on open-public sites, where the users need |
| the ability to register and receive 'accounts' without human interaction. |
| </p> |
| |
| <p> |
| Currently Turbine supports the latter model - application managed security. |
| This is because if it didn't have it, many people would have to write code |
| to provide it. That's why we created SecurityService in a cooperative effort. |
| </p> |
| |
| <p> |
| On the other hand, you don't need to write any code to use declarative |
| container managed security. You can restrict access to the Turbine |
| servlet with the usual web.xml magic. If you wish to use programmatic |
| container managed security code, there is relatively very little code to write. |
| You need to create your own SecureScreens (probably extending VelocityScreen) |
| and SecureActions that contained code that calls the <code>HttpServletRequest |
| getUserPrincipal</code> and <code>isUserInRole</code> methods. |
| above. |
| </p> |
| </td> |
| </tr> |
| </table> |
| </section> |
| |
| </section> |
| |
| |
| </main> |
| </div> |
| </div> |
| <hr/> |
| <footer> |
| <div class="container-fluid"> |
| <div class="row-fluid"> |
| <p>© 2000–2025 |
| <a href="https://www.apache.org/">The Apache Software Foundation</a> |
| </p> |
| </div> |
| </div> |
| </footer> |
| </body> |
| </html> |