zoukankan      html  css  js  c++  java
  • Tomcat环境变量,端口号,编码格式,项目路径,默认页的配置

    Tomcat的配置

    1.配置环境变量

    新建名为:CATALINA_HOME的系统变量,值为我们安装tomcat的目录

    2端口号及编码的配置:

    找到tomcat安装目录下的sonf下的server文件,

    <Connector port="8080" protocol="HTTP/1.1"

                   connectionTimeout="20000"

                   redirectPort="8443" URIEncoding="UTF-8"/>

    中的8080修改为80即可 并添加URIEncoding="UTF-8",URL的编码格式进行设定,防止后期表单提交方式为get时的中文数据乱码

     重新打开Tomcat应用 双击Tomcat7.exe查看端口号

    3.项目文件夹路径配置

    1.E盘根目录下创建名为webdemo的项目文件夹,tomcat安装目录下webappsROOT中的WEB-INF文件夹复制到webdemo

    并在tomcat安装目录下的sonf下的server文件中</Host>的上一排添加<Context path="/myweb" docBase="E:webdemo"/>这段代码

    .path代表的是,浏览器中输入的 例如http://localhost/myweb

     重新打开Tomcat应用 双击Tomcat7.exe

    2.找到tomcat安装目录下的sonf下的web文件搜索listings  

    <init-param>

                <param-name>listings</param-name>

                <param-value>false</param-value>

            </init-param>

    false修改为true

     重新打开Tomcat应用 双击Tomcat7.exe

    浏览器中输入http://localhost/myweb

    3.webdemo下进行编写建立jsp文件进行编程

    4.默认页的配置

    tomcat默认情况下是打开名为index.html的文件

    如果修改文件名则不会被打开.如果想要修改文件名字,可以修改配置

    tomcat安装目录下的sonf下的web文件中最后地方的

     <welcome-file-list>

            <welcome-file>index.html</welcome-file>

            <welcome-file>index.htm</welcome-file>

            <welcome-file>index.jsp</welcome-file>

        </welcome-file-list>

    这段代码复制到webdemo下的WEB-INF文件夹中的web文件中  </description> 后面,index修改为我们自己创建的JSP文件的名字

    重新打开Tomcat应用 双击Tomcat7.exe

    5.现在就可以在webdemo的项目文件夹下进行项目编写了

  • 相关阅读:
    GridView合并行代码
    GridView合并行头代码
    Javascript 的几种写法与提示
    [转] 浅谈MSSQL锁机制
    Two ways of using memory: Stack and Heap
    You have to know how .Net code "managed"?
    Sql Server Profiler
    InterProcess Communication
    database Index
    敏捷开发
  • 原文地址:https://www.cnblogs.com/zqr99/p/7527712.html
Copyright © 2011-2022 走看看