Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
I have a bean
@ManagedBean(name="blog")
@SessionScoped
public class Blog {
private String content;
private static AtomicInteger id = new AtomicInteger(0);
private String idm;
public String addBlog()
{ this.idm = Integer.toString(id.incrementAndGet()); return "view?faces-redirect=true&includeViewParams=true"; }}
This is result view
<h:body>
<f:view>
<f:metadata>
<f:viewParam name="id" value="#
"></f:viewParam>
</f:metadata>
</f:view>
<h:outputText value="#
{blog.content}"></h:outputText>
</h:body>
This works! Changed to following and adding faces-config.xml
public String addBlog()
<navigation-rule>
<navigation-case>
<from-action>#
</from-action>
<from-outcome>ok</from-outcome>
<to-view-id>/view.xhtml</to-view-id>
<redirect include-view-params="true"/>
</navigation-case>
</navigation-rule>
Not working!
What can be the problem? (I think doing some wrong actions!)