从windows系统中,copy了MSYH.TTC和MSYHBD.TTC 2个文件到 服务器的%JAVA_HOME%\jre\lib\fonts\fallback 目录中,
(如果fallback目录不存在,就新建一个)。
重启tomcat后,中文就能显示了。
附上配置文件。1,在pom.xml依赖中加入 <dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.48.0</version>
</dependency>
2,在web.xml 中加入 <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:net/bull/javamelody/monitoring-spring.xml
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<filter>
<filter-name>monitoring</filter-name>
<filter-class>net.miaosha.web.filter.MiaoshaMonitoringFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>monitoring</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
3,在applicationContext.xml中添加javamelody的监控 <bean id="facadeMonitoringAdvisor" class="net.bull.javamelody.MonitoringSpringAdvisor">
<property name="pointcut">
<bean class="org.springframework.aop.support.JdkRegexpMethodPointcut">
<property name="patterns">
<array>
<value>net\.miaosha\..*</value>
</array>
</property>
</bean>
</property>
</bean>
4,新建权限类中加入系统监控只允许网站管理员查过,如果不需要权限,该类可以不创建,在web.xml中的filter直接用javamelody自带的net.bull.javamelody.MonitoringFilter package net.miaosha.web.filter; import net.bull.javamelody.MonitoringFilter;
import net.miaosha.biz.user.domain.User;
import net.miaosha.web.common.UserConstants; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; /**
* User: xiongba
*/
public class MiaoshaMonitoringFilter extends MonitoringFilter { protected boolean isRequestAllowed(HttpServletRequest httpRequest) {
HttpSession session = httpRequest.getSession();
if (session == null) {
return false;
}
User user = (User) session.getAttribute(UserConstants.SEESSION_USER);
if(user==null){
return false;
}
return user.isAdmin();
}
}
5,全部配置完后,就可以通过http://youwebsite/monitoring 来访问了。