JSF 1.0��2004�N3��3���ɐ��������[�X����܂����ihttp://java.sun.com/j2ee/javaserverfaces/�j�B
���ʂł�JSF 1.0 Early Access 4�iEA4�j�������Ă��܂��B��������e�M���M���̃^�C�~���O��1.0�����������[�X���ꂽ���߁A���ʂł̑Ή��͊Ԃɍ����܂���ł����B
�o�[�W����1.0�����ł̎d�l��EA4�Ƃ͑傫���قȂ��Ă���A�L���ň��������e�ł͐����ł��������Ƃ��ł��܂���B�����ŁA�L���ň������T���v���A�v���P�[�V�����𒆐S�ɕύX�_�������ɂ܂Ƃ߂܂��B
�Ȃ��A�{���_�E�����[�h�R�[�i�[�ɂ́A�ύX��̃T���v���A�v���P�[�V���������J���Ă��܂��̂ŁA�Q�l�ɂ��Ă��������B
EA4�̃T���v����Tomcat 5�n�ł��������Ȃ��悤�Ɏ�������Ă��܂������A�����ł̃T���v���ł͂��ꂪ�C������āATomcat 4�n�ł����삷��悤�ɂȂ��Ă��܂��BEA4�̃`���[�g���A���ł�Servlet 2.3/JSP 1.2�ȏ���T�|�[�g���邱�Ƃ����L����Ă��܂������A����ɂ�Tomcat 5�n���K�v�ł����B
���̃N���X�͕K�v�Ȃ��Ȃ�܂��B
����܂�Action��ActionListener�̔h���N���X�Ƃ��Ď������Ă����r�W�l�X���W�b�N��JavaBeans�Ɉړ����܂��BActionListener�Ɋւ��Ă͂���܂łƎ����g�������ł��܂����AP.65�̐}2�̏����̉ߒ�����I�����邱�Ƃ͂ł��Ȃ��Ȃ�܂��B
Action��ActionListene�̔h���N���X�Ƃ��Ď������Ă����r�W�l�X���W�b�N�͎��̂悤��InquiryBean�N���X�Ɉړ����邱�Ƃ��ł��܂��B
...�i�ȗ��j public class InquiryBean implements Serializable { // (1) InputActionListener�N���X�̎������ړ� public void inputEvent(ActionEvent ev) { } // (2) InputAction�N���X�̎������ړ� public String input() { return "success"; } // (3) ConfirmAction�N���X�̎������ړ� public String confirm() { return "success"; } ...�i�ȉ��ȗ��j
ActionListener�̔h���N���X�iInputActionListener�j�ł́AActionListener�C���^�t�F�[�X��implements�ɋL�q���邱�ƂɂȂ�A����ɏ]���Ă��̃C���^�t�F�[�X�ɒ�`����Ă��郁�\�b�h���I�[�o���C�h����K�v������܂����B
�����łł�ActionListener�C���^�t�F�[�X��implements�ɋL�q����K�v�͂Ȃ��A�C�ӂ̃��\�b�h���ɂ��邱�Ƃ��ł��܂��B�������A��L�\�[�X��(1)�̂悤�Ɉ�����1�p�ӂ��A���̈�����ActionEvent�N���X�ɂ���K�v������܂��B
�ύX�ɂ͋K����������܂��B���Ƃ��Έȉ��̂悤�Ɂg_�h�̌�̉p����啶���ɂ��āA�g_�h�������Čq���܂��B
���ׂẴ^�O�����̋K���ɑ����ĕύX�����킯�ł͂���܂���B�ڂ����͎d�l���m�F���Ă��������B
�{�T���v���ł͒P����<f:use_faces>��<f:view>�ɕύX���邾���œ��삵�܂��B
���t��p�̃J�X�^���^�O���Ȃ��Ȃ�܂��B�ȉ��̂悤�ɂ��āA����q�ɓ��t�̌^�ł��邱�Ƃ��w�肵�܂��B
<h:output_datetime valueRef="InquiryBean.replyDay" formatPattern="yyyy/MM/dd"/>
<h:outputText value="..."> <f:convertDateTime pattern="yyyy/MM/dd"/> </h:outputText>
EA4�ł�JSTL���g�p���ă��\�[�X��ǂݍ���ł��܂������A�����łł�JSF�̃J�X�^���^�O���g�p���܂��B
<fmt:setBundle basename="com.wdpress.jsf.inquiry.Resources" scope="session" var="inquiryBundle"/>
<f:loadBundle basename="com.wdpress.jsf.inquiry.Resources" var="inquiryBundle"/>
EA4�ł̓��[�X�o���h������肷�閼�O�Ƃ��̃��\�[�X���̕�������肷�閼�O��2�̑������w�肷��K�v������܂������A�����łł�EL���g�p����1�̑����Ń��\�[�X����肵�܂��BEL�̕\�L�͂�����ł��i5�Ő����j�B
<h:output_text key="inputName" bundle="inquiryBundle"/>:
<h:outputText value="#{inquiryBundle.inputName}"/>:
�ʏ�AEL�́g${...}�h�Ƃ����悤�Ɂg$�h�Ŏn�܂�\�L�����܂����A�����łł́g#�h���g�p���܂��B���̕ύX�̏ڍׂ�JSF�̎d�l�����Q�Ƃ��Ă��������B
<h:outputText value="#{inquiryBundle.inputName}"/>:
�܂��A����valueRef��EL���L�q���邱�Ƃ������ł����A�S�ʓI�ɂ��̖��O��value�ɕς��X��������܂��B
���͕K�{���`�F�b�N��������@�́A�^�O�̓���q�ł͂Ȃ������Ŏw�肷��悤�ɂȂ�܂��B���͌n�S�ʂɂ����܂��B
<h:input_text id="name" valueRef="InquiryBean.name"> <f:validate_required/> </h:input_text>
<h:inputText id="name" value="#{inquiryBean.name}" required="true"/>
���͕K�{�Ȃǂ̃`�F�b�N���ʂ̃G���[���b�Z�[�W��\������^�O���ς��܂��B�F���w��ł��Ȃ�����ɃX�^�C���V�[�g�̎w�肪�ł���̂ŁA������g�p���ĐF��ݒ肷�邱�ƂɂȂ�ł��傤�B
<h:output_errors for="name" color="red"/>
<h:message for="name"/>
���M�{�^���́A�܂����\�[�X�̓ǂݕ���EL�̋L�q�ɂȂ�܂��B���ɁAAction��ActionListner�̔h���N���X�ւ̂փ}�b�s���O���@��EL���g�p���Ē���JavaBeans�̃��\�b�h�����L�q���܂��B
<h:command_button type="submit" key="confirmButton" bundle="inquiryBundle" commandName="input" actionRef="InquiryBean.input"> <f:action_listener type="com.wdpress.jsf.inquiry.InputActionListener"/> </h:command_button>
<h:commandButton type="submit" value="#{inquiryBundle.confirmButton}" action="#{inquiryBean.input}" actionListener="#{inquiryBean.inputEvent}"/>
���Ƃ��A���̃{�^����Action��InquiryBean�N���X��input()���\�b�h�ɒʒm����܂��B
EA4�̃T���v���ł͓��͕K�{�`�F�b�N�̃G���[���b�Z�[�W���p��ŕ\������܂������A������J�X�^�}�C�Y�ł���悤�ɂȂ�܂��iEA4�ł��ł�����������܂��A�킩��Â炢���̂ł����j�B
���Ƃ��Έȉ��̏ꏊ�Ƀ��b�Z�[�W���\�[�X��u�����Ƃ��l���܂��B
com\wdpress\jsf\inquiry\Messages.properties
faces-config.xml�Ɏ��̐ݒ��lj����܂��B
...�i�ȗ��j <faces-config> <!-- ���b�Z�[�W���\�[�X�̐ݒ� --> <application> <message-bundle>com.wdpress.jsf.inquiry.Messages</message-bundle> <locale-config> <default-locale>ja</default-locale> </locale-config> </application> ...�i�ȗ��j
���Ƃ��A���͕K�{�`�F�b�N�̃G���[���b�Z�[�W���J�X�^�}�C�Y����ꍇ�͎��̂悤�ȓ��e�ɂȂ�܂��inative2ascii�ɂ��G�X�P�[�v�͕K�v�ł��j�B
javax.faces.component.UIInput.REQUIRED=�K�{�ł��B
URL�}�b�s���O��Struts�̂悤�Ɋg���q�Ŏw�肷��悤�ɂȂ�܂��B�����ȋK��͂Ȃ��ł����A���̂悤�ɂ��Ă����̂���ʓI�ƂȂ�ł��傤�BURL�̃t�@�C���������g.faces�h�ŏI���AJSF�ŏ�������邱�ƂɂȂ�܂��B
<!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping>
<!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping>
faces-config.xml�̃^�O���ς��܂����B���ɃT���v���ł͎��̕������ς��܂��B
<navigation-rule> <from-tree-id>/input.jsp</from-tree-id> <navigation-case> <from-outcome>success</from-outcome> <to-tree-id>/confirm.jsp</to-tree-id> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-tree-id>/input.jsp</to-tree-id> </navigation-case> </navigation-rule> <navigation-rule> <from-tree-id>/confirm.jsp</from-tree-id> <navigation-case> <from-outcome>success</from-outcome> <to-tree-id>/thanks.jsp</to-tree-id> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-tree-id>/input.jsp</to-tree-id> </navigation-case> </navigation-rule>
<navigation-rule> <from-view-id>/input.jsp</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/confirm.jsp</to-view-id> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-view-id>/input.jsp</to-view-id> </navigation-case> </navigation-rule> <navigation-rule> <from-view-id>/confirm.jsp</from-view-id> <navigation-case> <from-outcome>success</from-outcome> <to-view-id>/thanks.jsp</to-view-id> </navigation-case> <navigation-case> <from-outcome>failure</from-outcome> <to-view-id>/input.jsp</to-view-id> </navigation-case> </navigation-rule>