本文整理汇总了Java中org.apache.struts.tiles.TilesUtil类的典型用法代码示例。如果您正苦于以下问题:Java TilesUtil类的具体用法?Java TilesUtil怎么用?Java TilesUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TilesUtil类属于org.apache.struts.tiles包,在下文中一共展示了TilesUtil类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processAsDefinitionOrURL
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Try to process name as a definition, or as an URL if not found.
* @param name Name to process.
* @return appropriate TagHandler
* @throws JspException InstantiationException Can't create requested controller
*/
public TagHandler processAsDefinitionOrURL(String name)
throws JspException {
try {
ComponentDefinition definition =
TilesUtil.getDefinition(
name,
pageContext.getRequest(),
pageContext.getServletContext());
if (definition != null) {
return processDefinition(definition);
}
} catch (DefinitionsFactoryException ex) {
// silently failed, because we can choose to not define a factory.
}
// no definition found, try as url
return processUrl(name);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:InsertTag.java
示例2: doStartTag
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Do start tag.
*/
public int doStartTag() throws JspException
{
DefinitionsFactory factory = TilesUtil.getDefinitionsFactory(pageContext.getRequest(),pageContext.getServletContext());
if(factory != null )
return SKIP_BODY;
DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
factoryConfig.setFactoryClassname( classname );
factoryConfig.setDefinitionConfigFiles( filename );
try
{
factory = TilesUtil.createDefinitionsFactory(pageContext.getServletContext(), factoryConfig);
}
catch( DefinitionsFactoryException ex )
{
ex.printStackTrace();
throw new JspException( ex.getMessage() + " See console for details" );
}
return SKIP_BODY;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:InitDefinitionsTag.java
示例3: execute
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Process the specified HTTP request, and create the corresponding HTTP
* response (or forward to another web component that will create it),
* with provision for handling exceptions thrown by the business logic.
*
* @param mapping The ActionMapping used to select this instance
* @param form The optional ActionForm bean for this request (if any)
* @param request The HTTP request we are processing
* @param response The HTTP response we are creating
*
* @exception Exception if the application business logic throws
* an exception
* @since Struts 1.1
*/
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
response.setContentType("text/plain");
PrintWriter writer = response.getWriter();
try {
ServletContext context = getServlet().getServletContext();
DefinitionsFactory factory = TilesUtil.getDefinitionsFactory(request, context );
writer.println( factory.toString() );
} catch (Exception e) {
writer.println("FAIL - " + e.toString());
getServlet().log("ReloadAction", e);
}
writer.flush();
writer.close();
return (null);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:ViewDefinitionsAction.java
示例4: processAsDefinitionOrURL
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Try to process name as a definition, or as an URL if not found.
* @param name Name to process.
* @return appropriate TagHandler
* @throws JspException InstantiationException Can't create requested controller
*/
public TagHandler processAsDefinitionOrURL(String name)
throws JspException {
try {
ComponentDefinition definition =
TilesUtil.getDefinition(
name,
pageContext.getRequest(),
pageContext.getServletContext());
if (definition != null) {
return processDefinition(definition);
}
} catch (DefinitionsFactoryException ex) {
// silently failed, because we can choose to not define a factory.
}
// no definition found, try as url
return processUrl(name);
}
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:27,代码来源:InsertTag.java
示例5: doStartTag
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Do start tag.
*/
public int doStartTag() throws JspException
{
DefinitionsFactory factory =
TilesUtil.getDefinitionsFactory(pageContext.getRequest(),
pageContext.getServletContext());
if(factory != null )
return SKIP_BODY;
DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
factoryConfig.setFactoryClassname( classname );
factoryConfig.setDefinitionConfigFiles( filename );
try
{
factory = TilesUtil.createDefinitionsFactory(
pageContext.getServletContext(), factoryConfig);
}
catch( DefinitionsFactoryException ex )
{
ex.printStackTrace();
throw new JspException( ex );
}
return SKIP_BODY;
}
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:28,代码来源:InitDefinitionsTag.java
示例6: execute
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Process the specified HTTP request, and create the corresponding HTTP
* response (or forward to another web component that will create it),
* with provision for handling exceptions thrown by the business logic.
*
* @param mapping The ActionMapping used to select this instance
* @param form The optional ActionForm bean for this request (if any)
* @param request The HTTP request we are processing
* @param response The HTTP response we are creating
*
* @exception Exception if the application business logic throws
* an exception
* @since Struts 1.1
*/
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
response.setContentType("text/plain");
PrintWriter writer = response.getWriter();
try {
ServletContext context = getServlet().getServletContext();
DefinitionsFactory factory =
TilesUtil.getDefinitionsFactory(request, context );
writer.println( factory.toString() );
} catch (Exception e) {
writer.println("FAIL - " + e.toString());
getServlet().log("ReloadAction", e);
}
writer.flush();
writer.close();
return (null);
}
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:40,代码来源:ViewDefinitionsAction.java
示例7: doInclude
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Do an include of specified page.
* This method is used internally to do all includes from this class. It delegates
* the include call to the TilesUtil.doInclude().
* @param page The page that will be included
* @throws ServletException - Thrown by call to pageContext.include()
* @throws IOException - Thrown by call to pageContext.include()
*/
protected void doInclude(String page)
throws ServletException, IOException {
TilesUtil.doInclude(page, pageContext);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:InsertTag.java
示例8: doInclude
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Do an include of specified page.
* This method is used internally to do all includes from this class. It delegates
* the include call to the TilesUtil.doInclude().
* @param page The page that will be included
* @param flush If the writer should be flushed before the include
* @throws ServletException - Thrown by call to pageContext.include()
* @throws IOException - Thrown by call to pageContext.include()
*/
protected void doInclude(String page, boolean flush)
throws ServletException, IOException {
TilesUtil.doInclude(page, pageContext, flush);
}
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:14,代码来源:InsertTag.java
示例9: createDefinitionsFactory
import org.apache.struts.tiles.TilesUtil; //导入依赖的package包/类
/**
* Create the Tiles DefinitionsFactory and expose it to the ServletContext.
* @param factoryConfig the configuration for the DefinitionsFactory
* @return the DefinitionsFactory
* @throws DefinitionsFactoryException if an error occurs
*/
protected DefinitionsFactory createDefinitionsFactory(DefinitionsFactoryConfig factoryConfig)
throws DefinitionsFactoryException {
return TilesUtil.createDefinitionsFactory(getServletContext(), factoryConfig);
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:12,代码来源:TilesConfigurer.java
注:本文中的org.apache.struts.tiles.TilesUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论