Peahen

I finally got it together and learned the Java web stuff. It took a long time for me to get things working, but now I’ve finally figured it out.

I battled a lot with Tomcat – some tweaks to the startup script and a lot of Google digging helped in a huge way. Don’t forget to uncomment the invoker servlet!

Once I had written some servlets and started running them, it dawned on me how ‘close to the protocol’ you can get with this tech.

Next step was to start checking out frameworks. Of course MVC is all the rage, so I made sure to check out Struts

Struts is an interesting beast. Once you’ve built web apps for a while, you tend to start re-solving a lot of old problems. The frameworks usually offer a structured way to handle sessions, user auth, and data input validation in a consistent way.

There are some elements of Struts which look appealing, but I can’t say I like the look of the JSP view templates – perhaps I should check out Velocity or Freemarker instead.

All this flexibility comes with a moderate complexity tradeoff. Unlike ASP.NET, which offers you ‘The Right Way’ to do things, the possibilities are quite open on the Java side of things.

Anyway, here’s my tips for a budding Java web guy:

1: Get familiar with the servlet container. You will see all sorts of examples on how to write a servlet, but very few on how to run em’. Read those docs. You’re gonna play admin anyway.

2: Master setting Environment variables on your system. You will need to set these constantly unless you get it straight.

3: Learn the ‘manual way’ before letting tools do it for you. Before you whip out Eclipse and Ant it helps to understand how it’s SUPPOSED to work ;-)

Leave a Reply