JSF 1.2表单,在点击提交时不会呈现任何内容

时间:2013-02-28 20:10:39

标签: html jsf

点击提交时,不会呈现任何内容。我想因为我拥有的所有<div>标签。我错过了一些<h:form>代码吗?我是否必须为每个div标签提供<h:form>标签?

<f:view>

    <body>

    <h:form id="mainform" onkeypress="enterForm()">

            <div id="header">
            <center>
                <h1><span id="lblPageTitle" class="PrimaryTitle">Question</span><span class="gray">Administration</span></h1>
                <hr id="titlehr"></hr>
            </center>


            </div> 

        <div  id="menu">
            <ul>
                <li id="current"><a href="index.html">Home</a></li>
                <li><a href="index.html">Archives</a></li>
                <li><a href="index.html">Downloads</a></li>
                <li><a href="index.html">Services</a></li>
                <li><a href="index.html">Support</a></li>
                <li><a href="index.html">About</a></li>     
            </ul>
        </div>  

        <div id="content-wrap">

            <div id="sidebar" align="left">

                <h1>Sidebar Menu</h1>
                <div class="left-box">
                    <ul class="sidemenu">               
                        <li><a href="AddQuestion.jsp">Add Question</a></li>
                        <li><a href="ModiftQuestion.jsp">Modify Question</a></li>
                        <li><a href="RemoveQuestion.jsp">Remove Question</a></li>

                    </ul>   
                </div>
        </div>

            <table border="0" width="100%" cellpadding="0" cellspacing="0">

                <tr>
                    <td colspan="2">
                        <table>
                            <tr>
                                <td align="right" valign="baseline" width="200"><h:outputLabel
                                        for="name" value="First Name:" /></td>
                                <td align="left" valign="baseline"><h:inputText id="name"
                                        value="#{addQuestionBean.fname }" >

                                        </h:inputText>
                                </td>

                            </tr>
                            <tr>    
                                <td align="right" valign="baseline" width="200"><h:outputLabel
                                        for="lname" value="Last Name:" /></td>
                                <td align="left" valign="baseline"><h:inputText id="lname"
                                        value="#{addQuestionBean.lname }" >

                                        </h:inputText>
                                </td>

                            </tr>

                            <tr>    
                                <td align="right" valign="baseline" width="200"><h:outputLabel
                                        for="ssn" value="Social Security:" /></td>
                                <td align="left" valign="baseline"><h:inputText id="ssn"
                                        value="#{addQuestionBean.ssn }" >

                                        </h:inputText>
                                </td>

                            </tr>

                            <tr>    
                                <td align="right" valign="baseline" width="200"><h:outputLabel
                                        for="mail" value="Email:" /></td>
                                <td align="left" valign="baseline">
                                <h:inputText id="mail" value="#{addQuestionBean.email}" required="true">
                                <f:validator validatorId="emailValidator" />
                                </h:inputText>
                                </td>

                            </tr>

                        </table>
                        <br>
                        </td>
                </tr>
                </table>
            </div>  

            <br>    
                <TABLE width="100%">

                <tbody>
                    <tr>

                        <td align="center"><center><h:commandButton type="submit" id="SUBMIT"
                                value="SUBMIT" styleClass="commandButton"
                                action="#{addQuestionBean.doSubmit }">

                            </h:commandButton> <h:commandButton id="CANCEL" value="CANCEL"
                                action="#{addQuestionBean.doCancel }" type="submit">

                            </h:commandButton></center></td>
                        </tr>
                </tbody>

                </TABLE>

        </h:form>

        <center><b><jsp:include page="footer.jsp" flush="true"></jsp:include></b></center>


    </body>

</f:view>

0 个答案:

没有答案