---
title: "struts2配置问题"
author: "Antic8387"
date: "2010-03-01T22:39:38Z"
tags: []
categories: ["企业架构"]
slug: "struts2"
draft: false
lastmod: "2010-03-01T22:39:38Z"
id: 605273
url: "https://antic8387.iteye.com/blog/605273"
---

在学习struts2过程中，遇到一个错误java.lang.ClassNotFoundException: org.apache.struts2.dispacher.FilterDispatcher

   经过一阵子google后，终于解决了该问题。解决过程见下文。

    因为学过struts1.0，最近看企业开发中看重struts2+ext-js技术非常的普遍，研究了一中午，一个简单的小例子都没出来，仔细看了一下错误才知道，原来各种开源框架的支持更新影响的。希望想学struts2的，可以深读这篇文章，吸取教训。

    开发环境：（一定要慎重）

    我用的是最新的struts-2.1.6

    myeclipse 6.5+tomcat6.0（在这一定要是5.5的，并且jdk1.5以上的版本）

    最基本的小程序用到jar包，struts2-core.jar，commons-logging.jar，freemarker.jar，ognl.jar，xwork.jar（注意了，struts2-core-2.1.6.jar时要附加上两个包，commons-fileupload.jar 和 commons-io.jar ）

  struts2过滤器配置:
struts2.0版本:
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

struts2.1版本:
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>