JSF servlet,无法传递信息

时间:2014-03-22 10:10:57

标签: java jsf java-ee servlets

我正在学习jsf。

 <form action="addStatus" method="GET">

我有一个jsf页面,将此表单传递给&#34; addStatus进行处理&#34;

代码如下:

<%--
file: AddCustomer.jsp--%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>SecondBankWEB AddCustomer.jsp</title>    </head>
<body>
    <h1>AddCustomer JSP Page</h1>
    <form action="addStatus" method="GET">
        <table>
            <tr>
                <td align="right">Name:</td>
                <td align="left"><input type="text" name="name" length="30"/></td>                    
            </tr>
            <tr>
                <td align="right">Password:</td>
                <td align="left"><input type="text" name="password" length="30"/></td>                    
            </tr>
            <tr>
                <td align="right">Postal:</td>
                <td align="left"><input type="text" name="postal" length="30"/></td>                    
            </tr>

             <tr>
                <td align="right">Phone: </td>
                <td align="left"><input type="text" name="phone" length="30"/></td>                    
            </tr>

             <tr>
                <td align="right">Email: </td>
                <td align="left"><input type="text" name="email" length="30"/></td>                    
            </tr>
        </table>
        <p><input type="submit" value="Submit"/></p>




    </form>

</body> </html>

这是AddStatus.jsf

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>SecondBankWEB AddStatus.jsp</title>
</head>
<body>

    <%
        ArrayList data = (ArrayList)request.getAttribute("data");
    %>

     <table>
        <tr>
            <td align="right">Name:</td>
            <td align="left"><%= (String)data.get(0)%></td>                    
        </tr>
        <tr>
            <td align="right">Password</td>
            <td align="left"><%= (String)data.get(1)%></td>                    
        </tr>


    </table>


    <p>Status: <%= (String)data.get(3)%></p>
    <br>
    <font color=navy>
        <hr>
        <h1>Select Choice <br><br>
            <a href="addCustomer"> Add a Customer</a><br><br>
            <a href="listCustomers"> List customers</a>
        </h1>
     </font> -->
</body>

然而,当我点击提交按钮时,我将被重定向到不显示单个内容的addstatus页面。我在这做错了什么?

0 个答案:

没有答案