I am new to all of the above as my language of choice is PHP. I am tinkering with JSF and have a file where I am creating a persistent cookie, tracking how many times a page is visited by a particular user. I want to display the number of hits when the page loads.
This incorrect code is what I have so far for the event-processing:
... where hitsResult is my JSP component. I'm not even sure if I should be doing it in the prerender method. I'd also like the cookie to expire in a month.Code:public void prerender() { Cookie cookie = new Cookie(hitsResult); HttpServletResponse response = (HttpServletResponse) getExternalContext().getResponse(); response.addCookie(cookie); }
Could anyone direct me?
Thanks!


Reply With Quote
Bookmarks