Archive

Archive for the ‘JSF’ Category

Charts in JSF

February 9, 2010 Leave a comment
Categories: JSF

SEVERE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent

February 4, 2010 Leave a comment

I was using JSF and trying to refresh data automatically using ajax4jsf.

Scenario & Problem :

1. Server is started and the dashboard.seam page is viewed.
2. Now stop the server and do not close the browser…
3. Now restart the server,  following error is getting displayed on the server console.

SEVERE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent
Feb 4, 2010 12:07:37 PM org.jboss.seam.web.ExceptionFilter doFilter
WARNING: handling uncaught exception
javax.servlet.ServletException: viewId:/dashboard.seam – View /dashboard.seam could not be restored.
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:532)

Caused by: javax.faces.application.ViewExpiredException: viewId:/dashboard.seam – View /dashboard.seam could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:186)

Feb 4, 2010 12:07:37 PM org.jboss.seam.web.ExceptionFilter doFilter
WARNING: exception root cause
javax.faces.application.ViewExpiredException: viewId:/dashboard.seam – View /dashboard.seam could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:186)

Feb 4, 2010 12:07:37 PM org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter
SEVERE: Exception in the filter chain
javax.servlet.ServletException: viewId:/dashboard.seam – View /dashboard.seam could not be restored.

Solution :

1. Once the server is stopped,  the page that is trying to get the fresh data should also be closed. Otherwise the page will try to get the data and will throw the above error will occur.
2. Once the server is started, now refresh the previously opened page.

Regards,

Ram

Categories: Jboss Seam, JSF

JSF Validation – restricting minimum and maximum length for a textarea

April 11, 2009 Leave a comment

Restricting text length in textarea in JSF can be done as below.  Here we restrict the maximum length to be 390 and the minimum length to be 10. Please note that these restrictions will be applied only when the required attribute is true.

      <h:inputTextarea  required=”true” cols=”70″ rows=”9″ id=”message” value=”#{inviteaction.message}”>
          <f:validateLength maximum=”390″ minimum=”10″/>
    </h:inputTextarea>

where f and h namespaces are configured as 

  xmlns:h=”http://java.sun.com/jsf/html&#8221;
  xmlns:f=”http://java.sun.com/jsf/core&#8221;

Categories: JSF