Hi All,
I am using liferay grd to get the my entity(Employee) records from the database.But I am getting java.lang.NullPointerException.
But the records are available in the database. I have used the following code as follows.
---------------------------------------------------------------------------------------------------------------------------------
<%
try{
List<com.vam.model.Employee> employeeList = new EmployeePersistenceImpl().findAll();
PortletURL viewURL = renderResponse.createRenderURL();%>
<liferay-ui:search-container iteratorURL="<%= viewURL %>" delta="10" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results total="<%= employeeList.size() %>"
results="<%= ListUtil.subList(employeeList, searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row modelVar="item" className="com.vam.model.Employee">
<liferay-ui:search-container-column-text name="Name" value="<%= item.getName()%>" href=""/>
<liferay-ui:search-container-column-text name="Address" value="<%= item.getAddress()%>" href=""/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%= searchContainer %>" paginate="<%= true %>" />
</liferay-ui:search-container>
<%}
catch(Exception e){
System.out.println("***********Exceptoin raised**************"+e);
}
%>
----------------------------------------------------------------------------------------------
Please reply me ,I have imported all the packages.
Thanks,
Kiran
Please sign in to flag this as inappropriate.