Monthly Archives: May 2007

Add external deployable files to Java EE projects on netbeans

Ever wondered how you’d deploy external CSS/JavaScript with servlets or JSPs?
This article will guide you on how to add a CSS/JavaScript (.css, .js) or any file in your project so that it gets inside your .WAR file too!

Here’s how to:

1) Start your netbeans: I am using 5.5
2) Goto Tools>Template Manager
3) Select or Expand “Other”
4) Click “Add…” and select the file which you want to include.
5) After selecting the file will appear in your “Others” list
6) In your project navigator, add a new file of this type.
7) Give a name to this file and feel excited!

Netbeans – My Favorite IDE

Netbeans is my favourite IDE when it comes to Java. Although its too slow but the way it arranges stuff for me is quite COOL!

Some facts that I have noticed so far:

1. It takes request from doGet or doPost and sends it to another method. So it doesn’t matter if the parameters come from GET or POST, you simple work with them! (Really cool for beginners)

2. It creates a dist directory for each project which means you don’t have to explicitly make any such deployment folder. You’ll never want a WAR file unless really required. Just copy the contents of this folder and paste it to your deployment folder.

3. It has also got this feature of starting and stopping the bundled Apache Tomcat server as and when required. You can even configure server’s port with a GUI which netbeans provides.

4. Netbeans mobility pack is just so awesome. Just drag and drop all basic components(reminds me of VB6).

5. Netbeans generates codes for such UML style drag drop behind the scene. Its got this wonderful feature called as Lazy Initialized. This feature is a coding style where the main thread will not initialize all the form elements instead call methods as an when the form/component is required.
I personally find this very interesting as when I program in J2ME, Its really good to initialize the forms as and when the user needs them. For example: Why would you initialize a form which contains About & Version infomation. It will use up unnecessary space if that form was never visited!

6. Netbeans can also adhere to different Mobile environments and JDKs. For example, If you have a Black Berry’s JDE installed, you can make netbeans to compile/run/use Black Berry’s APIs. Which means you work with your favourite editor even if the platforms differ.
My Netbeans is configured with mobility pack which has configured sun’s WTK 2.2, Black Berry JDE 4.1 & JDE 4.2.

7. If you’re connected to the internet, netbeans’ welcome page displays latest happennings with Blogs, articiles posted daily. I always make a point to check out whats the latest there!

8. The overall look and feel is quite good. I have been using it since v.4.x and it has improved a lot.

Although Netbeans is slow(Tell me which one is not!), I’ll still give it preference over any other IDE available for the complete Java Technology I.e Java SE, Java EE and Java ME platform. I wont give preference to Eclipse (from where netbeans has derived!).