if (context == null)
{
throw new ViewHandlerException(Cause.EL_NOT_FOUND);
}
ITextRegionContextResolver resolver =
IStructuredDocumentContextResolverFactory.INSTANCE
.getTextRegionResolver(context);
String elText = null;
if (resolver != null)
{
final String regionType = resolver.getRegionType();
if (regionType != null && resolver.matchesRelative(new String[]
{ DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE }))
{
// if we are in the EL content, then get the current region
// text
if (DOMJSPRegionContexts.JSP_VBL_CONTENT.equals(regionType))
{
elText = resolver.getRegionText();
}
// otherwise, we may be at the end of a content region but
// at
// the beginning of a closing brace so check to see if the
// previous
// region was a VBL_CONTENT
else if (regionType.equals(DOMJSPRegionContexts.JSP_VBL_CLOSE))
{
final IStructuredDocumentContext previousContext =
resolver.getPreviousContext();
final ITextRegionContextResolver prevResolver =
IStructuredDocumentContextResolverFactory.INSTANCE
.getTextRegionResolver(previousContext);
if (prevResolver != null)
{
if (DOMJSPRegionContexts.JSP_VBL_CONTENT
.equals(prevResolver.getRegionType()))
{
resolver = prevResolver;
elText = prevResolver.getRegionText();
}
else if (DOMJSPRegionContexts.JSP_VBL_OPEN
.equals(prevResolver.getRegionType()))
{
elText = ""; //$NON-NLS-1$
}
}
}