Not able to fetch all json response from server <p>I want to fetch json response from server for that I am using following code</p> <pre class="lang-java prettyprint-override"><code>public class AtomAddressDetail implements java.io.Serializable { private Long id; private Place placeByStateId; private Atom atom; private Place placeByCountryId; private Place placeByCityId; private Place placeByStreetId; private Place placeByAreaId; private String houseno; //getter and setter } public class Place implements java.io.Serializable { private Long id; private String name; private String about; //getter and setter } </code></pre> <p>In action</p> <pre class="lang-java prettyprint-override"><code>public class SettingAction extends ActionSupport { private long pageId; //getter and setter private long id; //getter and setter private List&lt;AtomAddressDetail&gt; atomAddressList; public String singleAddress() { setAtomAddressList(cdao.singleAddress(getId(), getPageId())); for (AtomAddressDetail a : getAtomAddressList()) { System.out.println("Country " + a.getPlaceByCountryId().getId() + " " + a.getPlaceByCountryId().getName()); System.out.println("state " + a.getPlaceByStateId().getId() + " " + a.getPlaceByStateId().getName()); System.out.println("city " + a.getPlaceByCityId().getId() + " " + a.getPlaceByCityId().getName()); System.out.println("area " + a.getPlaceByAreaId().getId() + " " + a.getPlaceByAreaId().getName()); System.out.println("street " + a.getPlaceByStreetId().getId() + " " + a.getPlaceByStreetId().getName()); } } public List&lt;AtomAddressDetail&gt; getAtomAddressList() { return atomAddressList; } public void setAtomAddressList(List&lt;AtomAddressDetail&gt; atomAddressList) { this.atomAddressList = atomAddressList; } } </code></pre> <p>Output:</p> <pre><code>Country 2 India state 3 asdf city 4 sdfsd area 5 www street 6 sdfdsa f </code></pre> <p>In <code>struts.xml</code></p> <pre class="lang-xml prettyprint-override"><code>&lt;action name="SingleAddressDetail" class=".SettingAction" method="singleAddress"&gt; &lt;result name="success" type="json"&gt; &lt;param name="includeProperties"&gt; ^atomAddressList\[\d+\]\.id, ^atomAddressList\[\d+\]\.houseno, ^atomAddressList\[\d+\]\.placeByAreaId.id, ^atomAddressList\[\d+\]\.placeByAreaId.name, ^atomAddressList\[\d+\]\.placeByCityId.id, ^atomAddressList\[\d+\]\.placeByCityId.name, ^atomAddressList\[\d+\]\.placeByStateId.id, ^atomAddressList\[\d+\]\.placeByStateId.name, ^atomAddressList\[\d+\]\.placeByCountryId.id, ^atomAddressList\[\d+\]\.placeByCountryId.name &lt;/param&gt; &lt;param name="excludeNullProperties"&gt;true&lt;/param&gt; &lt;param name="root"&gt; #action &lt;/param&gt; &lt;/result&gt; &lt;result name="input" type="json"/&gt; &lt;result name="login" type="json"&gt;&lt;/result&gt; &lt;/action&gt; </code></pre> <p>In JSP</p> <pre class="lang-jsp prettyprint-override"><code>{"atomAddressList":[{"houseno":"sadf sadf ","id":1}]} </code></pre> <p>Problem is in JSP page I am getting only two filds value but I want to fetch all values that are specified in <code>struts.xml</code>'s action.</p> <p>Values are printed in action properly as mentioned but on accessing in JSP like <code>alert(data.atomAddressList[0].placeByCountryId.id);</code> it is showing </p> <pre><code>error:Uncaught TypeError: Cannot read property 'id' of undefined </code></pre>