Java JSF应用程序(使用JSF 2.2和Primefaces 6)不允许呈现单选按钮和复选框的“复选标记”图标和“填充选项”。 我将Primefaces组件用于单选按钮和复选框。 服务器是Tomee 7
如我所见,chrome尝试渲染http://localhost:9090/javax.faces.resource/images/ui-icons_212121_256x240.png.xhtml?ln=primefaces-hsd-web-sqr4
但应该是
我尝试了不同的浏览器。同样的错误。
Server xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
--><Server port="9005" shutdown="SHUTDOWN">
<!-- TomEE plugin for Tomcat -->
<Listener className="org.apache.tomee.catalina.ServerListener"/>
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener"/>
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector connectionTimeout="20000" port="9090" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="9009" protocol="AJP/1.3" redirectPort="8443"/>
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine defaultHost="localhost" name="Catalina">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="HSD" path="/" reloadable="true" source="org.eclipse.jst.jee.server:HSD"/></Host>
</Engine>
</Service>
</Server>
--------
web xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>xxxx</display-name>
<security-constraint>
<web-resource-collection>
<web-resource-name>hsd</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminAdminTools</role-name>
<role-name>HsdAdminManageUsers</role-name>
<role-name>ClientAdmin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>hsd</web-resource-name>
<url-pattern>/loginError.xhtml</url-pattern>
<url-pattern>/index.xhtml</url-pattern>
<url-pattern>/forget_me.xhtml</url-pattern>
<url-pattern>/forgot_password.xhtml</url-pattern>
<url-pattern>/error.xhtml</url-pattern>
<url-pattern>/javax.faces.resource/*</url-pattern>
<url-pattern>/resources/*</url-pattern>
<url-pattern>/take_survey/*</url-pattern>
</web-resource-collection>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>hsd</web-resource-name>
<url-pattern>/answer_security_question.xhtml</url-pattern>
<url-pattern>/home.xhtml</url-pattern>
<url-pattern>/reset_password.xhtml</url-pattern>
<url-pattern>/setup_security_questions.xhtml</url-pattern>
<url-pattern>/help/general_help.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdDataEntry</role-name>
<role-name>Interviewer</role-name>
<role-name>SuperInterviewer</role-name>
<role-name>HsdAdminManageSurveys</role-name>
<role-name>HsdAdminManageRespondents</role-name>
<role-name>HsdAdminDataEntry</role-name>
<role-name>HsdAdminUploadData</role-name>
<role-name>HsdAdminEditResponses</role-name>
<role-name>HsdAdminReports</role-name>
<role-name>HsdAdminUploadReportFiles</role-name>
<role-name>HsdAdminManageUsers</role-name>
<role-name>HsdAdminAdminTools</role-name>
<role-name>ClientAdmin</role-name>
<role-name>ClientReports</role-name>
<role-name>ClientRespondentRegistration</role-name>
<role-name>Translator</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>admin</web-resource-name>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminAdminTools</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>users</web-resource-name>
<url-pattern>/users/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminManageUsers</role-name>
<role-name>ClientAdmin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>respondents</web-resource-name>
<url-pattern>/respondents/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Interviewer</role-name>
<role-name>SuperInterviewer</role-name>
<role-name>HsdAdminManageRespondents</role-name>
<role-name>ClientRespondentRegistration</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>reports</web-resource-name>
<url-pattern>/reports/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminReports</role-name>
<role-name>ClientReports</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>surveys</web-resource-name>
<url-pattern>/surveys/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminManageSurveys</role-name>
<role-name>HsdAdminDataEntry</role-name>
<role-name>HsdDataEntry</role-name>
<role-name>ClientAdmin</role-name>
<role-name>ClientRespondentRegistration</role-name>
<role-name>Interviewer</role-name>
<role-name>SuperInterviewer</role-name>
<role-name>Translator</role-name>
<role-name>HsdAdminAdminTools</role-name>
<role-name>HsdAdminManageUsers</role-name>
<role-name>HsdAdminUploadReportFiles</role-name>
<role-name>HsdAdminEditResponses</role-name>
<role-name>HsdAdminUploadData</role-name>
<role-name>HsdAdminManageRespondents</role-name>
<role-name>HsdAdminReports</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>dataEntry</web-resource-name>
<url-pattern>/dataEntry/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminDataEntry</role-name>
<role-name>HsdDataEntry</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>responses</web-resource-name>
<url-pattern>/responses/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminEditResponses</role-name>
<role-name>Translator</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>reportFiles</web-resource-name>
<url-pattern>/reportFiles/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminUploadReportFiles</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>internalReports</web-resource-name>
<url-pattern>/internal_reports/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>SuperInterviewer</role-name>
<role-name>HsdAdminManageSurveys</role-name>
<role-name>HsdAdminDataEntry</role-name>
<role-name>HsdDataEntry</role-name>
<role-name>HsdAdminAdminTools</role-name>
<role-name>HsdAdminManageUsers</role-name>
<role-name>HsdAdminUploadReportFiles</role-name>
<role-name>HsdAdminEditResponses</role-name>
<role-name>HsdAdminUploadData</role-name>
<role-name>HsdAdminManageRespondents</role-name>
<role-name>HsdAdminReports</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>uploadData</web-resource-name>
<url-pattern>/uploadData/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>HsdAdminUploadData</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>HsdAdminManageSurveys</role-name>
</security-role>
<security-role>
<role-name>HsdAdminAdminTools</role-name>
</security-role>
<security-role>
<role-name>HsdAdminManageUsers</role-name>
</security-role>
<security-role>
<role-name>HsdAdminManageRespondents</role-name>
</security-role>
<security-role>
<role-name>HsdAdminEditResponses</role-name>
</security-role>
<security-role>
<role-name>HsdAdminUploadReportFiles</role-name>
</security-role>
<security-role>
<role-name>HsdAdminUploadData</role-name>
</security-role>
<security-role>
<role-name>HsdAdminDataEntry</role-name>
</security-role>
<security-role>
<role-name>HsdDataEntry</role-name>
</security-role>
<security-role>
<role-name>Translator</role-name>
</security-role>
<security-role>
<role-name>Interviewer</role-name>
</security-role>
<security-role>
<role-name>SuperInterviewer</role-name>
</security-role>
<security-role>
<role-name>HsdAdminReports</role-name>
</security-role>
<security-role>
<role-name>ClientAdmin</role-name>
</security-role>
<security-role>
<role-name>ClientReports</role-name>
</security-role>
<security-role>
<role-name>ClientRespondentRegistration</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/index.xhtml</form-login-page>
<form-error-page>/loginError.xhtml</form-error-page>
</form-login-config>
</login-config>
<error-page>
<location>/error.xhtml</location>
</error-page>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
<welcome-file>loginError.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<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>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</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>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.WEBAPP_RESOURCES_DIRECTORY</param-name>
<param-value>/resources</param-value>
</context-param>
<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>primefaces.THEME</param-name>
<param-value>hsd-web-sqr4</param-value>
</context-param>
<context-param>
<param-name>primefaces.UPLOADER</param-name>
<param-value>auto</param-value>
</context-param>
<context-param>
<param-name>primefaces.FONT_AWESOME</param-name>
<param-value>true</param-value>
</context-param>
<session-config>
<session-timeout>120</session-timeout>
<cookie-config>
<http-only>true</http-only>
</cookie-config>
</session-config>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>
<mime-mapping>
<extension>docx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.wordprocessingml.document</mime-type>
</mime-mapping>
</web-app>
Please advise.