SupportBean
class as follows:import ilog.views.IlvManager; import ilog.views.IlvManagerView; import java.net.URL; import javax.faces.context.FacesContext; public class SupportBean { private IlvManagerView managerView; public SupportBean() { initManagerView(); } /** * Initializes the manager view with the current ivl file. */ protected void initManagerView() { if (managerView == null) managerView = new IlvManagerView(); URL ivlURL; try { ivlURL = FacesContext.getCurrentInstance().getExternalContext().getResource("/java2d.ivl"); IlvManager manager = managerView.getManager(); manager.setFileName(ivlURL); managerView.fitTransformerToContent(); managerView.setKeepingAspectRatio(true); } catch (Exception e) { e.printStackTrace(); } } /** * Returns the manager view. * @return The manager view. */ public IlvManagerView getView() { return managerView; } }
SupportBean
class loads
the file java2d.ivl located in
the root folder of the Web application and creates a manager view
for this file.<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<managed-bean>
<managed-bean-name>support</managed-bean-name>
<managed-bean-class>SupportBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>