rIshab1988
rIshab1988

Reputation: 125

JSP recompilation needed?

I just want the general idea about what will happen in the following situation, without getting into the technical details.

The main advantage of JSP is that we have separate presentation (static HTML) and dynamic application logic. So we can make changes into either of them without affecting the other. Now suppose, we have a precompiled JSP into either a servlet or bytecode, and we want to make a change in the presentation part, would we then have to recompile the whole stuff, even though we did not make any change in the application logic?

Thanks everyone for the answer, but all the answers that I get do point to the fact that whether automatically or manually, the JSP does need to be recompiled into the servlet, which is then converted into the corresponding byctecode. In short a completely new file would be created I suppose.

Upvotes: 1

Views: 11124

Answers (3)

Samuel Edwin Ward
Samuel Edwin Ward

Reputation: 6675

Yes and no. JSP's are ultimately compiled into servlets, but the servlet container will usually recompile the JSP for you if it has changed, which is a fairly quick operation.

Upvotes: 1

Pragalathan  M
Pragalathan M

Reputation: 1781

As long as it is JSP, you dont need to compile/convert. The application server automatically translates your JSP into corresponding servlet, a Java file (on the first hit to the JSP), and then compiles it to class file. Whenever you update the JSP file and when the server receives request for that resource (JSP) it checks the last updated time and does the above job if required.

Upvotes: 5

Trever Shick
Trever Shick

Reputation: 1784

No. If you change the JSP, generally speaking the servlet/jsp container will 'see' the jsp changed and will recompile it.

That being said, i'm not clear on your deployment model. if you're 'precompiling' the asps and adding those to your .war then you might be out of luck.

Upvotes: 0

Related Questions