开发者

Image counter in JSP

Need to do Image counter in JSP for how many clicks have clicked for advertisement? Front-End : JSP Backen开发者_高级运维d : Mysql

or

Any other procedure methods for counting number of clicks in advertisement using JSP


Create a Filter and map it on an url-pattern covering the image's URL. Then basically do the following in doFilter() method:

clickDAO.increment(request.getRequestURI());
chain.doFilter(request, response);

And in the ClickDAO#increment() just basically do an UPDATE click SET count = count + 1 WHERE image = ?.

At least, the JSP is the wrong place to implement this logic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