* @exception JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException
{
// retrieve component context
ComponentContext compContext = (ComponentContext)pageContext.getAttribute( ComponentConstants.COMPONENT_CONTEXT, pageContext.REQUEST_SCOPE);
if( compContext == null )
throw new JspException ( "Error - tag importAttribute : no tiles context found." );
// set scope
scope = TagUtils.getScope( scopeName, PageContext.PAGE_SCOPE );
// push attribute in requested context.
if( name != null )
{
Object value = compContext.getAttribute(name);
// Check if value exist and if we must send a runtime exception
if( value == null )
if(!isErrorIgnored)
throw new JspException ( "Error - tag importAttribute : property '"+ name + "' not found in context. Check tag syntax" );
else
return SKIP_BODY;
pageContext.setAttribute(name, value, scope);
}
else
{ // set all attributes
Iterator names = compContext.getAttributeNames();
while(names.hasNext())
{
String name = (String)names.next();
pageContext.setAttribute(name, compContext.getAttribute(name), scope);
} // end loop
} // end if
// Continue processing this page
return SKIP_BODY;