Linux下设置Tomcat自启动后 SmartUpload 出现中文乱码
原来SmartUpload处理中文是正常的,加tomcat自启动后出现乱码,可能是pageContext出了问题。
以root用户登录系统,新建tomcat文件:
#cd /etc/rc.d/init.d/
#vi tomcat
内容如下:
#!/bin/sh
#
# tomcat: Start/Stop/Restart tomcat
#
# chkconfig: 2345 80 20
# description: Tomcat is a Java Servlet Container
#
# match these values to your environment:
export CATALINA_BASE=/datas/app/tomcat6
export CATALINA_HOME=/datas/app/tomcat
export CATALINA_TMPDIR=/datas/app/tomcat6/temp
export JRE_HOME=/datas/app/jdk1.6
# Source function library.
./etc/rc.d/init.d/functions
TOMCAT=/datas/app/tomcat6
start() {
echo -n "Starting Tomcat: "
$TOMCAT/bin/catalina.sh start
}
stop() {
echo -n "Stopping Tomcat: "
$TOMCAT/bin/catalina.sh stop
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start stop restart}"
;;
esac
exit $RETVAL
#chmod a+x tomcat
#/sbin/chkconfig --add tomcat
#/sbin/shutdown -r now
重启机器后,凡用到SmartUpload的页面中文都出现乱码,之前是正常的。
只好去掉自启动:
#/sbin/chkconfig --del tomcat
原因待查。。。