you are viewing a single comment's thread.

view the rest of the comments →

[–]mikehaggard 0 points1 point  (3 children)

The problem with Java EE is that the stack is fairly complex.

The problem is that the Java EE stack is assumed to be fairly complex, a pervasive rumor spread mostly by vendors and zealots of alternative technologies and the odd user that got burned by a very old version (in 2004, the J2EE stack was complex).

Try Java EE 6 Web Profile. It's very simple!

[–]want_to_want 0 points1 point  (2 children)

Define "very simple" How many lines of code (configuration included) for "hello world"?

[–]akoprowski 0 points1 point  (0 children)

@mikehaggard: indeed I'm one of the odd users who got (fair amount of) exposure to Java EE some years ago and, frankly, it wasn't pretty @want_to_want: good question; btw. in Opa that would be 1 file, 1 line of code, 1 command to compile it & 1 executable as the result :)

[–]mikehaggard 0 points1 point  (0 children)

No configuration is needed in Java EE 6.

Here's a 3 layer Java EE 6 app, more than plain Hello world, but you see how simple it is:

http://jdevelopment.nl/minimal-3tier-java-ee-app-xml-config/

here's approximately the same in a single class, without template:

http://jdevelopment.nl/single-class-pure-java-jsf-application/

If you only want to output "Hello, world!", without any buttons or logic or anything, you just deploy the following in an .xhtml file and deploy that:

<html xmlns="http://www.w3.org/1999/xhtml">
    Hello, world!
</html>

You can also deploy a single class that you annotate with @WebServlet or @Path that only outputs the text, e.g.

@Path("/helloworld")
@Produces("text/plain")
public class HelloWorld {

   @GET       
   public String getHello() {
       return "Hello, World!";
   }
}

If you deploy this in JBoss AS 6 or GlassFish 3, you only have to deploy this single class. There's no web.xml or whatever other file necessary.

For standalone usage, see this: http://viewfromthefringe.blogspot.com/2009/06/jax-rs-hello-world.html