用webwork 2.2.4、sitemesh 2.2.1、freemarker 2.3.8,操作系統為winxp pro sp2.
web.xml配置大致如下:
?1
????
<
filter
>
?2
????????
<
filter-name
>
encodingFilter
</
filter-name
>
?3
????????
<
filter-class
>
com.yninfo.rules.web.util.CharacterEncodingFilter
</
filter-class
>
?4
????????
<
init-param
>
?5
????????????
<
param-name
>
encoding
</
param-name
>
?6
????????????
<
param-value
>
UTF-8
</
param-value
>
?7
????????
</
init-param
>
?8
????????
<
init-param
>
?9
????????????
<
param-name
>
forceEncoding
</
param-name
>
10
????????????
<
param-value
>
true
</
param-value
>
11
????????
</
init-param
>
12
????
</
filter
>
13
????
<
filter
>
14
????????
<
filter-name
>
webwork-cleanup
</
filter-name
>
15
????????
<
filter-class
>
com.opensymphony.webwork.dispatcher.ActionContextCleanUp
</
filter-class
>
16
????
</
filter
>
17
????
<
filter
>
18
????????
<
filter-name
>
sitemesh
</
filter-name
>
19
????????
<
filter-class
>
com.opensymphony.webwork.sitemesh.FreeMarkerPageFilter
</
filter-class
>
20
????
</
filter
>
21
????
<
filter
>
22
????????
<
filter-name
>
webwork
</
filter-name
>
23
????????
<
filter-class
>
com.opensymphony.webwork.dispatcher.FilterDispatcher
</
filter-class
>
24
????
</
filter
>
25
????
<
filter-mapping
>
26
????????
<
filter-name
>
webwork-cleanup
</
filter-name
>
27
????????
<
url-pattern
>
*.ftl
</
url-pattern
>
28
????
</
filter-mapping
>
29
????
<
filter-mapping
>
30
????????
<
filter-name
>
sitemesh
</
filter-name
>
31
????????
<
url-pattern
>
*.ftl
</
url-pattern
>
32
????
</
filter-mapping
>
33
????
<
filter-mapping
>
34
????????
<
filter-name
>
encodingFilter
</
filter-name
>
35
????????
<
url-pattern
>
*.ftl
</
url-pattern
>
36
????
</
filter-mapping
>
37
????
<
filter-mapping
>
38
????????
<
filter-name
>
webwork
</
filter-name
>
39
????????
<
url-pattern
>
*.ftl
</
url-pattern
>
40
????
</
filter-mapping
>
41
????
<
filter-mapping
>
42
????????
<
filter-name
>
webwork
</
filter-name
>
43
????????
<
url-pattern
>
/webwork/*
</
url-pattern
>
44
????
</
filter-mapping
>

?2

?3

?4

?5

?6

?7

?8

?9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

xwork.xml配置如下:
1
????????<action
2
????????????name="index"
3
????????????class="com.opensymphony.xwork.ActionSupport">
4
????????????<result
5
????????????????name="success"
6
????????????????type="freemarker">
7
????????????????<param?name="location">/admin/index.ftl</param>
8
????????????</result>
9
????????</action>
sitemesh 配置如下
2

3

4

5

6

7

8

9

1
????<decorator
2
????????name="admin"
3
????????page="/admin/main.ftl">
4
????????<pattern>/admin/*.ftl</pattern>
5
????</decorator>

2

3

4

5

在tomcat 5.1.17、resin 3.0.19上跑得順順利利的,一移到weblogic 8.1.5上就報錯
?1
####<2006-9-8?上午02時46分44秒?CST>?<Error>?<HTTP>?<www-c1f900a12b2>?<myserver>?<ExecuteThread:?'14'?for?queue:?'weblogic.kernel.Default'>?<<WLS?Kernel>>?<>?<BEA-101104>?<Servlet?execution?in?servlet?context?"ServletContext(id=2664121,name=rules,context-path=/rules)"?failed,?java.net.ProtocolException:?Didn't?meet?stated?Content-Length,?wrote:?'4949'?bytes?instead?of?stated:?'4763'?bytes..
?2
java.net.ProtocolException:?Didn't?meet?stated?Content-Length,?wrote:?'4949'?bytes?instead?of?stated:?'4763'?bytes.
?3
????at?weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength()V(ServletOutputStreamImpl.java:481)
?4
????at?weblogic.servlet.internal.ServletResponseImpl.ensureContentLength()V(ServletResponseImpl.java:1253)
?5
????at?weblogic.servlet.internal.ServletResponseImpl.send()V(ServletResponseImpl.java:1265)
?6
????at?weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(ServletRequestImpl.java:2771)
?7
????at?weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(ExecuteThread.java:224)
?8
????at?weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
?9
????at?java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown?Source)
10
>?

?2

?3

?4

?5

?6

?7

?8

?9

10

折騰了好幾天,各種方式試過,最后還是從sitemesh cvs上下了最新的源碼重新編譯解決問題。