JSP to PHP and Back Again (with Netbeans)

Several years ago, I worked at a dotcom start-up working on JSP templates for an ATG system. I’ve dabbled in Java on and off for a few years, but I’ve mostly worked with PHP. Well, now I have a few projects at work coming up that require me to do some Java / JSP web development so I’ve been diving into everything there is that world.

Needless to say, the Java / JSP landscape has changed quite a bit since the year 2000.

I’ve mainly been concentrating my efforts right now on Tomcat. So I’ve started using Netbeans which has a bundled version of Tomcat. Pretty cool stuff. However, there’s quite a few things missing from the Netbeans tutorials.

Frustration # 1

When I launched a basic JSP page, I kept receiving the message: “Starting of tomcat failed, the server port 8084 is already in use

I thought maybe it was Apache so I shut that down. Then I shutdown Mysql, Postgresql and Oracle express (I like databases). Still nothing. Hmm… it worked at the office, but now not at home. What’s the difference? Ahh… the Norton firewall stuff. Once I disabled that, we were good to go. So, instead of leaving Norton off, I finally added the Tomcat ports (8084, 8081, and 8025) to the Norton rules.

Frustration # 2

When running the “Getting Started” Netbeans tutorial… about the second thing they have you do is to run a simple JSP page, but one that uses JSTL 1.1. When creating a new web app project, Netbeans creates an index.jsp file with some JSTL stuff in it. It's commented out but it's just begging to be played with. I thought this was kind of like going to med school and performing brain surgery your first day. But anyway, I uncommented the lines.

When attempting this, I received two main errors:

org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class

The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved

After several minutes of searching, I realized, that you have to add the Tag Library within Netbeans to get this tutorial to work. You’d think they would just tell you that… and tell you how. Big strike agains Sun right there for me.

Anyway, you add the library like this:

  • Go to the properties of your project
  • go to library
  • add library
  • jstl 1.1
  • save
  • then run

Now to work up some basic CRUD functionality with MySQL. More notes as I discover and untangle my frustrations.

No comments:

Post a Comment