`
hain
  • 浏览: 449600 次
  • 来自: ...
社区版块
存档分类
最新评论

配置JSP环境Web.xml详细配置

阅读更多

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
   Copyright 2004 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES or CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
     version="2.4">
    
<!--为Servlet命名 -->
<servlet>
<servlet-name>ServletName</servlet-name>
<servlet-class>com.eays.servlet</servlet-class>
</servlet>

<!--设置会话过期时间 -->
<session-config>
<session-timeout>180</session-timeout>
</session-config>

<!--允许或者禁止EL语言-->
<jsp-property-group>
<url-pattern>*</url-pattern>
<el-ignored>false</el-ignored>
</jsp-property-group>

<!--允许或者禁止脚本段-->
<jsp-property-group>
<url-pattern>*</url-pattern>
<scripting-invalid>false</scripting-invalid>
</jsp-property-group>

<!-- 申明JSP的编码-->
<jsp-property-group>
<url-pattern>*</url-pattern>
<page-encoding>GBK</page-encoding>
</jsp-property-group>

<!--指定文件内容是否是JSP格式-->
<jsp-property-group>
<url-pattern>*.svg</url-pattern>
<is-xml>true</is-xml>
</jsp-property-group>

<!--定义initParameter参数 -->
<init-param>
<param-name>Param</param-name>
<param-value>Value</param-value>
</init-param>

<!--定义运用范围内的初始化参数 -->
<context-param>
<param-name>Support</param-name>
<param-value>xihaikun@eays.net</param-value>
</context-param>

<!--定制Servlet URL -->
<servlet-mapping>
<servlet-name>ServletName</servlet-name>
<url-pattern>/Servlet</url-pattern>
</servlet-mapping>


<!--指定索引页面 -->
   <welcome-file-list>
     <welcome-file>index.jsp</welcome-file>
     <welcome-file>index.html</welcome-file>
   </welcome-file-list>
   
<!--指定错误的页面 -->
<error-page>
<error-code>404</error-code>
<location>/NotFound.jsp</location>
</error-page>

<error-page>
<exception-type>exception.ServletNotFound</exception-type>
<location>/sorry.jsp</location>
</error-page>
</web-app>

分享到:
评论

相关推荐

    JSPservlet中web.xml详细配置指南(包含所有情况)

    JSPservlet中web.xml详细配置指南(包含所有情况)

    JSP Web.xml标准配置内容

    WEB.XML标准配置注解: &lt;!--Servlet的映射,用来说明客户端IE中输入什么样的地址字符串对应到哪个Servlet的别名--&gt; &lt;!--在该例中在IE地址栏中firstservlet字符串对应到别名为firstservlet的servlet--&gt; ...

    web.xml配置详解

    web.xml配置详解, jsp网站开发配置详解

    JAVA web.xml配置详解

    -- context-param 元素用来设定web站台的环境参数(context),它包含两个子元素:param-name和param-value.,如spring的典型配置 --&gt; &lt;!-- 设定Context名称 --&gt; &lt;param-name&gt;contextConfigLocation &lt;!-- 设定...

    关于web.xml配置的详细说明.pdf

    关于web.xml配置的详细说明,作者总结得很好,适合新手学习。在网上档的,整理成pdf文档,供同志们使用。内附原文地址。

    web.xml详细说明

    用于 web.xml 配置详解。例如: &lt;web-app&gt; &lt;display-name&gt;&lt;/display-name&gt;定义了WEB应用的名字 &lt;description&gt;&lt;/description&gt; 声明WEB应用的描述信息 &lt;context-param&gt;&lt;/context-param&gt; context-param元素声明应用...

    jsp乱码解决超酷,通过web.xml配置

    该文件搞到你的src目录相应的包下 然后配置web.xml就可用了 简单实用。

    jsp web.xml文件的作用及基本配置

    当你的web工程没用到这些时,你可以不用web.xml文件来配置你的web工程。 那么web.xml能做的所有事情都有那些? 其实,web.xml的模式(Schema)文件中定义了多少种标签元素,web.xml中就可以出现它的模式文件所定义的...

    jsp web.xml文件的作用及基本配置.docx

    jsp web.xml文件的作用及基本配置.docx

    关于JSP配置文件web.xml加载顺序详解

    本篇文章小编为大家介绍,关于JSP配置文件web.xml加载顺序详解。需要的朋友参考下

    JAVA WEB 开发详解:XML+XSLT+SERVLET+JSP 深入剖析与实例应用.part3

    本书共分4部分,从xml、servlet、jsp和应用的角度向读者展示了java web开发中各种技术的应用,循序渐进地引导读者快速掌握java web开发。.  本书内容全面,涵盖了从事java web开发所应掌握的所有知识。在知识的讲解...

    jsp中session过期设置及web.xml配置学习

    session的过期时间需要配置在tomcat 中的 web.xml 中,时间以分钟计算。另最大时间好像是24小时,就是说,你的session过期时间可以设置成1440,如果设置成1441是无效的。(还没有测试) 代码如下: &lt;session&gt; &lt;session&gt;...

    JSP开发环境配置与测试.docx

    教J2EE初学者配置系统环境,能使初学者自己就完成看似复杂的系统配置问题。

    web.xml配置参考文档-CHM格式--JAVA WEB开发必备参考文档

    不用多说了,有过JAVA WEB开发经历的朋友们都知道web.xml有多重要!这是CHM格式的参考文档,非常方便查阅!赶快下载吧~~~~

    DWR.xml配置文件说明书(含源码)

    DWR.xml配置文件说明书 1、 建立dwr.xml 配置文件 任何一个dwr.xml的文件都需要包含DWR DOCTYPE的声明行,格式如下: &lt;!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" ...

    tomcat配置自身错误页面

    tomcat配置自身错误页面,直接替换tomcat本身的root文件夹即可。然后修改web.xml,具体方式详见:https://blog.csdn.net/f552126367/article/details/107999676

Global site tag (gtag.js) - Google Analytics