|
Struts example source code file (StrutsSiteMeshFactory.java)
The Struts StrutsSiteMeshFactory.java source codepackage org.apache.struts2.sitemesh; import com.opensymphony.module.sitemesh.Config; import com.opensymphony.module.sitemesh.factory.DefaultFactory; import org.apache.commons.lang.ObjectUtils; import org.apache.struts2.ServletActionContext; import org.apache.struts2.StrutsStatics; public class StrutsSiteMeshFactory extends DefaultFactory { public StrutsSiteMeshFactory(Config config) { super(config); } /** * Determine whether a Page of given content-type should be parsed or not, avoiding inner action parsing. */ @Override public boolean shouldParsePage(String contentType) { return !isInsideActionTag() && super.shouldParsePage(contentType); } private boolean isInsideActionTag() { Object attribute = ServletActionContext.getRequest().getAttribute(StrutsStatics.STRUTS_ACTION_TAG_INVOCATION); return (Boolean) ObjectUtils.defaultIfNull(attribute, Boolean.FALSE); } } Other Struts examples (source code examples)Here is a short list of links related to this Struts StrutsSiteMeshFactory.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.