Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

7.17.2007

To PHP5 or not to PHP5

I consider myself an Open Source Developer but I very rarely develop for the open source community. I create apps for businesses, where I work, and some side projects. I share code with those I work with obviously, but generally not with the PHP community as a whole. I share some items on this site that I think are helpful to people.

I'm not sure yet where I stand on the goPHP5 movement. I tend to use PHP5 on my newer development but still have to use PHP4 for legacy stuff. And by "legacy," I'm talking internet time here, so about 4 years is "legacy."

I'd like most of the common PHP apps to move to PHP5. I've got some PHP5 Wordpress plugins in my code repo right now. And heaven knows that Drupal could really use PHP5 (or even the namespace support in PHP6). But I think forcing their hand is a little harsh.

Photo Matt isn't moving Wordpress towards a PHP5 model any time soon. And this is a bummer. But I understand the point of not leaving users of your product in the dust. I don't really have that problem with my code.

As for my opinion, I feel like learning PHP5 was one of the best things I've done in my career. It helped the other object-oriented languages like Java and C# to seep into my head a little bit more. Knowing more then one language is always a good thing.

I love the object model in PHP5, as well as PDO, and the JSON extension is nice. But I find that I use the improved DOM handling of XML in PHP5 the most. It still really shocks me that more people aren't interested in using this. And it still shocks me that more people aren't interested in using XSLT and PHP.

5.08.2006

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.