• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to change file (java/jsp) in my project and it don't have the need to restart tomcat

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy guys,

when I change file in my webproject i have to always testart tomcat. It is possible see the file changed without restart tomcat?
How it is possible?
I read some tutorial and suggest someone to put reloable == true. But I don't understand.
I have tomcat integrate with eclipse.

thank you

dora di donato
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A JSP can be changed without worrying about restarting anything.

For a servlet or other Java class, the web app, but not Tomcat, needs to be restarted. Using Tomcat's Manager app makes this rather easy.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Advanced debuggers let you alter classes at runtime, as does software like JRebel.
 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy Tim,
thanks very much.
I will install Tomcat Manager but I try to change the jsp but I don't see the changement after I refresh the jsp.Why?

You consider that i have ant in the project, it can help me?


tahnks

dora di donato
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant has nothing to do with this. See the answer in http://stackoverflow.com/questions/2004676/why-my-jsp-changes-are-not-reflected-without-restarting-tomcat

You don't need the Tomcat manager to reload JSPs, you need it to reload the entire web app (for when you want to reload Java classes).
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dora Di Donato wrote:but I try to change the jsp but I don't see the changement after I refresh the jsp.Why?


JSPs should be automatically re-translated. Are you perhaps having caching issues?
 
Dora Di Donato
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
ok thanks I understand i put in the my contex.xml the parameter reloadable= true but it don't function.
Ok for the ant I need tomcat manager to be quick in my develop!!


thanks

Dora Di Donato
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Changes don't get picked up immediately. Tomcat scans the app for changes every few seconds. Try waiting a little while.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also searching for a solution to change, add or remove java or jsf files without restarting the application.
The solution explained here, doesn't work.

I'm using tomcat 7 and having an application in webapps folder.
When I call e.g. "localhost/app/index.xhtml" I see the page as I expected. When I change something in this or another file, waiting some time and reloading this page, nothing changed.
Looking in "work/Catalina/localhost/app" I see no files, which I could delete to retranslate existing source files.

Where does Tomcat 7 store the files or what do I have to do to make changes while running?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XHTML files are served as is, so you won't find any compiled sources. Also, it's jut highly likely that your browser is caching the page. Clear the browser cache and you will see the updates.
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically, this should have been a new thread. The original conversation ended a month ago, and we're shifting the subject a bit here. Whatever. Just a reminder that we don't charge people extra for starting their own threads!

"xhtml" is a little vague, unfortunately. In the literal meaning, it would be an HTML file that follows the XML (xhtml) schema. However, such files commonly have the extension of ".htm" or ".html". In fact, I spent some time going in circles the other day because I'd forgotten that when attempting to assemble an eBook file. And HTML files, regardless of which schema/DTD you code them under are served up verbatim to the client by Tomcat.

".xhtml" as a filename extension, however, is the conventional extension for JSF Facelets View Definition Language (VDL) files. In this case, the VDL source is compiled as part of the process of creating the JSF component tree. But the component tree is continually being updated, so chances that changes to those files won't get picked up rapidly are very low. And, in point of fact, I routinely tweak xhtml on the fly as part of the ongoing war between me and CSS to get JSF pages to lay out properly. Since I have Tomcat aimed at my project's target directory, all it takes is a "mvn -o war:exploded" to do so. Followed by "F5" (refresh) to update the browser display.

On the other hand, Tomcat will experience varying behavior for java code and JSPs because the file isn't merely being copied, it's being loaded (as a class) into the JVM. By default, Tomcat will scan the WAR every second or 2 and pick up the class changes at that time, although static initializations done when the class initially loaded may not get repeated. However, if someone has been playing with Tomcat settings, the interval may be different.

It does bear repeating that if you use the common practice of creating a WAR file and copying it to TOMCAT_HOME/webapps, Tomcat will "explode" that WAR into a corresponding directory by default and use the exploded directory as a codebase. If you update the WAR file and copy it again, the exploded copy of the WAR will, however, not be updated. The WAR is only exploded once.

 
reply
    Bookmark Topic Watch Topic
  • New Topic