Results 1 to 1 of 1
- 09-28-2010, 10:54 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 50
- Rep Power
- 0
Name was not previously introduced as per JSP.5.3
im training to create a simple jsp form but im getting this exception
Java Code:Name was not previously introduced as per JSP.5.3
this is the jsp code
Java Code:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.beans.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <form action="/orderPizzaJsp/WebContent/order.jsp" method="post"> firstName<input type="text" name="firstName" ><br> lastName<input type="text" name="firstName" ><br> address<input type="text" name="firstName" ><br> phoneNum<input type="text" name="firstName" ><br> <br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form> <% if(request.getMethod().equals("post")){ %> <jsp:useBean id="formHandler" type="bean.com.DataBean" scope="session"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <jsp:getProperty property="formHandler" name="firstName"/> <jsp:getProperty property="formHandler" name="lastName"/> <jsp:getProperty property="formHandler" name="address"/> <jsp:getProperty property="formHandler" name="phoneNum"/> <% } %> </body> </html>
and this is the bean
Java Code:package bean.com; public class DataBean { private String firstName; private String lastName; private String address; private int phoneNum; public DataBean(String firstName, String lastName, String address, int phoneNum) { super(); this.firstName = firstName; this.lastName = lastName; this.address = address; this.phoneNum = phoneNum; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getPhoneNum() { return phoneNum; } public void setPhoneNum(int phoneNum) { this.phoneNum = phoneNum; } }
thanks
miki
Similar Threads
-
[SOLVED] How to display a JTextArea in previously created GUI?
By dan0 in forum New To JavaReplies: 6Last Post: 03-09-2009, 03:02 PM -
how to display a sum of all previously pressed numbers in JTextField?
By all eyes in forum New To JavaReplies: 2Last Post: 03-30-2008, 08:38 PM -
returning to a previously saved view
By gojava in forum Advanced JavaReplies: 0Last Post: 11-09-2007, 05:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks