乱码问题,这里说的是url乱码的解决方式可以通过配置tomcat来解决。
找到commector 加上uriencoding就ok了。这里的port就是tomcat的http监听端口,默认是8080,我该成了8085
<Connector port="8085" ... URIEncoding="UTF-8" />
如果一个机器上跑多个tomcat除了修改上面的端口还需要修改关闭端口等两三个端口。
-----------------------------------
如果你不希望直接将war包丢到tomcat的内部的话,可以直接解压成目录的方式放到任意地方,只需要配置一下\conf\server.xml就可以了。
在<Host ...>标签里面加入:
<Context path="/oatocms" docBase="E:\dev\oatocms"
debug="0" reloadable="true"
crossContext="true"/>
这样就可以通过http://localhost:8085/oatocms 访问到这个项目了。
--------------------------------------
如果你不想用系统配置的java_home那么,你可以通过\bin\setclasspath.bat来直接指定。找到这个文件,将内容替换为以下内容:
rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 355227 2005-12-08 21:44:16Z keith $
rem ---------------------------------------------------------------------------
if not "%BASEDIR%" == "" goto gotBasedir
echo The BASEDIR environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotBasedir
if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir
echo The BASEDIR environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit
:okBasedir
rem Set the default -Djava.endorsed.dirs argument
set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed
rem Set standard CLASSPATH
rem Note that there are no quotes as we do not want to introduce random
rem quotes into the CLASSPATH
set CLASSPATH=E:\dev\java\jdk1.5.0\lib\tools.jar
rem Set standard command for invoking Java.
rem Note that NT requires a window name argument when using start.
rem Also note the quoting as JAVA_HOME may contain spaces.
set _RUNJAVA="E:\dev\java\jdk1.5.0\bin\java"
set _RUNJAVAW="E:\dev\java\jdk1.5.0\bin\javaw"
set _RUNJDB="E:\dev\java\jdk1.5.0\bin\jdb"
set _RUNJAVAC="E:\dev\java\jdk1.5.0\bin\javac"
goto end
:exit
exit /b 1
:end
而tomcat启动时,会这样调用:start.bat -> catalina.bat -> setclasspath.bat
---------------------------------------------
暂时就这些。