if (!empty($_SERVER['HTTP_CLIENT_IP']))
$ip=$_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
else
$ip=$_SERVER['REMOTE_ADDR'];
?>
ZK Pivottable is a data summarizing component; taking a flat table as raw data and organizes the data into desired categories arranged by columns and rows. It brings the power of spreadsheet’s pivot table functionality to Java web applications.
This blog post will demonstrate how ZK Pivottable can be used inside a JSP page.
Live Demo
Setting up the environment
Before using ZK Pivottable in your JSP pages, the web application would need some libraries installed. web.xml would also need to be configured to include a special servlet to handle the AJAX interactions with the pivottable component. Please refer to this article for more details.
Embedding Pivottable inside a JSP page
Here is a sample JSP page that uses ZK Pivottable. For brevity, only the relevant lines are shown.
ZK Pivottable is utilized inside a JSP page via JSP custom tags. Please read here for more information on working with JSP tags defined by ZK.
Embedding ZK Pivottable inside a JSP page is only half the story. Without data, the pivottable is pretty much useless. Hence, a controller class would also need to be written. This article describes what the controller class might look like.
The complete source code for a sample application is available on github.
cannot find taglibrary descriptor for “http://www.zkoss.org/jsp/zul”
Where should I add tag library descriptor?
am using Spring mvc maven project
Hello Sreevidya,
You can insert zuljsp dependency into your maven project by referring to http://books.zkoss.org/wiki/ZK%20JSP%20Tags%20Essentials/Installation.