Sunday, March 30, 2014

ZK MVVM Command Data -- Loose Coupling More


Introduction

ZK MVVM already support Parameter of Command, it slightly increased the coupling since it bind the data with "parameter names", means you need to update both .zul and .java files if you want to change the naming.

This article describe a way to reduce the coupling, it bind the data with event name (instead of parameter names) with a custom component tag and retrieve command data by EventInterceptor.

Note:
Please ignore the implementation detail when you look into this sample, they are not the important part here and can be replaced by any other implementation (e.g. implemented by ZK MVVM mechanism itself in the future).
The only key point is "bind data with event name instead of parameter names".

Pre-request

ZK Create Helper Tag to Make Programmer Happier

Demo



Program

index.zul

TestVM.java

Item.java

Cparam.java

ComponentParameterInterceptor.java

zk.xml

lang-addon.xml

Download

Full project at github

Demo Flash

Tuesday, March 11, 2014

JSP Fileupload Progress Bar


Simple Note

JSP fileupload with Apache Commons FileUpload
Display upload progress bar

Pre-request

JSP Fileupload without Redirect/Refresh

Full Project

https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/Tools/FileUpload

Testing files

WebContent/fileupload_progressbar.jsp
src/test/UploadProgressServlet.java

JSP Fileupload without Redirect/Refresh


Simple Note

JSP fileupload with Apache Commons FileUpload
Upload file without page redirect, page refresh or open new page.

Pre-request

JSP Apache Fileupload

Full Project

https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/Tools/FileUpload

Testing files

WebContent/fileupload_norefresh.jsp
src/test/UploadServlet.java

Sunday, March 9, 2014

JSP Apache Fileupload

Simple Note

Practice project of Fileupload in JSP

Full Project
https://github.com/benbai123/JSP_Servlet_Practice/tree/master/Practice/Tools/FileUpload

First Page
WebContent/test.jsp
src/test/UploadServlet.java