zoukankan      html  css  js  c++  java
  • struts2 第一次使用 404 页面引发的一系列问题

    环境:ubuntu  、 eclipse、struts-2.3.24

    问题描写叙述:

    1.  struts2 訪问出现404

    2.  严重: Exception starting filter Struts2

    java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

    解决方法:

    web.xml中的filter内容有发生变化

    能够參考struts2.3.24中自带实例的配置

    正确配置例如以下:

     <filter>
          <filter-name>struts2</filter-name>
          <filter-class>
             org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
          </filter-class>
       </filter>


    之后出现错误二。原因是struts2类中的引入缺少jar此时注意。

    commons-lang-2.4.jar

    commons-lang3-3.2.jar

    在此应该引入第二个(commons-lang3-3.2.jar)。重新启动server,问题解决。

    刚開始使用jsp,第一次使用struts2做开发。和之前自己擅长的php非常多不同的地方,再执行项目时出现故障的时候应该多从web.xml 和 lib中的jar包考虑。网上有非常多解决问题的方法,大同小异。可是每一个人和每一个人遇到的情况不同。希望对大家有帮助。

  • 相关阅读:
    Some bugs in CE6
    WINCE知识点滴
    多个设备共享同一个硬件中断
    磁盘分区详解
    开发串口驱动程序
    CE BSP开发入门之重要的配置文件
    boost pcre Greta RE2 正则表达式性能测试
    Python GIL
    Oracle Instant Client 安装
    C++ 与 python 整数除法差异
  • 原文地址:https://www.cnblogs.com/lxjshuju/p/6723174.html
Copyright © 2011-2022 走看看