Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 206
Bhavik Ambani Avatar asked Jul 06 '12 05:07

Bhavik Ambani


People also ask

How JSP is compiled?

The JSP engine compiles the servlet into an executable class and forwards the original request to a servlet engine. A part of the web server called the servlet engine loads the Servlet class and executes it. During execution, the servlet produces an output in HTML format.

What is JSP compilation?

By default, the JavaServer Pages (JSP) engine translates a requested JSP file, compiles the . java file, and loads the compiled servlet into the run time environment.

Do we need to compile JSP?

jsp file is modified in the development environment, it must be compiled before being invoked in the client. The steps you must follow to enable dynamic compilation of a JSP file are as follows: Set Absolute Path for Web NMS in setEnv.


1 Answers

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:

  • Tomcat JSP compiler
  • WebLogic JSP compiler
  • Precompiling JSP files in WebSphere
like image 77
Ramesh PVK Avatar answered Oct 16 '22 12:10

Ramesh PVK