The difference between eclipse and myeclipse leads to different operations

Create a resource bundle:
Each resource file in a resource bundle must have a common basename.
In addition to the basename, each resource file's name must have an additional portion of its name identifying its local information.
For example, if the base name of a resource package is "myproperties", the resource file names corresponding to Chinese and English environments are:
“myproperites_zh.properties” “myproperites_en.properties”
Every resource bundle should have a default resource file with no additional sections identifying local information.
If the ResourceBundle object cannot find a resource file that matches the user in the resource bundle, it will select the resource file in the resource bundle that is closest to the user, and if it cannot find any more, it will use the default resource file.
For example: myproperites.properties
The solution to the properties file in eclipse find help--->eclipseMarkplace-->search properties---"install-->properties Editor;-->next--"""
When opening properties, right-click to open it with prpperties Editor to solve Chinese garbled characters;
A ResourceBundle class is provided in JavaAPI to describe a resource bundle, and the ResourceBundle class provides the corresponding method getBundle,
This method can automatically obtain and display corresponding resource files according to the visitor's country.
After servlet3.0 appears, there is no need to configure web.xml in eclipses
How to create the parameters in the filter, it is impossible to write in web.xml:
Paradigm: Create a filter filter, then select whether to create a parameter in the parameter list, and then change the corresponding url-parttern parameter
Let him correspond to your jsp file to solve this problem;
@WebFilter(
urlPatterns = { "/jsp/index.jsp" },
initParams = {
@WebInitParam(name = "count", value = "5000")
})
用filterConfig来获取属性的值是多少
filterConfig.getInitParameter(String name);
@WebFilter(asyncSupported = true, description = "filterdemo", urlPatterns = { "/*" })

在myeclipse中就必须在web.xml逐一配置出来
有:
<filter>
<filter-name>Filter1</filter-name>
<filter-class>cn.itcast.filter.Filter1</filter-class>
</filter>
<!-- 配置过滤器去拦截哪个资源 -->
<filter-mapping>
<filter-name>Filter1</filter-name>
<url-pattern>/hello.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>--用来配置以哪种方式对资源的访问(request/forward/include/error)
可以配置多个dispatcher如果不配置默认为request请求
</filter-mapping>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324602108&siteId=291194637