0

I am in the middle of learning jsf.

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

I have a jsf page that passes this form into "addStatus for processing"

The code as follow:

<%-- 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> 

and this is the 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> 

However, when ever i hit the submit button, i will be redirected the addstatus page which does not display a single thing. What am i doing wrong here?

4
  • it displays this as url "localhost:8080/SHS-war/SHS/…" which looks correct but the page is empty. (not content loaded) Commented Mar 22, 2014 at 10:12
  • 1
    While you've a form to submit (data to send to the server side), you should make the transfert's method POST instead of GET. Commented Mar 22, 2014 at 11:30
  • 1
    Which JSF version are you dealing with? The use of scriptlets is totally discouraged and deprecated since 2.0: stackoverflow.com/questions/12330934/… Commented Mar 22, 2014 at 12:47
  • Is it intentional that the second source code finishes with end of comment? --> Commented Mar 22, 2014 at 14:24

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.