码迷,mamicode.com
首页 > 其他好文 > 详细

struts2 第一次使用 404 页面引发的一系列问题

时间:2017-04-17 15:45:09      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:问题   eclipse   不同的   自己   解决问题   ror   nbsp   cep   article   

环境: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包考虑。网上有非常多解决问题的方法,大同小异。可是每一个人和每一个人遇到的情况不同。希望对大家有帮助。

struts2 第一次使用 404 页面引发的一系列问题

标签:问题   eclipse   不同的   自己   解决问题   ror   nbsp   cep   article   

原文地址:http://www.cnblogs.com/lxjshuju/p/6723174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!