• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP recompile confusion

 
Scott Roberts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a .war file that I deployed on Tomcat 6 server on my pc. I found that the war file was exploded and a folder of the same name with necessary sub-folders was present in Tomcat "webapps" directory.
Later I realized that I need to change some html part of a jsp. so I changed only html and not any java code in the relevant jsp.
Then I restarted tomcat and ran my webapp and thought that I would see the new jsp view in my browser however I still find that I can only view old jsp file, I rechecked the source of .jsp and it contained the modifications that I made recently so I'm at loss to understand why can't I view the modified jsp view in my browser.

My questions are:
a. Do I have to modify the jsp in the war file itself and not in the exploded directory structure?
b. Do I need to do any recompilation when I make changes to a .jsp file, mind you I have only changed the html parts of the jsp and no changes in java code itself?
c. Any thing else that I'm missing out?

I have only access to the .war file and no other sources at the moment.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Roberts wrote:so I changed only html and not any java code in the relevant jsp.

You have Java code in a JSP? In 2011?

a. Do I have to modify the jsp in the war file itself and not in the exploded directory structure?

Changing the exploded version after the war has been deployed is a recipe for disaster. The container can choose to redeploy from the war at any time, so any ad hoc changes you make to the exploded versions will be lost. if you need to make changes, make them at the source level, and redeploy the war.

b. Do I need to do any recompilation when I make changes to a .jsp file, mind you I have only changed the html parts of the jsp and no changes in java code itself?

No. The container will detect that the JSP has changed and could care less how it has changed.

I have only access to the .war file and no other sources at the moment.

Huh?
 
Scott Roberts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
You have Java code in a JSP? In 2011?


The jsp has code interspersed between html in the tags.

What should I do to not allow java code in JSP?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott Roberts wrote:What should I do to not allow java code in JSP?

There is a setting in the deployment descriptor that disallows scripting (which I think should be enabled by default, but isn't). But it's easiest to just not put it in there in the first place.

Modern JSP uses the JSTL (JSP Standard Tag Library) and the EL (Expression Language) in place of scriptlets.
 
Scott Roberts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Changing the exploded version after the war has been deployed is a recipe for disaster. The container can choose to redeploy from the war at any time, so any ad hoc changes you make to the exploded versions will be lost. if you need to make changes, make them at the source level, and redeploy the war.


Hello Bear,
Is it possible to work with the war file directly in a java editor like Netbeans or Eclipse. Make the necessary changes and then redeploy that war.
Or do I need to unzip it first and then work with the unzipped folders.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unzip.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!