Bhavik Ambani
Bhavik Ambani

Reputation: 6657

Compile JSP (check syntactical error in JSP)

I have 1000 to 1200 JSP files in my project, and I want to check whether there is any syntactical error in those JSP files or not. So how can I check whether there are any error in JSP or not? Is there any way of compiling those JSPs?

Upvotes: 9

Views: 11576

Answers (3)

JB Nizet
JB Nizet

Reputation: 692231

Most of the application servers come with a JSP compiler that allows pre-compiling JSP files. The documentation of JspC, the Tomcat JSP compiler is in Jasper 2 JSP Engine How To. I also used WebLogic's JSP compiler in the past.

Note that, even if you don't use Tomcat, you could use this compiler just to check that your JSP files compile. If they compile with Tomcat, they should compile with your container.

Upvotes: 3

Blade Master
Blade Master

Reputation: 157

If you are using the Eclipse development, you can open JSP files with JSP EDIT. It's checking your JSP files for syntactical errors.

Upvotes: 1

Ramesh PVK
Ramesh PVK

Reputation: 15456

Every application server provides a copy of JSP pre-compilation tools. This utility translates the JSP into corresponding servlets .java files.

Some of them provide these tools as Ant tasks which you can use while building your web application using Ant. And some of them provide it as an executable which you have to run explicitly.

Look at the below for more information about these tools:

Upvotes: 3

Related Questions