zoukankan      html  css  js  c++  java
  • jstl__报错

    1、缺少JAR:解决的办法就是手动将jstl.jar和 standard.jar这两个jar包加入到web项目的WEB-INF/lib目录中或者是把jstl.jar、standard.jar复制到tomcat的lib中就可以了,JSTL API 和实现包,在Tomcat下面都有,位于 %TOMCAT_HOME%/webapps/examples/WEB-INF/lib 目录中

    2、web.xml必须指定使用servlet  和JSP 的规范:

    <web-app version="2.5" 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/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">

    这里注意一下:tomcat版本是可以向下兼容servlet规范和jsp规范的,例如上面的,如果项目中没有用到tomcat6对应的servlet2.5规范和jsp2.1规范,可以还是用servlet2.4和jsp2.0规范(针对xml文件的配置)

    此步的解决方法有多种:

    第一:在web.xml文件中添加

     <jsp-property-group>
      <deferred-syntax-allowed-as-literal>
       true
      </deferred-syntax-allowed-as-literal>
     </jsp-property-group>

    第二:在jsp页面中添加<%@ page contentType="text/html; charset=UTF-8" deferredSyntaxAllowedAsLiteral="true"%> 

    以上两种方式我都试过了,没起作用,

    我采用第三种:将#{。。。。}更改为#{。。。。}

    还有第四种方法:将页面中所用使用的#{}表达式换掉,

    附属java web开发中,如何查看JSP和Servlet版本

    方法:打开tomcat/lib,找到jsp-api.jar和servlet-api.jar。解压这两个文件,找到META-INF下的MANIFEST.MF文件。用记事本或者EditPlus一类的软件打开。

    JSP版本是:

    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.8.2
    Created-By: 1.6.0_29-b11 (Sun Microsystems Inc.)
    X-Compile-Source-JDK: 1.6
    X-Compile-Target-JDK: 1.6

    Name: javax/servlet/jsp/
    Specification-Title: Java API for JavaServer Pages
    Specification-Version: 2.2
    Specification-Vendor: Sun Microsystems, Inc.
    Implementation-Title: javax.servlet.jsp
    Implementation-Version: 2.2.FR
    Implementation-Vendor: Apache Software Foundation

    servlet版本是:

    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.8.2
    Created-By: 1.6.0_29-b11 (Sun Microsystems Inc.)
    X-Compile-Source-JDK: 1.6
    X-Compile-Target-JDK: 1.6

    Name: javax/servlet/
    Specification-Title: Java API for Servlets
    Specification-Version: 3.0
    Specification-Vendor: Sun Microsystems, Inc.
    Implementation-Title: javax.servlet
    Implementation-Version: 3.0.FR
    Implementation-Vendor: Apache Software Foundation

  • 相关阅读:
    git 常用命令
    centos 7 mini 安装
    python打印杨辉三角
    python 求100内的素数/质数
    字符串与bytes
    format
    Python字符串格式化
    数据结构
    ARM工作模式
    C语言实现字符串逆序输出
  • 原文地址:https://www.cnblogs.com/caroline4lc/p/4826199.html
Copyright © 2011-2022 走看看