JBOSS-7.1 ~ JSF2.0 (CDI1.0) + SPRING 3.1 how to ? using ANNOTATIONS

Hello.
It was not easy for me to start this project!
First, my thanks to mkyong.com, I use his sample for beginig, and after it was not start on my Eclipse (3.7 + JBOSS 7.1) i started to convert it to Annotation version.
Also i found some topics in the Internet (actualy their was only 2) about HOW TO USE CDI+SPRING.
Continue reading

JSF : status of a JavaServer Faces application in the software lifecycle.

Note the use of the context parameter PROJECT_STAGE. This parameter identifies the status of a JavaServer Faces application in the software lifecycle.

The stage of an application can affect the behavior of the application. For example, if the project stage is defined as Development, debugging information is automatically generated for the user. If not defined by the user, the default project stage is Production.

is an example web.xml file, showing this change in bold.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/greeting.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

Простой пример JSF страницы с использованием компонента RichFaces calendar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich">
  <ui:composition template="/templates/component-sample.xhtml">
    <a4j:outputPanel id="calendar" layout="block">
      <rich:calendar value="#{calendarBean.selectedDate}"
       locale="#{calendarBean.locale}"
       popup="#{calendarBean.popup}"
       datePattern="#{calendarBean.pattern}"
       showApplyButton="#{calendarBean.showApply}"
       cellWidth="24px" cellHeight="22px" style="width:200px"/>
    </a4j:outputPanel>
  </ui:composition>
</html>