{
throw new JspException(_LOG.getMessage(
"FILEDOWNLOADACTIONLISTENER_MUST_INSIDE_UICOMPONENT_TAG"));
}
ELContextTag parentELContext = (ELContextTag)
findAncestorWithClass(this, ELContextTag.class);
Application application =
FacesContext.getCurrentInstance().getApplication();
FileDownloadActionListener listener = new FileDownloadActionListener();
if (_filename != null)
{
if (TagUtils.isValueReference(_filename))
{
String filename = _filename;
if (parentELContext != null)
filename = parentELContext.transformExpression(filename);
listener.setValueBinding(FileDownloadActionListener.FILENAME_KEY,
application.createValueBinding(filename));
}
else
{
listener.setFilename(_filename);
}
}
if (_contentType != null)
{
if (TagUtils.isValueReference(_contentType))
{
String contentType = _contentType;
if (parentELContext != null)
contentType = parentELContext.transformExpression(contentType);
listener.setValueBinding(FileDownloadActionListener.CONTENT_TYPE_KEY,
application.createValueBinding(contentType));
}
else
{
listener.setContentType(_contentType);
}
}
if (TagUtils.isValueReference(_method))
{
String method = _method;
if (parentELContext != null)
method = parentELContext.transformExpression(method);
listener.setMethod(application.createMethodBinding(method,
new Class[]{FacesContext.class, OutputStream.class}));
}
else