work directory and temp directory under tomcat

1, work directory under tomcat

1 when used as a tomcat web server, deployed at webApps, the program after these procedures are compiled (posted to tomcat project in with the class, will be compiled into .class come after the release, the source was not released over, but not here jsp compiled). tomcat has a work directory, stored inside a cached page, jsp will compile access (from localhost work in the project as the site folder after entering Catalina, we can see the jsp page will be compiled into a servlet should file when, next time come visit, you can directly run the servlet class response to the client in response to the page, so some blog said that it would slow the first visit, because the new release up page views in the first person It will be compiled into a servlet files, so slow, once compiled, then the jsp page unless modified, or run directly next visit servlet can respond to user, so fast) , files are stored compiled in the work directory. The tomcat show catalog will from this cache jsp corresponding class files compiled find. So when you empty the work directory, the process will start again.     
    Sometimes encounter a problem, is modified page can not be displayed traces of the modified while running tomcat. Delete the corresponding work at this time of the project directory folder and restart tomcat on it.

2 configuration files in the Host name server.xml file tomcat's conf Configuration folder, the establishment of the site under the name of the file will be Catalina Catalina in conf file folders and work folders, each release project will put to enter, will also record to a profile Catalina conf files under the folder to go.

 Recently found that many users prefer to work directory tomcat's something called a cache, in fact, it is not very appropriate, work just tomcat directory working directory, that is, to convert tomcat jsp files of the working directory for the class, which is why it directory called work and not the cause cache directory. 
  jsp, tomcat works is when the browser visits a jsp page, tomcat jsp page will convert this into a .java file in the work directory, for example, will be converted to index_jsp.java index.jsp file, and then compiled into index_jsp. class file, through the final container tomcat index_jsp.class this class ClassLoader class loaded into memory, the client responds work.

  jsp tomcat regularly slightly description files within the container, reads the attributes of each file, when the file is changed find a jsp (last modified time of the file is not the same with the previous description when slightly), will be reconverted tomcat, jsp compile this file. But the description is a little tomcat's timing is not real-time, which is why the jsp file modification takes a few minutes to wait modified jsp effect. Of course, in order to take effect immediately, many old-timers will recommend clearing work directory of the file immediately after the modified jsp page.

  In addition, tomcat container for java converted file: Compile (such as index_jsp.java) maximum support only 64k, so in other containers jsp tomcat when transplanted into the vessel encountered big jsp files can not be compiled happen circumstances, it is proposed to write business logic in jsp separate class in jsp by calling the static method of this class to perform, and jsp page js extracted into a separate js file.

 

The problem domain: 
    how to get Tomcat automatically updates the class of problems. 
Solution: 
First, 
create a separate configuration file in tomcat installation path. 
For example: 
create a file: D: \ Tomcat5.5 \ conf \  Catalina \ localhost \ testapp.xml

content: 
<Context docBase = "D: \ Tomcat5.5 \ webapps \ TestApp" reloadable = "to true" path = "/ TestApp "workDir =" Work \ Catalina \ localhost \ TestApp "> 
</ the Context> 

restart Tomcat 

two, 
add content directly tomcat profile conf / server.xml follows: 
<the docBase the Context =" D: \ Tomcat5.5 \ the webapps \ TestApp "Reloadable =" to true "path =" / TestApp "workDir =" Work \ Catalina \ localhost \ TestApp "> 
</ the Context> 
Note that in the <Engine name =" Add the Catalina "defaultHost =" localhost "> tag ; 
restart Tomcat

2, temp directory under tomcat

Quoted from: https: //blog.csdn.net/u013076997/article/details/52301262

Question background: Business people told me that the login screen code get out, I feel strange ah, how the project has been running the code to get out of it?

Find a cause for a long time, then suddenly remembered just delete the files in the temp directory tomcat to delete, and then thought no effect, created a new temp directory, refresh the page just fine.

Feeling curious, temp directory and CAPTCHA what does it matter? The original, temp directory tomcat users to store temporary files created during operation. (Clear does not affect the running tomcat) However, do not delete the directory, or else it will bring an unknown error.

Reference article:

https://blog.csdn.net/wugouzi/article/details/12713559

Original Address: https://www.cnblogs.com/java-jun-world2099/articles/10138732.html

