Dashboard > Community Wiki > ... > Working with Magnolia + Glassfish + Netbeans > configure netbeans for JSP coding
configure netbeans for JSP coding Log In View a printable version of the current page.

Added by joshua portway , last edited by joshua portway on May 30, 2008  (view change)
Labels: 

If you've followed my tutorial to set up netbeans to work on your Magnolia Maven project, you're probably ready to start work writing JSP pages for your templates. Netbeans will do code completion and show documentation to you while you're editing JSP pages, but it needs to be able to find your tag libraries to do it. If you are going to use the Magnolia Tag libraries (which, presumably, you are) you'll have to declare dependencies on them in the project.

The next couple of steps show how to declare the dependencies using the Netbeans GUI - unfortunately, the Magnolia Maven repository isn't currently indexed, so you will only be able to use the repository browser to add Magnolia modules if they are already in your local repository. This means that before doing this next step you will probably have to download and build Magnolia. If you don't want to have to build locally then you can just edit the project POM file by hand. Hopefully the Magnolia project will start indexing their Maven repository at some point so that repository browsers can work with it.

Go to the "Windows" menu and select the "Maven 2 repository browser" option. A new pane should appear on the left hand side of your netbeans workspace. It'll look something like this :

The browser window lets you browse any maven repositories that you have mounted - but since there are so many Maven projects available, browsing is a little intimidating. Click the little magnifying glass cion on the brwser and a search window will appear. Type "magnolia" into the search window and hit return. Now you should see a list of all the magnolia projects - expand the magnolia-taglib-cms project and you should see a list of the versions of the tag library that are available.

Right click on the latest one and choose "Add as dependency to..." as shown in the picture.

A dialog will appear showing all your open maven projects - just select the project and that's it. Do the same for the Magnolia utility tagblib and switch back to your project view. Your project should now show the two taglibs in the "Libraries" section, as below.

To get code completeion working you may now need to build your project (to ensure the jars have been downloaded by maven) and possibly even open and close the project (Netbeans seems to have some issues picking up the jars on the classpath when they are first added). Once you've done that you should have code completion available for your Magnolia tag library, as below :

Powered by a free Atlassian Confluence Open Source Project License granted to Magnolia International. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators