---
title: "struts2常见问题"
author: "water84222"
date: "2008-01-10T19:00:54Z"
tags: []
slug: "struts2"
draft: false
lastmod: "2008-01-10T19:00:54Z"
id: 154849
url: "https://onlyLove.iteye.com/blog/154849"
---

这两天重新开始学习struts2。遇到了一些问题，总结一下先。这点问题困扰我好久拉。把我整得也很是郁闷。记下来，可能会有点用。
1、引struts2的jar包时要注意不要把所有的包都引入，那样会出问题。只引这几个包就可以拉。
1)commons-logging-1.0.4.jar
2)freemarker-2.3.8.jar
3)ognl-2.6.11.jar
4)struts2-core-2.0.4.jar
5)xwork-2.0.2.jar
可能版本不一样，反正就是这几个包拉。
2、在struts.xml文件中 如果没有引用<include file="struts-default.xml"></include>时，可能会遇到这样的错误信息，success,input 等等在struts.xml文件中找不到。
validation.xml的命名规则如下
   Action类名-validation.xml(例如：TestAction-validation.xml)，如果只是对某个action的数据校验，那么命名规则即为：Action类名-别名-validation.xml (例如：TestAction-Store-validation.xml)即调用Store方法时进行数据检验