How to turn off CSS validation warnings generated by Richfaces 4? - jsf-2

I've a custom ecss file in my RichFaces 4 application. This ecss file has some warnings but I'm O.K. with them and don't want to fix this warnings.
I include this ecss file in my pages using;
<h:outputStylesheet name="myTheme.ecss" library="css" />
Everything works well but richfaces generates some warnings in the server log about ecss file.
WARNING: Problem parsing 'css/sws/workstationTheme.ecss' resource: Ignoring the whole rule.
16-Jul-2012 10:26:59 org.richfaces.resource.CompiledCSSResource$ErrorHandlerImpl logException
WARNING: Problem parsing 'css/myTheme.ecss' resource: Error in attribute >selector. >Invalid token "*". Was expecting one of: , "=", "]", "~=", "|=".
Is there a way to turn off this warnings, they appear every time when I access a JSF page so my server log is pretty full with them.
Server: Tomcat 7
JSF Ver. : javax.faces-2.1.8
Rich Faces Ver: 4.2.2

Do you get the warnings when you restart your server? That issue was a JIRA related to hot deployments that was supposedly fixed in 4.2.2.Final. If you set javax.faces.PROJECT_STAGE to Development in web.xml it's supposed to prevent generation of that exception.

Related

Warning messages in GSP: "unknown tag"

I am having bunch of warning messages for "g:" | "asset:" etc, in my GSP files. Also, the content assist is not working in the editor. But if I manually type the code, the file executes properly while running in server. But it is very tedious to code without the content assist for the grails taglib elements and also warning messages are annoying.
Ex Warning in editor: "Unknown Tag (asset:image)"
My configuration is as below:
1. Grails 2.4.0
2. GGTS 3.6.2
I have the grails.tld, with all the grails tags mentioned in the tld, in webapp/web-inf/tld folder but seems GGTS is not able to recognize the tld. I read in various similar questions that we do not have to explicitly specify the taglibs at the top of each GSP page.
Need suggestions on what can be done to resolve the warnings and make the content assist work properly in the editor.

Caching: refreshing external content

in a web project using myFaces 2.1.8, I use the following line of code in a composite component in order to include external content (located at the application server, outside of the webapp-folder):
<ui:include src="file:/#{someSingletonBean.externalContentDir}/#{cc.attrs.externalContentFilename}" />
The FACELETS_REFRESH_PERIOD context param is set to 2 hours.
Changes made to the external content files are however not refreshed until the server gets restarted.
Is there a way to populate these changes to myFaces without restarting the server?
There is a bug recently found and fixed in 2.2.4 that cause the problem. See MYFACES-3890 for details.

Locating Javascript and other resources in modular JSF 2.2.x application

I have a modular JSF application. Facelets are stored in the module in META-INF/resources. I added a custom FaceletsResourceResolver (as demonstrated in this post How to create a modular JSF 2.0 application?) and all of this works well with .xhtml - Files. Now I am trying to add other resources in the same fashion and it's not working.
Let's say I have this structure in the module:
/META-INF/resources
/META-INF/resources/foo
/META-INF/resources/foo/bar.xhtml
/META-INF/resources/foo/bar.js
Now the application resolves /foo/bar.xhtml just fine. But attempts to fetch /foo/bar.js simply fail with 404. I tried using
<h:outputScript library="modulename" name="foo/bar.js" />
as well as direct reference
<script language="text/javascript" src="/context/foo/bar.js"/>
both to no avail. I feel I am missing something. Can someone help me?
PS: using Apache Tomcat 6 and Eclipse-Juno for development.
I'll ignore the fact that the mentioned versions in your question in its current form is confusing. JSF 2.2 (as you tagged) requires a minimum of Servlet 3.0. Tomcat 6 (as you mentioned) is a Servlet 2.5 container (and a quite old one either). This is not going to work together. Also noted should be that the FaceletsResourceResolver which you found there is only necessary when you're using Servlet 2.5 or are using a very early JBoss AS 6 version.
The library name does here not represent the JAR file name, but the subfolder where all of those resources commonly belong to. So when you have a
<h:outputScript library="modulename" name="foo/bar.js" />
then the following structure is expected in the JAR:
/META-INF/resources/modulename
/META-INF/resources/modulename/foo
/META-INF/resources/modulename/foo/bar.xhtml
/META-INF/resources/modulename/foo/bar.js
Alternatively, you can keep your original structure and use
<h:outputScript library="foo" name="bar.js" />
depending on the meaning of the actual value of foo.
See also:
Packaging Facelets files (templates, includes, composites) in a JAR

JSF 2 Mojarra and Primefaces in WebSphere 7+

I have been struggling with the unholy alliance that is WebSphere 7+ and Mojarra 2.0.4 and have run into something of a showstopper.
I followed the directions as specified at this forum post and got Mojarra 2.0.4 initializing properly: http://forum.primefaces.org/viewtopic.php?f=3&t=6860
Basically I created an isolated classloader shared library that refers externally to the Mojarra and Primefaces jars, added the shared library to the webapp and reversed the classloader to go PARENT_LAST. All of that works.
When I attempt to access my web app http://server:port/context/index.xhtml it is hitting the FacesServlet correctly but then instantly the Request Dispatcher is redirecting to index.jsp???
I don't have any JSP specified ANYWHERE in my code, my app, my web.xml, and in fact I specified DEFAULT-SUFFIX to be .xhtml and that didn't help. All my web pages are .xhtml extension and FacesServlet is mapped correctly to *.xhtml.
I have tried adding XHTML as a mime type to WebSphere, disabling the Request Dispatcher, all to no avail. I have been able to get this running correctly on Tomcat 6-7, JBoss 6 and Glassfish 3 with no problems but for some reason WebSphere insists on a JSP file extension?
I appreciate any help you might have.
WAS7 sometimes does not undeploy the web applications properly. Clearing WAS_PROFILE_HOME/temp and WAS_PROFILE_HOME/wstemp may help.

MyEclipse not support jsf2 tags and richfaces 4 tags

I use jsf2 and richfaces4 with myeclipse 8.5
but i find it does not support those tags.
when i enter <h:head> and <h:form>
the ide show an error :
unknow resource
and i enter a4j: then press "alt" + "/", there is no prompt.
how can i config the ide?
Have you taken a look at JBoss Tools 3.2? It supports both JSF 2 and RichFaces 4 - JST/JSF 3.2.0.Beta2 What's New
The problem is probably that you are using the old jar files, which do not have those features. You should try it with new jar files.
Alternatively, the problem is you may have added two jars in lib folder or one in lib and the other is with capabilities.

Resources