I got this issue for
Für Datei documentviewer/viewer.html.jsf konnte kein Mime-Typ gefunden werden. Fügen Sie eine Mime-Typ-Zuordnung zur web.xml der Anwendung hinzu, um dies aufzulösen.
WEB.XMLRessource .html.jsf aus Bibliothek primefaces-extensions-uncompressed kann nicht gefunden oder bedient werden.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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-app_3_0.xsd"
version="3.0">
<!-- Load custom tag into JSF web application -->
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/my-aktion.taglib.xml</param-value>
</context-param>
<!-- Muss bei Shiro CustomRealm wieder rein <listener> <listener-class>com.application.util.CustomEnvironmentLoaderListener
</listener-class> </listener> -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>3</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>none</param-value>
</context-param>
<!-- WIEDER AKTIVIEREN !!! <context-param> <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE
</param-name> <param-value>true</param-value> </context-param> <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value>
</context-param> <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value> </context-param> -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException
</exception-type>
<location>/common/login.xhtml</location>
</error-page>
<error-page>
<exception-type>java.sql.SQLException</exception-type>
<location>/common/login.xhtml</location>
</error-page>
<error-page>
<exception-type>java.lang.RuntimeException</exception-type>
<location>/common/login.xhtml</location>
</error-page>
<context-param>
<param-name>com.sun.faces.writeStateAtFormEnd</param-name>
<param-value>false</param-value>
</context-param>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<context-param>
<param-name>primefaces.UPLOADER</param-name>
<param-value>commons</param-value>
</context-param>
<context-param>
<param-name>org.primefaces.extensions.DELIVER_UNCOMPRESSED_RESOURCES
</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.primefaces.extensions.WRAP_PRIME_FACES_RESOURCES
</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES
</param-name>
<param-value>primefaces-extensions:primefaces-extensions.js
</param-value>
</context-param>
<!-- Um richtige Uhrzeit anzuzeigen -->
<context-param>
<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE
</param-name>
<param-value>true</param-value>
</context-param>
<!-- Wenn zB prettyfaces betigt wird, dann muss das auch aktiviert sein
<filter-mapping> <filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name> <dispatcher>FORWARD</dispatcher>
</filter-mapping> -->
<!-- START FOR HIBERNATE LAZY EXCEPTION <filter> <filter-name>ConnectionFilter</filter-name>
<filter-class>com.application.util.ConnectionFilter</filter-class> </filter>
<filter-mapping> <filter-name>ConnectionFilter</filter-name> <url-pattern>/faces/*</url-pattern>
</filter-mapping> -->
<!-- END HIBERNATE LAZY EXCEPTION -->
<!-- Start For activate Shrio Muss wieder aktiviert werden, wenn der CustoermEnvironmentLoaderListener
nicht aktiv ist -->
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<!-- End For activate Shrio -->
<filter>
<filter-name>noCacheFilter</filter-name>
<filter-class>com.application.util.NoCacheFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>noCacheFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
<!-- web fonts -->
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>otf</extension>
<mime-type>font/opentype</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/x-font-ttf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/x-font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
</web-app>
JSF Page:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/layout/template.xhtml">
<ui:define name="content">
<h:form id="offerPreviewForm">
<div class="box">
<div class="box-header">
<h2>
<i class="fa fa-user"></i>Vorschau!
</h2>
<div class="box-button">
<p:commandButton value="Speichern" update="@all"
styleClass="btn-success" icon="fa fa-floppy-o"
action="#{offerEditController.doSave}" ajax="true" />
<h:outputText value=" " />
<p:commandButton value="Abbrechen" onclick="history.back();"
icon="fa fa fa-fast-forward" />
</div>
</div>
<div class="box-content">
<pe:documentViewer height="500"
url="/files/test.pdf" />
<f:event listener="#{offerPreviewController.previewOffer}"
type="preRenderView" />
<pe:documentViewer height="500"
value="#{offerPreviewController.previewContentFile}" />
</div>
</div>
</h:form>
</ui:define>
</ui:composition>