This post originated from an RSS feed registered with Java Buzz
by Norman Richards.
Original Post: "Hello, J2EE" in 2 minutes for OS X
Feed Title: Orb [norman richards]
Feed URL: http://members.capmac.org/~orb/blog.cgi/tech/java?flav=rss
Feed Description: Monkey number 312,978,199
It actually turns out that Apple provides pretty good Hello World
support in Xcode, which is available to anyone who has upgraded to
10.3. Here is how to get Hello World going in about 2 minutes on any
10.3 box without using anything but the standard dev tools. (I'm not
counting the time to install Xcode here. That may take 5-10
additional minutes)
Install XCode off the 10.3 developer CD. Make sure you
get the J2EE components which includes JBoss, Ant and XDoclet.
Launch Xcode and create a new "Web Module" called "helloworld".
You will notice that Xcode starts you off with a simple HelloWorld
servlet and a complete web application build.
Start JBoss. (run /Library/JBoss/3.2/bin/run.sh)
Press the build button in the IDE. Keep an eye on the JBoss
window and you should see the
Go to http://localhost:8080/helloworld/servlet/HelloWorld
To change the "Hello World!" message to "Hello, World!" (as per
the challenge) , go to the HellowWorldServlet.java file in your src
directory. Change line 69 of the servlet to include the comma in
the text.
Press the "build" button again and wait for the application to
deploy. When it does, reload the web page and you will see your
new message.
Ok, that wasn't very painful, was it? Obviously one doesn't need
a servlet to do Hello, World. But, Apple provides it as a placeholder
to illustrate how to do a servlet. Note the seemless XDoclet
integration which eliminates the need to do any deployment
descriptors. Nice! There's also a Hello, World EJB sample as well as
a combined "Enterprise Application" containing both the web and ejb
code in one project. Click and go.
Xcode isn't my preferred J2EE development evironment, but if
someone wants to get a web or EJB app up quickly on OS X, I can't
think of a quicker less hassle option.