1, work directory under tomcat

1 when used as a tomcat web server, deployed at webApps, the program after these procedures are compiled (posted to tomcat project in with the class, will be compiled into .class come after the release, the source was not released over, but not here jsp compiled). tomcat has a work directory, stored inside a cached page, jsp will compile access (from localhost work in the project as the site folder after entering Catalina, we can see the jsp page will be compiled into a servlet should file when, next time come visit, you can directly run the servlet class response to the client in response to the page, so some blog said that it would slow the first visit, because the new release up page views in the first person It will be compiled into a servlet files, so slow, once compiled, then the jsp page unless modified, or run directly next visit servlet can respond to user, so fast) , files are stored compiled in the work directory. The tomcat show catalog will from this cache jsp corresponding class files compiled find. So when you empty the work directory, the process will start again.     
    Sometimes encounter a problem, is modified page can not be displayed traces of the modified while running tomcat. Delete the corresponding work at this time of the project directory folder and restart tomcat on it.

2 configuration files in the Host name server.xml file tomcat's conf Configuration folder, the establishment of the site under the name of the file will be Catalina Catalina in conf file folders and work folders, each release project will put to enter, will also record to a profile Catalina conf files under the folder to go.

 Recently found that many users prefer to work directory tomcat's something called a cache, in fact, it is not very appropriate, work just tomcat directory working directory, that is, to convert tomcat jsp files of the working directory for the class, which is why it directory called work and not the cause cache directory. 
  jsp, tomcat works is when the browser visits a jsp page, tomcat jsp page will convert this into a .java file in the work directory, for example, will be converted to index_jsp.java index.jsp file, and then compiled into index_jsp. class file, through the final container tomcat index_jsp.class this class ClassLoader class loaded into memory, the client responds work.

  jsp tomcat regularly slightly description files within the container, reads the attributes of each file, when the file is changed find a jsp (last modified time of the file is not the same with the previous description when slightly), will be reconverted tomcat, jsp compile this file. But the description is a little tomcat's timing is not real-time, which is why the jsp file modification takes a few minutes to wait modified jsp effect. Of course, in order to take effect immediately, many old-timers will recommend clearing work directory of the file immediately after the modified jsp page.

  In addition, tomcat container for java converted file: Compile (such as index_jsp.java) maximum support only 64k, so in other containers jsp tomcat when transplanted into the vessel encountered big jsp files can not be compiled happen circumstances, it is proposed to write business logic in jsp separate class in jsp by calling the static method of this class to perform, and jsp page js extracted into a separate js file.

 

The problem domain: 
    how to get Tomcat automatically updates the class of problems. 
Solution: 
First, 
create a separate configuration file in tomcat installation path. 
For example: 
create a file: D: \ Tomcat5.5 \ conf \  Catalina \ localhost \ testapp.xml

content: 
<Context docBase = "D: \ Tomcat5.5 \ webapps \ TestApp" reloadable = "to true" path = "/ TestApp "workDir =" Work \ Catalina \ localhost \ TestApp "> 
</ the Context> 

restart Tomcat 

two, 
add content directly tomcat profile conf / server.xml follows: 
<the docBase the Context =" D: \ Tomcat5.5 \ the webapps \ TestApp "Reloadable =" to true "path =" / TestApp "workDir =" Work \ Catalina \ localhost \ TestApp "> 
</ the Context> 
Note that in the <Engine name =" Add the Catalina "defaultHost =" localhost "> tag ; 
restart Tomcat

2, temp directory under tomcat

Quoted from: https: //blog.csdn.net/u013076997/article/details/52301262

Question background: Business people told me that the login screen code get out, I feel strange ah, how the project has been running the code to get out of it?

Find a cause for a long time, then suddenly remembered just delete the files in the temp directory tomcat to delete, and then thought no effect, created a new temp directory, refresh the page just fine.

Feeling curious, temp directory and CAPTCHA what does it matter? The original, temp directory tomcat users to store temporary files created during operation. (Clear does not affect the running tomcat) However, do not delete the directory, or else it will bring an unknown error.

Reference article:

https://blog.csdn.net/wugouzi/article/details/12713559

Guess you like

Origin www.cnblogs.com/jpfss/p/10985119.html