Search |
||
Worst ever Java EE 6 BlogPosted by ludo on May 25, 2009 at 9:09 PM PDT
Bonjour, comment Java?
I'm preparing some Java EE 6 JavaOne demos. While doing that, I was thinking: how can I compress most of the Java EE 6 technology inside *one* single Java Class? If you are my manager, stop reading now... If you believe you are an architect, stop reading now... If you are a member of the Java Blueprints team, stop reading now... If you are a regular java blog reader, stop reading now... The following code is PG 40. Talk to you parents if you are less than 40. Still reading? Not sure why, but here we go. The following Java EE 6 compliant Application is a Web Application with just 2 source files: MonsterServlet.java and persistence.xml. It demonstrates the following Java EE 6 features:
package monster;And the persistence.xml to put in the WEB-INF/classes/META-INF directory of this Web Application <?xml version="1.0" encoding="UTF-8"?> This Web Application can be deployed as it to the latest builds of GlassFish v3. The page output is something like: In Servlet calling the EJB side BusinessMethod from EJB[monster.MonsterServlet@5718c3a7] Contraint Violation: must be less than or equal to 2 Now the quiz:
Still reading? Now I have just corrupted your brain: while not recommended, it is possible to write a 3-tier Java EE 6 Application with Servlets, EJBs, JPAs, Beans Validation in one single Java class and one single xml file... Can't wait for Java EE 7 when persistence.xml will become optional:-) See you at JavaOne. You can now forget this blog. Someone had to write it. It's over now:-) Ludo »
Related Topics >>
Java Enterprise Comments
Comments are listed in date ascending order (oldest first)
Submitted by caroljmcdonald on Fri, 2009-05-29 11:54.
les Francais sont drole ;)
well, you can be releasing
Submitted by abbeysen92 on Mon, 2009-09-07 12:53.
well, you can be releasing Java ME Platform SDK 10.0 for all i thesis | online thesis | how to write thesis | thesis writing care but where is the mac and linux support that people have been wanting for years?
thesis help | custom thesis | buy thesis | theses
Submitted by kawazu on Mon, 2009-05-25 23:40.
PG40? Oh well... I still like it. Asides not being recommended, I think this is pretty good an example and very well worth being spread around, as it surely addresses one of the usual "Java EE myths" ("there is loads and loads of source and XML files to be written even to achieve simple functionality"). Good shot. ;>
K.
Submitted by felipegaucho on Tue, 2009-05-26 00:49.
since you are injecting the EJB, any method using the "monsterEJB" reference will not be thread safe...
for me, this is the only pending oddity of Java EE..
and if you include the @Singleton annotation, goodbye scalability :)
Submitted by varan on Tue, 2009-05-26 09:24.
The servlet code is a disaster - unfit for human viewing even by the bravest of souls.
Submitted by sfermigier on Thu, 2009-05-28 00:26.
Crappy code formatting doesn't improve readability either.
good
Submitted by rttttttttttttt on Thu, 2009-09-17 23:23.
thanks providing such information
Research Paper
Re;
Submitted by eoinmorgan on Sat, 2009-10-10 03:20.
Re;
Submitted by eoinmorgan on Sat, 2009-10-10 03:42.
java is my favorite
Submitted by design5 on Wed, 2009-11-25 11:12.
java is my favorite programming language since it is platform independent.this web is very good for a beginner.
frm
caser
phentermine 37.5
|
||
|
|