![]() The JSP editor will work fine, including autocompletion. Type MavenPlatformWordApp for the Project Name and set the Project Location. Select Maven NetBeans Application from the Maven category. Choose File > New Project (Ctrl-Shift-N) to open the New Project wizard. Now you can start writing your actual code. Perform the following steps to create the NetBeans Platform application using the New Project wizard. This tells Maven that the libraries are needed to compile, but neither them nor their dependencies should not be added to the war. To all the libraries you just added manually to Maven. To do this, we have to change the scope of the libraries. We don’t actually need the libraries to be bundled in the war since the container is going to provide them. Now, there’s one more thing we need to do. Now your pom.xml should look something like this: Now going back to your index.jsp, all the errors should be gone (it sometimes takes a few seconds to disappear – I usually add and remove a space to force recompilation of the page). The taglib is actually in faces-impl but faces-api is also needed. ![]() Look for ‘javax.faces’ in the maven repository browser and add ‘faces-api’ and ‘faces-impl’. ![]() It sets the right webapp version (2.5) and configures JSF.Īlso don’t forget to add the necessary libraries in maven. The default one from the maven template looks like this:Ĭhange it to the following. The second is a little more subtle: we want to use JSF but if you go to the project properties, under “Run”, no matter what’s your application server, NetBeans won’t let you change the J2EE version.Ĭhange the webapp tag in this way. First one should be obvious given the previous one: we didn’t add the j2EE libraries to the maven project. Add as dependency ‘servlet-api’ (right click on the version of your choice and choose “add as dependency to”, then pick your project from the list). Use the Maven Repository Browser ( Window|Other|Maven Repository Browser), click on the ‘search’ icon and search for rvet. This happens because the NetBeans maven template doesn’t automatically add the J2EE libraries to your classpath. Servlet API classes are not in the classpath, some scriplets editing features are disabled. The first Problem I encountered was that in JSP pages autocompletion was not being recognized. I created a new project using the Maven WebApp archetype. If you don’t know how to do that, be sure to check the NetBeans Maven Best Practices Installing section. One combination that was not working for me was the following:įirst of all, you need the Maven support plugin installed in NetBeans. En el caso de Netbeans, puedes optar por actualizar Netbeans a la version 11 (que viene con Maven 3. ![]() And of course, we expect IDEs to happily support any combination of the above choices. Last but not least, you can also pick different building tools (abt, maven…). You have also to choose the container (tomcat, glassfish, jboss…). 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.). Today’s rich IDEs make a lot of tasks easier…usually. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |