01: package com.technoetic.xplanner.tags;
02:
03: import org.apache.struts.tiles.ComponentContext;
04: import org.apache.struts.taglib.tiles.ComponentConstants;
05:
06: import javax.servlet.jsp.PageContext;
07: import javax.servlet.jsp.JspException;
08:
09: public class TilesHelper {
10: public static Object getAttribute(String name,
11: PageContext pageContext) throws JspException {
12: ComponentContext compContext = (ComponentContext) pageContext
13: .getAttribute(ComponentConstants.COMPONENT_CONTEXT,
14: PageContext.REQUEST_SCOPE);
15:
16: if (compContext == null) {
17: throw new JspException(
18: "Error - tag.getAttribute : component context is not defined. Check tag syntax");
19: }
20:
21: return compContext.getAttribute(name);
22: }
23: }
|