You are here

Setting up a JSF Maven project in NetBeans (including working autocompletion for JSP/JSF)

Today's rich IDEs make a lot of tasks easier...usually. With Java and its IDEs you often end up spending more time than you anticipated to just set up a project, especially when dealing with the complexities of J2EE: there are multiple versions of the specifications 1.3,1.4,5.0), each one with multiple implementations by different vendors plus extensions (richfaces, struts, seam, spring..). You have also to choose the container (tomcat, glassfish, jboss...). Last but not least, you can also pick different building tools (abt, maven...). And of course, we expect IDEs to happily support any combination of the above choices.
One combination that was not working for me was the following:

  • NetBeans 6.5 IDE
  • Glassfish or JBoss
  • Maven
  • WebApp Archetype for Maven

First of all, you need the Maven support plugin installed in NetBeans. If you don't know how to do that, be sure to check the NetBeans Maven Best Practices Installing section.

I created a new project using the Maven WebApp archetype.
The first Problem I encountered was that in JSP pages autocompletion was not being recognized.

A simple page like this (index.jsp)








Hello World!

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.