The NetBeans IDE can be used to help write and troubleshoot inline Java JSP code using within Extension modules in assemblies.

The IDE features autocompletion and code analysis that can help find common coding errors.

To install and configure NetBeans for Java JSP development:

Download and install the NetBeans Java EE version from https://netbeans.org/downloads/index.html

Launch NetBeans and install the FindBugs plugin:

1. Enable the plugin "FindBugs Integration”, from the main menu choose "Tools –> Plugins" -> "Available Plugins"

2. Select "FindBugs Integration" and click "Install"

3. Make sure you can use FindBugs.  From the main menu choose "Source" -> "Inspect" -> Choose Configuration "FindBugs"

4. Click "Inspect" (It might download some updates)

Create a new project.  From the main menu choose “File” -> “New Project”.  Highlight the “Java Web” category and select “Web Application”.  Accept the remaining defaults.

Open the project, open the Web Pages folder, right click on it and choose “New” -> “JSP”

Right click on the WEB-INF folder in the project and choose “Tools” -> “Show in Finder”

Replace the opened WEB-INF folder with the APIANT system’s.  Obtain the APIANT system’s WEB-INF folder by contacting robert@apiant.com

From the main menu, choose “Source” -> “Scan for external changes”

Right click on Libraries and choose “Add JAR/Folder”

Navigate to the project’s WEB-INF folder, select the “classes” folder, and click the “Choose” button

Repeat by right-clicking on Libraries and choosing “Add JAR/Folder”.  Navigate to the project’s WEB-INF/lib folder, select all JAR files and click the “Choose” button

Edit the newjsp.jsp file, paste in some inlined JSP code from an assembly, and save

The editor will highlight code errors as you edit the code.

When done coding, save your changes, right-click on newjsp.jsp in the project and choose “Compile File”

Open the “Files” tab and open “WebApplication1” -> “build” -> “generated” -> “src” -> “org” -> “apache” -> “jsp” -> “newjsp_jsp.java”

This is the precompiled Java code resulting from the JSP compilation.

From the main menu, choose “Source” -> “Inspect”

Click the Inspect button to analyze the Java code.  The results will appear at the bottom:

You can now repeat the process of editing the JSP code, recompiling, and inspecting the results of the compiled Java code in order to troubleshoot coding bugs.

Did this answer your question?