Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of Server Options options for Tomcat

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I. configuration

By default, the first two are not checked, and should be checked:

(1) Serve modules without publishing, the first option of Server Options

By default, when the project is deployed to tomcat, the plug-in copies the project files to the wtpwebapps directory that displays Server path in the previous configuration item Server Locations, that is, the directory where the current wrokspace is located. In the metadata subdirectory, if my wrokspace is D:\ workspace, then the directory is: d:\ workspace\ .metadata\ .plugins\ org.eclipse.wst.server.core\ tmp0\ wtpwebapps.

However, if you select this option above, the project file will not be published and run in that directory, but instead:

Web resource directory is the WebContent of the web project, that is, the src/main/webapp directory of the maven web project

The class file directory is: the output directory of the currently configured class file, that is, the target/classes directory of the maven project

(2) Timeouts

By default, start is 45 seconds and stop is 15 seconds. You may need to modify start to an appropriate large value, which means that an error will be reported when the startup time exceeds the time specified here before the startup is completed. When our project is time-consuming to start, this is obviously not what we want, so we need to change this value.

Check Server Options- > Serve Modules without publishing. If it is left unchecked, the Web server will be constantly restarted in the modified class file. If the Web project takes a long time to start, you need to modify the timeout, which is set in Timeouts.

There is a reloadable='true' attribute in the Cotext node. Change it to false, which takes effect without restarting the server after modifying the java file, but does not include the operation of creating a new java file, adding methods and variables.

Second, browse documents

Files generated separately by the Context node:

The original Context node in conf/server.xml under the Tomcat installation directory (after the second option is checked, this node does not exist in server.xml):

Third, the reason

1. Check the first one to prevent warnings:

Warning: a docBase D:/Tomcat/webapps/Shop inside the host appBase has been specified, and will be ignored

When checked, it means that tomcat can directly use the things under WebContent in eclipse.

Omit publish to .metadata.pluginsorg.eclipse.wst.server.coretmp0webapps

And delete the relevant resources under tmp0webapps

The serveModulesWithoutPublish=true in .metadata.pluginsorg.eclipse.wst.server.coreservers.xml and the configuration in tmp0/conf/server.xml are also modified.

two。 Check the second to prevent warnings:

Warning: [SetPropertiesRule] {Server/Service/Engine/Host/Context} Setting property 'source' to' org.eclipse.jst.j2ee.server:strut2demo' did not find a matching property.

The reason for the [SetPropertiesRule] warning is that the source attribute is no longer supported in the context node of server.xml above Tomcat6.0. The details are as follows:

For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

Optimize

Find the menu, Window- > Preferences

It is useless to check English spelling. Uncheck the spell check here, location: General- > Editors- > Text Editors- > Spelling, and uncheck Enable spell checking.

Another check can also be canceled: Validation, check Suspend all validators.

Show line number location: General- > Editors- > Text Editors, check Show line numbers

Change the default encoding mode of jsp pages to utf-8 location: Web- > JSP Files,Encoding to ISO 10646/Unicode (UTF-8)

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report