默認情況下
如果需要修改struts
Struts
[html]
struts
org
struts
/*
struts
org
struts
/*
為了弄清Stuts
[java] package org
/**
* Handles both the preparation and execution phases of the Struts dispatching process
* when you don
*/
public class StrutsPrepareAndExecuteFilter implements StrutsStatics
protected PrepareOperations prepare;
protected ExecuteOperations execute;
protected List excludedPatterns = null;
public void init(FilterConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
try {
FilterHostConfig config = new FilterHostConfig(filterConfig);
init
Dispatcher dispatcher = init
init
prepare = new PrepareOperations(filterConfig
execute = new ExecuteOperations(filterConfig
this
postInit(dispatcher
} finally {
init
}
}
/**
* Callback for post initialization
*/
protected void postInit(Dispatcher dispatcher
}
public void doFilter(ServletRequest req
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
prepare
prepare
prepare
if ( excludedPatterns != null && prepare
chain
} else {
request = prepare
ActionMapping mapping = prepare
if (mapping == null) {
boolean handled = execute
if (!handled) {
chain
}
} else {
execute
}
}
} finally {
prepare
}
}
public void destroy() {
prepare
}
}
package org
/**
* Handles both the preparation and execution phases of the Struts dispatching process
* when you don
*/
public class StrutsPrepareAndExecuteFilter implements StrutsStatics
protected PrepareOperations prepare;
protected ExecuteOperations execute;
protected List excludedPatterns = null;
public void init(FilterConfig filterConfig) throws ServletException {
InitOperations init = new InitOperations();
try {
FilterHostConfig config = new FilterHostConfig(filterConfig);
init
Dispatcher dispatcher = init
init
prepare = new PrepareOperations(filterConfig
execute = new ExecuteOperations(filterConfig
this
postInit(dispatcher
} finally {
init
}
}
/**
* Callback for post initialization
*/
protected void postInit(Dispatcher dispatcher
}
public void doFilter(ServletRequest req
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
try {
prepare
prepare
prepare
if ( excludedPatterns != null && prepare
chain
} else {
request = prepare
ActionMapping mapping = prepare
if (mapping == null) {
boolean handled = execute
if (!handled) {
chain
}
} else {
execute
}
}
} finally {
prepare
}
}
public void destroy() {
prepare
}
}可以看到
[html]
struts
org
filterConfig
classpath:struts
struts
/*
struts
org
filterConfig
classpath:struts
struts
/*
這樣配置後
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28733.html