我正在将旧的旧版应用程序迁移到Tiles 3。
我在磁贴2中找不到以下磁贴2中如何或等效的信息:
org.apache.tiles.TilesApplicationContext
org.apache.tiles.context.ChainedTilesRequestContextFactory
org.apache.tiles.context.TilesRequestContextFactory
org.apache.tiles.context.TilesRequestContext
org.apache.tiles.factory.TilesContainerFactory
org.apache.tiles.preparer.PreparerFactory
org.apache.tiles.reflect.ClassUtil
org.apache.tiles.renderer.AttributeRenderer
org.apache.tiles.renderer.impl.BasicRendererFactory
org.apache.tiles.jsp.context.JspUtil
谁能指出我正确的方向?
例:
public static HttpServletRequest getRequest(TilesRequestContext tilesContext) {
HttpServletRequest request = null;
if (tilesContext != null) {
Object[] requestObjects = tilesContext.getRequestObjects();
......
}
....
return request;
}
“ TilesRequestContext”在哪里
org.apache.tiles.context.TilesRequestContext;
在Tiles 3中不再可用。
Tiles 3中的等效替代品是
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.tiles/tiles-core/2.1.2/org/apache/tiles/context/TilesRequestContext.java
谢谢,
奥列格
最佳答案
TilesRequestContext可从TilesRequestContextHolder的getTilesRequestContext方法获得。
import org.apache.tiles.context.TilesRequestContextHolder;
@Override
public void execute(Request request, AttributeContext attrCntxt) {
TilesRequestContextHolder tilesReqCtxHldr = new TilesRequestContextHolder();
tilesReqCtxHldr.setTilesRequestContext(request);
tilesReqCtxHldr.getTilesRequestContext(); //TilesRequestContext
}