安装jstl中的web.xml配置问题[1]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

http://apache.towardex.com/jakarta/taglibs/standard/下载了最新的jstl,然后把standard.jar和jstl.jar文件拷贝到\WEB-INF\lib\下,\tld\下的8个tld类型文件拷到"\WEB-INF\"下。

接下来配置web.xml文件,这里我就有些糊涂了。

下面这个是《jsp设计》的web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com//dtd/web-app_2_3.dtd">

<web-app>
  <!-- Used by the JSTL I18N actions -->
  <context-param>
    <param-name>
      javax.servlet.jsp.jstl.fmt.fallbackLocale
    </param-name>
    <param-value>
      en
    </param-value>
  </context-param>

  <!-- Used by the JSTL database actions -->
  <context-param>
    <param-name>
      javax.servlet.jsp.jstl.sql.dataSource
    </param-name>
    <param-value>
      jdbc:mysql:///test,org.gjt.mm.mysql.Driver
    </param-value>
  </context-param>

  <!-- Used by the ResourceManagerListener in Chapter 18  -->
  <context-param>
    <param-name>driverClass</param-name>
    <param-value>
      org.gjt.mm.mysql.Driver
    </param-value>
  </context-param>

  <context-param>
    <param-name>jdbcURL</param-name>
    <param-value>
      jdbc:mysql:///test
    </param-value>
  </context-param>

  <!-- Filter and listener configurations for Chapter 18 -->
  <filter>
    <filter-name>accessControl</filter-name>
    <filter-class>
      com.ora.jsp.servlets.AccessControlFilter
    </filter-class>
    <init-param>
      <param-name>loginPage</param-name>
      <param-value>/ch18/login.jsp</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>accessControl</filter-name>
    <url-pattern>/ch18/protected/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>
      com.ora.jsp.servlets.ResourceManagerListener
    </listener-class>
  </listener>

  <listener>
    <listener-class>
      com.ora.jsp.servlets.SessionCounterListener
    </listener-class>
  </listener>

  <!-- Servlet for showing JSP source. NOTE! Remove this in production -->
  <servlet>
    <servlet-name>jspSource</servlet-name>
    <servlet-class>JSPSourceServlet</servlet-class>
  </servlet>

  <!--
    Servlet for handling both servlet and JSP errors, see Chapter 18
  -->
  <servlet>
    <servlet-name>errorDispatcher</servlet-name>
    <servlet-class>com.ora.jsp.servlets.ErrorDispatcherServlet</servlet-class>
    <init-param>
      <param-name>errorPage</param-name>
      <param-value>/ch9/errorpage.jsp?debug=resp</param-value>
    </init-param>
  </servlet>

  <!-- Struts Controller servlet, see Chapter 18 -->
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>jspSource</servlet-name>
    <url-pattern>/jspSource/*</url-pattern>
  </servlet-mapping>

本文关键:安装jstl中的web.xml配置问题
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top