Is a JSP project supposed to build correctly even with known errors?

I am participating in an on-going project at my university, and the project is developing a Blackboard building block. I am trying incorporate a build tool, among other tools for testing frameworks. In doing that, I am having to structure the project differently than just having JSP files. I have a utility project for Java files and a web project for the JSP files.

I have build files for each sub project and a build file for the project as a whole. The build file for the web project has the Java plugin from the over all project build file, the WAR plugin, and dependencies for the utility project compiling and javax.servlet. The web application will build without any problems, but that is the issue. No matter what Java errors I put into the JSP files, the project will always build correctly. Is there anything wrong with that? Should I be able to detect Java errors during a build? or is there something that I am missing?

Also note that I am looking at separating a lot of the Java code from the JSP files into Java files, so that the JSP is only using Java code to call data. So, a lot of the errors I would like to check would be easier to spot, but I still need to make sure of errors that could be made in the JSP files. If anything is confusing, please let me know and I will try to clarify. I am still getting used to discussing topic such as this one.

JSPs aren’t compiled by Gradle (at least not by default), they are compiled by the servlet container (ie. Tomcat, Jetty, etc). Moreso, they typically aren’t compiled until runtime (first accessed through a browser), however some containers allow pre-compilation of JSPs.

You might want to look at the Gradle tomcat plugin which has support for pre-compiling JSP using Jasper.

Thank you, I was a little confused as to how JSPs worked. Just so I know if I am understanding things correctly. The tomcat plugin will configure my project to work with tomcat, similar to the eclipse plugin which will configure the project to work with eclipse. Will I need to get tomcat to proceed further with the project? Also, is Jasper something that comes with working with tomcat, or is it something external that I need to setup?

This next part is more of a tomcat question, so I understand if you don’t, or can’t, answer it. How would you use tomcat with this project? The project is an individual tool, or web application, for a bigger page called Blackboard. Wouldn’t I have to deploy it as part of the web page, so when it makes certain calls that there is a server? Is mocking something that I should possibly incorporate, so that I have a better development environment?

Also, if I was wanting to use something like Robot Framework, using the Selenium2Library, could I achieve the same results? Or is this something different? I haven’t implemented Robot Framework in this way, so I am still not wholly sure of how Selenium works in Robot Framework. I do understand that it will open the browser to run the tests. Do you think I would come up with the same problems with calling the main Blackboard server? Also,I understand that this is pretty much a whole new question, so if I need to start a new question I can. Thank you for your help.

You don’t have to use the Tomcat plugin, nor do you have to precompile your JSP. I simply wanted you to understand why you weren’t seeing the errors as part of the Gradle build, but there are some options to compile JSPs ahead of time (although this is primarily done for performance reasons).

The Tomcat plugin will allow you to run an embedded Tomcat server, whereas the War plugin simply produces a WAR file that you would be responsible for deploying manually.

As far as specific integration with Blackboard, or any other framework, there are probably other communities online that can help you with that better.

Oh, ok I see what you are saying now. Thank you very much and you have been very helpful.