use of javax.faces.view.facelets.TagAttributeException in project muikku by otavanopisto.
the class EmbedJSF method apply.
@Override
public void apply(FaceletContext context, UIComponent uiComponent) throws IOException {
String unencoded = (String) jsfString.getObject(context, String.class);
String encoded = Base64.encodeBase64String(unencoded.getBytes());
VariableMapper orig = context.getVariableMapper();
context.setVariableMapper(new VariableMapperWrapper(orig));
try {
this.nextHandler.apply(context, null);
context.includeFacelet(uiComponent, new URL(null, "data://text/plain;base64," + encoded, new DataStreamHandler()));
} catch (IOException e) {
throw new TagAttributeException(this.tag, this.jsfString, "Invalid embedded JSF: " + unencoded);
} finally {
context.setVariableMapper(orig);
}
}
Aggregations