Disable oam.Flash.RENDERMAP.TOKEN - jsf-2

I am using Apache MyFaces 2.0. I notice that a cookie oam.Flash.RENDERMAP.TOKEN is getting created for each view, even though I am not using Flash scope and I have set org.apache.myfaces.DISABLE_FLASH_SCOPE=true.
How can I remove the oam.Flash.RENDERMAP.TOKEN cookie?
This is WebSphere specific issue

It's old thread, but it took me a while to find an answer, so I leave this for others... Should be:
org.apache.myfaces.FLASH_SCOPE_DISABLED
not DISABLE_FLASH_SCOPE. So in detail, add:
<context-param>
<param-name>org.apache.myfaces.FLASH_SCOPE_DISABLED</param-name>
<param-value>true</param-value>
</context-param>
to your web.xml.
Works good since 2.0.5.

The issue is fixed with WebSphere Fix Pack V8.0.0.6.
Refer http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg1PM73173

Related

web.xml vs. annotation in Vaadin

I'm using Vaadin 7.4.3, tomcat 8. During the wizard to create Vaadin 7 project in eclipse, it has a checkbox called "Generate web.xml deployment descriptor".
The new way is to use annotation instead of specify it in the web.xml. Are there any configurations that I have to use web.xml because there's no annotation for it? Is it a good practice to always generate the web.xml even if you might not use it for Vaadin 7.1 projects and up?
Thanks
Yes, there are for sure some aspects of app that cannot be configured using annotations (i.e. there is no annotation to state that you want to have your session cookies "http-only" ).
I would recommend you to create web.xml file when it is needed. Sooner or later it would probably will be used, but don't worry too much in advance. It is not a dark magic to create web.xml file in existing project :)

Viewexpiredexception :No save view state could be found for identifier.though i have used client in web.xml

I am developed a tool in JSF,with UI in .xhtml.The tool is working fine in eclipse.Once i deployed in production server i got VIEWEXPIRED exception[no saved view state would be found for the identifier:] often.Once i cleared the cookies and run the tool,the tool was wroking for 70%.
I have used #view scope in managed bean in faces-config.
So i did the changes by
using STATE_SAVING_METHOD as client in web.xml.
Though i deployed and restart the server still I am facing the same issue.
I am sitting with this issue for more than a week.
Anyone help me for solving this issue.
Kindly help me by solving this issue in jsf itself.
Thanks for advance.
Could you please look into this thread(in case if you have missed this link) : [jsf vewexpiredexception][1]
i also faced the same issue. There can be multiple reasons for getting this exception. Scope of the bean should not play a role in this.
Solution 1.Add this code in your web.xml
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>150</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.numberOfLogicalViews</param-name>
<param-value>150</param-value>
</context-param>
default is 15, u can use some higher value.
Solution 2: Add this line to web.xml, Default is server, change it to client
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
For me 1st solution worked.

Images 404 in HTML report after Grails upgrade

We've been using Dynamic Reports directly in our Grails 1.3.7 app with great success. However, when we upgraded to Grails 2.2.4, the images are broken in the HTML view. The hyperlink generated leads to a 404, even for static content such as logos. All the other reports work fine. I am thinking the maybe the image factory servlet needs to be registered in web.xml or something like that. Does anyone have any pointers?
I recommend you to create a new application and to use a visual diff software like meld in order to compare your project directory vs the new application directory. You can find that common files like BuildConfig.groovy or Config.groovy could to need massive corrections. There are another files that you should to review after the migration.
Here is the solution. (Thanks to Ricardo over at DynamicReports help forum!)
The image servlet must indeed be registered in /src/templates/war/web.xml configuration. We did not have to do this in Grails 1.3.7. Hope this helps someone else!
<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/image</url-pattern>
</servlet-mapping>

JSF2 and primefaces 3.4 on Websphere 8

I have created web dynamic project with jsf2, Primefaces 3.4, Tomcat7.Application runs fine. If i deploy the EAR of the same project on Websphere8 instead of Tomcat7, I am getting Exceptions.I am not sure of what is happening. I am new to JSF2 and Wepshere8.
can you provide me the links on how to start sample jsf2 + primefaces project on Websphere 8
Thanks in advance.
Got it. Try to add com.sun.faces.config.ConfigureListener instead of org.apache.myfaces.webapp.StartupServletContextListener in your web.xml, restart your server and then run it.
The code should look like the following.
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
For using different implementations of JSF, the WebSphere Application Server JSF engine determines if the SUN RI or Apache MyFaces is used from the application server run time. After the JSF engine determines the implementation that is used, the correct listener class is registered with the web container. You do not need to add the com.sun.faces.ConfigureListener or the org.apache.myfaces.StartupConfigureListener to the web.xml file.
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/cweb_javaserver_faces.html
Please see above...
I too faced the same problem.
Websphere by default support sun impl and apache myfaces and its jsf 1.2.
To use jsf 2 implementation.
1.Make sure to remove servlet.jar from your application.Its need for tomcat however not in websphere.
2.Change the classloader policy for ear to parent last.Parent last means lib in your app will have higher priority.if not found will load from WAS class path.
3.Also make sure to change the webmodule class loader policy to parent last.
4.Restart websphere.
To solve the classloader of primefaces in websphere 8.5 classes replace the jsf
jsf-api
jsf-impl
javaee-api
for the native implementation of websphere
myfaces-api
myfaces-impl

JSF 2 error handling doesn't work

I'm trying to do a simple forwarding to an error page in a JSF 2 application. The instructions everywhere seem simple enough but it just doesn't work for me. This is what I tried. I put the following in web.xml:
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/pages/error.jsf</location>
</error-page>
I tried an exception-type java.lang.Exception, and I tried using error-code instead of the exception-type. I also tried to name the page (in the above snippet) error.xhtml, and I tried all this with an error.jsp page. Nothing works.
I'm testing this by simply disconnecting the database server so any attempt to log in causes an exception. And it's being displayed on the screen instead of the error page.
I'm using eclipse, tomcat 7, and myfaces 2.1.4. Also in my WEB-INF/lib I have primefaces-3.0.RC2 and prettyfaces-jsf2-3.3.2.
What am I doing wrong / not doing?
Have you shut down the error mechanisms of Facelets? In you web.xml file, you may need to have the following context-param:
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</param-value>
</context-param>
If you also use MyFaces, you need this additional context-param:
<context-param>
<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
<param-value>false</param-value>
</context-param>
This article may be useful to you.
Did you use any managed bean to process the error? If so, have you declared them? Check out this article.

Resources