JSP cannot detect new added element in java model class

Here is my java model class - CustomerProperty.java

package model; import java.io.InputStream; public class CustomerProperty { public CustomerProperty() { } public int propertyid; public String name; public String phone; public String occupation; public String address1; public String address2; public String postcode; public String city; public String state; public String payment; public InputStream photo; public String agent; public String IDproject; public String[] quickSale; public String ICnumber; public String bag; public String mydate; public int getPropertyid() { return propertyid; } public void setPropertyid(int propertyid) { this.propertyid = propertyid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getICnumber() { return ICnumber; } public void setICnumber(String ICnumber) { this.ICnumber = ICnumber; } public String getICNUMBER() { return ICnumber; } public void setICNUMBER(String ICnumber) { this.ICnumber = ICnumber; } public String getOccupation() { return occupation; } public void setOccupation(String occupation) { this.occupation = occupation; } public String getAddress1() { return address1; } public void setAddress1(String address1) { this.address1 = address1; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public String getPostcode() { return postcode; } public void setPostcode(String postcode) { this.postcode = postcode; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String dateTime) { this.state = dateTime; } public String getPayment() { return payment; } public void setPayment(String payment) { this.payment = payment; } public InputStream getPhoto() { return photo; } public void setPhoto(InputStream photo) { this.photo = photo; } public String getAgent() { return agent; } public void setAgent(String agent) { this.agent = agent; } public String getIDproject() { return IDproject; } public void setIDproject(String IDproject) { this.IDproject = IDproject; } public String[] getQuickSale() { return quickSale; } public void setQuickSale(String[] quickSale) { this.quickSale = quickSale; } public String getMyDate() { return mydate; } public void setMyDate(String mydate) { this.mydate = mydate; }

Whenever my JSP calling this java class, it only can detect the original element. I have added a new element - mydate and it is like forever cannot detect it.

Below is the error code.

pe Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.


org.apache.jasper.JasperException: javax.el.PropertyNotFoundException: The class 'model.CustomerProperty' does not have the property 'mydate'. root cause

javax.el.PropertyNotFoundException: The class 'model.CustomerProperty' does not have the property 'mydate'. note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.0 logs.

I have try to delete the java class and recreate again but still, the JSP only can detect for my first 16 elements and not any new added element.

Any solutions? Thanks

Below is my JSP file code.

<head> <title>Project Sales Report</title> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport"> </head> <body> <p align="center" style="font-family:times;font-size:40pt"><c:out value="${project2.projectName}"/> Sales Report</p> <table align="center" bgcolor="silver" border="1" cellspacing="0" cellpadding="20" class="customer" > <thead> <tr> <th>Unit ID</th> <th>Agent</th> <th>Customer Name</th> <th>IC Number</th> <th>Phone Number</th> <th>Occupation</th> <th>Address 1</th> <th>Address 2</th> <th>Postcode</th> <th>City</th> <th>State</th> <th>Payment Type</th> <th>Receipt</th> </tr> </thead> <tbody> <c:forEach items="${customerdetail}" var="abc"> <tr> <td><c:out value="${abc.propertyid}"/></td> <td><c:out value="${abc.agent}" /></td> <td><c:out value="${abc.name}" /></td> <td><c:out value="${abc.ICnumber}" /></td> <td><c:out value="${abc.phone}" /></td> <td><c:out value="${abc.occupation}" /></td> <td><c:out value="${abc.address1}" /></td> <td><c:out value="${abc.address2}" /></td> <td><c:out value="${abc.postcode}" /></td> <td><c:out value="${abc.city}" /></td> <td><c:out value="${abc.mydate}" /></td> <td><c:out value="${abc.payment}" /></td> </tr> </c:forEach> </tbody> </table> <p>&nbsp;</p> <div align="center"> <button type="button" style="width:70px;">Print</button> <input type="button" value="Back" onClick="history.go(-1); return true;" style="width:70px;"/> </div> </body>

-------------Problems Reply------------

Note your getter setters -

public String mybag() {
return mydate;

public void setmybag(String mydate) {
this.mydate = mydate;

It should be setMydate and getMydate. isn't it ?

Update -

It is case sensative.

public String mydate;

this should be

public String myDate;

Your JSP should be abc.myDate and not abc.mydate

<td><c:out value="${abc.mydate}" /></td>

Category:java Views:0 Time:2018-08-10
Tags: java jsp

Related post

  • why JList doesn't display new added element? 2012-04-27

    I have a panel which contains JList. When i add this panel to west BorderLayout with one element everything is OK and i see one element in it but if i add new element or clear all element i see no effect. Can any body suggest any solution? JPanel cla

  • Django: Adding additional properties to Model Class Object 2009-04-12

    This is using Google App Engine. I am not sure if this is applicable to just normal Django development or if Google App Engine will play a part. If it does, would you let me know so I can update the description of this problem. class MessageModel(db.

  • Checking for a null element with Java Vector class 2012-08-20

    I am building a Heap data structure, but the part that is driving me nuts is checking for a null child value. I am using a Vector, and I am comparing a parent against a child, but if there's only one child the program crashes since something like vec

  • How to set an 'int' Java model property to its original unset state rather than to zero in the App Engine datastore? 2011-06-02

    One of the properties of my Java model class representing a datastore entity, is represented by an int value: int trackedUserId; This value is set to a particular user id during the course of the app's execution. And then at other points I want to re

  • Generating java binding classes using XML file without XSD schema file? Using any Castor or JAXB framework 2011-09-16

    I have a requirement to create java model classes (binding classes) from XML files. Unfortunately I don't have XSD schema. There are many already existing XML's. Strangely , Castor or JAXB both use XSD schema to generate binding model classes. What i

  • Adding elements to ArrayList while using Iterator in Java 2011-11-07

    I had a problem with adding elements to my ArrayList while using an Iterator. In the following code it gives me this output: a k s But still it misses the one I had added through iterator. i.e I am missing r in my output. Is there a way I can add ele

  • DOM : How to detect a new child elements? 2012-01-15

    I want to detect the insertion of a new div element only as a direct child of the parent div. Example: <div id="parent"> <div id="child1"></div> <div id="child2"></div> <div id="newChild">I want this element to be

  • Hook onto the adding of new DOM elements with jQuery (or plain JS) 2009-05-21

    To be clear: I am not asking how to put existing hooks onto new DOM elements. I know about the live() function and the old livequery plugin. I am asking something else. What I want to know is how to hook onto the very creation of new DOM elements. Th

  • adding a new dom element, want to rebind 2009-09-24

    After adding a new DOM element after a ajax request, the click event for the newly added item doesn't work. I tried to first unbind then bind, but I get an error. $(".someclass").unbind("click", someEvent); $(".someclass").bind("click", someEvent); A

  • I want to execute a function when new dom elements are added somewhere in the body 2010-08-09

    I would like to execute a function when new dom elements are added via ajax, somewhere in the body, by a 3er party JS. The function i want to execute is jqueryui's tooltip(), which changes title attribute into nice tooltips. The problem happens when

  • Why cannot use new keyword to initialize abstract class in Java? 2011-09-07

    I have read somewhere that we cannot initialize an interface, for example: interface MyInterface{}; And the following code is definitely illegal: MyInterface m = new MyInterface(); And as I remember the text I have read said: that because the new key

  • Click detection on document's added element 2012-02-23

    I am using currently on my page script which one of it's elements is adding and clicking on different elements like text, divs and images. At the beginning everything is hide using jQuery hide method and only one input is shown. If everytjing is corr

  • Add elements to Arraylist and it replaces all previous elements in Java 2010-03-15

    This question already has an answer here: Why does my ArrayList contain N copies of the last item added to the list? 1 answer I am adding elements to a ArrayList and it adds the first one correctly but then when I add any subsequent elements it wipes

  • Java serialization, UID not changed. Can I add new variables and method to the class? 2010-11-08

    Hi I have a class that is serialised. Now I need to add a new variable into the class, with setter and getter methods. This class is sent over wire in RMI. Without changing the UID, can I add new parameters and getter and setter methods for it? I tri

  • Adding elements to an array? 2009-11-30

    here i am trying to add elements to the array. the elements i am trying to add are text fields, so im basically trying to store persons contact details within the array list? any help would be greatful public void addContact() { ArrayList<String

  • How to detect the current display with Java? 2010-02-10

    I have 2 displays conected, so I can launch my Java application in the primary or secondary display. The question is: how can I know which display contains my app window? Is there a way to detect the current display with Java? --------------Solutions

  • Mixing JSP/HTML any new features or suggestions 2010-05-03

    I guess my questions are not well described. Is this coding style (like the example below) still recommended? Aren't there any new methods of mixing html with jsp? I see some examples with the blockquote < script > < /script >. I guess th

  • trying to update an array element in java 2010-08-25

    I'm trying to update an array element in Java. Some sort of a database like program, but using an array to store data temporarily. The code seems to be working only on the first array element which is 0. If I try to search for other records, it canno

  • Is there a way in jQuery to detected if an element has already a bound event? 2010-12-18

    Is there a way in jQuery to detected if an element already has a bound event ? In other words I want to bind an event only if the element hasn't bound it before.. otherwise I'm triggering it twice. I'm using jQuery 1.2.7 --------------Solutions------

  • adding element to an array 2011-02-25

    How can I add an element to an array where the size of the array is unknown and vectors are prohibited? --------------Solutions------------- If the size of the array is unknown how do you know where to put the element and whether it will fit? Anyway,

  • Tab index for dynamically added elements 2011-03-10

    I have a jsp page with three text boxes and a ADD button beside it. Now I have to set the tabindex for the dynamically added elements. How can I do it? --------------Solutions------------- [As you may have figured out by now, posting code allows some

  • Size-limited queue that holds last N elements in Java 2011-03-31

    A very simple & quick question on Java libraries: is there a ready-made class that implements a Queue with a fixed maximum size - i.e. it always allows addition of elements, but it will silently remove head elements to accomodate space for newly

  • Adding elements to the collection through DataGridView 2011-04-20

    I bounded DataGridView control to the List collection. So, I can edit elements of the collection. Is there any way to enable removing and adding elements to the collection using this grid? --------------Solutions------------- The generic List<T

  • How to setLayoutParams on dynamically added elements on Widget 2011-09-10

    currently, i'm adding elements dynamically to my widget using the following: RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_design); RemoteViews newView = new RemoteViews(context.getPackageName(), R.layout.widget_item);

  • Getting values of dynamically added elements 2011-10-10

    I cannot get the value of my dynamically added elements with jquery. public IEnumerable<GroupDetail> GroupDetaile { get; set; } returns as null! What should I do to get the values? My Model: public class elementmodel { public group MyGroup { ge

Copyright (C) dskims.com, All Rights Reserved.

processed in 1.832 (s). 12 q(s)