3 ms·
The author links to a page that's not accessible. The google cache shows this page: http://webcache.googleusercontent.com/search?q=cache:3cGnLJFTP3gJ:www.adam-
by mgkimsal 16y ago
The author links to a page that's not accessible. The google cache shows this page:
http://webcache.googleusercontent.com/search?q=cache:3cGnLJFTP3gJ:www.adam-bien.com/roller/abien/entry/simplest_possible_ejb_3_1+http://www.adam-bien.com/roller/abien/entry/simplest_possible_ejb_3_1&cd=1&hl=en&ct=clnk&gl=us http://webcache.googleusercontent.com/search?q=cache:3cGnLJF...
copy/paste from the link above
=================
@Stateless
public class SimpleSample {
public void doSomething() { /*business logic*/ }
}
How to compile:
You will need the the EJB 3.0 / 3.1 API in the classpath, or at least the @Stateless annotation.
How to deploy:
Just JAR the class and put the JAR into e.g: [glassfishv3-prelude-b23]\glassfish\domains\domain1\autodeploy
How to use:
e.g.:
import javax.ejb.EJB;
public class MyServlet extends HttpServlet{
@EJB
private SimpleSample sample;
}
And: there is no XML, strange configuration, libraries, additional frameworks or jars needed...
=================
Looks a slight bit more than 1 line to me. Note: the page was linked to from another page indicating you can do 'hello world' in JEE6 in 'one line' of code. Java people have a funny way of counting lines sometimes.
- drtse4 16y agoHe should have left out that "exactly". The main point is something he highlights at the beginning, J2EE was the triumph of configuration over convention, it had a lot of xml descriptors and interfaces/utility classes to be implemented (this caused by the some architectural decisions that remind me of CORBA). This stuff was usually auto-generated but you still often had to tweak these file manually. The polar opposite of modern web frameworks.