So I am going to do this in steps.
The first step is for academic purposes, I don't support actually doing this.
1) In JSPs, methods need to be declared in
JSP Declarations, they are surround with <%! %> not <% %>. So your getKookieValue method should look like this:
This doesn't actually call the method, it just declares it, so use an Expression (<%= %>) to call the method and display the results:
Like I said, I don't support using that, as it requires a lot of Java Code inside the JSP. This makes the JSP hard to manage and error-prone. The next option is the better one:
2) Use a controller servlet that gets called before this page (or every page). Use the Servlet to get the cookie value and store it in the request. Then use the JSP to retrieve the value from the request and display it:
[ August 08, 2008: Message edited by: Steve Luke ]