concept resource url in category java

This is an excerpt from Manning's book Portlets in Action.
Resource URL— Used to render content or retrieve resources (like image files). Depending upon the application requirement, a resource URL may be used for updating application state. The request sent to the portlet by a resource URL is referred to as a resource request.
Like action and render URLs, a resource URL is a self-referencing URL that’s used to send a resource request to a portlet. To create a resource URL, you can use the createResourceURL method of the RenderResponse or ResourceResponse object or you can use the portlet tag library’s <resourceURL> tag. In either case, you should uniquely identify the resource that needs to be served by specifying a resource ID.
Figure 12.2 showed that in the Date/Time portlet the Refresh hyperlink is responsible for retrieving the current server date and time. If you want to use the portlet’s serveResource method to return the date and time information, the Refresh hyperlink must send an Ajax request to the resource URL of the portlet. Listing 12.7 shows how the DateTimePortlet class uses the RenderResponse object to create a resource URL, which is later used by the home.jsp page to send an Ajax request to the resource URL when the Refresh hyperlink is clicked.
The RenderResponse’s createResourceURL method
creates a ResourceURL object, which represents a resource URL. The setResourceID method of ResourceURL is used to uniquely identify the resource to be served. The resource URL is set as a request attribute
, and the request is dispatched to the home.jsp page. The Refresh hyperlink in home.jsp sends an Ajax request to the resource URL set in the request.