Thursday, July 26, 2012

Various Ways for Navigation in JSF 2(draft)

The example is taken from the Icefaces 3 turorial The file job-applicant.xhtml uses several navigation mechanisms.
  • Use the following:
     <h: button outcome="xyz" .../>
    The web will go directly xyz.xhtml. The URL in the browser is changed to something like ***/xyz.jsf
  • Use the following:
    <h:commandButton action="xyz" ... />
    Go to faces-config.xml to look for the <from-outcome> match for this page. The value in the <to-view-id> tag will be used and the the URL will be changed accordingly.
  • Use the following:
    <h:commandButton action="#{bean.method}" ... />
    Invoke the method of the bean. The return value is a string.
    1. The returned result is the following "abc?faces-redirect=true". In this case, the web will go to abc.xhtml. The URL is changed.
    2. The returned result is the following "abc". In this case, the web will show the content of abc.xhtml. But the URL will not change. So if the current page is xyz.xhtml, the new URL will still be xyz.xhtml instead of abc.xhtml.
    Note that this case of using bean method for the 'action' attribute in h:commandButton is syntactically the same as the case of using string literal for the 'action' attribute in h:commandButton. So maybe the navigation rule is the same. The navigation will first look for the match in faces-config.xml. If a match is not found, then it will just use the value of the 'action' attribute as the page name. It will either redirect to it or forward to it depending on the redirect flag.
  • <h:commandButton listener="#{bean.method}" ... />
    <h:commandButton actionListener="#{bean.method}" ... />
    In these cases, the method returns void. So by default, the page submits to itself. The URL does not change.

Friday, July 13, 2012

Servet, JSF, Weblogic Standards Compliance

The question is can JSF 2 be used in weblogic 10?

The current version of JSF is 2. I think JSF is a layer on top of servlet. So between JSF and the application server, the common ground is the servlet version used. According to this link "", JSF 2.0 is compatible with JavaEE 5 application servers, or any server implementing Servlet 2.5. For weblogic 10.3, it has a list of supported standards. From the link "", it supports Java EE version 5.0 and Java EE servlet version 2.5, 2.4, 2.3, and 2.2. So here the common ground is servlet version 2.5, and it should be OK to use JSF 2 in weblogic 10.3.

The following information from wikipedia is also helpful.

The table below lists major standards supported by WebLogic Server product version.

Standard WLS 7.0 WLS 8.1 WLS 9.0 WLS 10.0 WLS 10.3 WLS 12c
Java 1.3 1.4 5 5 6 (7 in 10.3.6+) 7
Java EE 1.3 1.3 1.4 5 5 6
Servlet 1.2 2.3 2.4 2.5 2.5 3.0
JSP 1.2 1.2 2.0 2.1 2.1 2.2
EJB 2.0 2.0 2.1 3.0 3.0 3.1
JDBC 2.0 2.0 3.0 3.0 3.0 4.0