I am currently making a component for handling images streamed from a
database using a custom service and a custom component. 
The version of Tapestry is 3.0.3

This  component tries to make a context-asset from the link given from
the service, but fails:

ILink resourceLink = resourceService.getLink(
  requestCycle, this, new Object[]{param});

setImageIconAsset(new ContextAsset(
  new ContextResourceLocation(
    requestCycle.getRequestContext().getServlet().getServletContext(),
    resourceLink.getURL()
  ),null /*no ILocation since this is a dynamically added asset*/
));

The resourceService is the custom service, and the link it makes (using
AbstractService.constructLink) includes the context
(e.g. /*context*/app) which is also added when I make the context asset.
So the link the asset gives me become: 
/context/context/app?service=resource&sp=ServiceParam

The setImageIconAsset is a method used by the Image component for
displaying the icon for this particular ServiceLink. 

Anyone seen this problem before? It would be convenient to be able to
extract the context relative link from ILink, or tell the
ContextResourceLocation that the context is already added to the link.


Now for the next question. 
None of the links generated by this approach produces any session id's
if I turn of cookies. This is true for Image component using a
contextAsset, and for the ServiceLink component.

Is this the responsibility of the service implementation? I never see
the url as a String, I am just depending on
AbstractService.constructLink to do the dirty work.

Is there any better approach than this:
String url = resourceLink.getURL();
url = requestCycle.getRequestContext().getResponse().encodeURL(url); 
resourceLink = new StaticLink(url);

I also noticed that the TapestryInspector also suffers from lack of
jsessionid in cookie. 

Hope someone can help me with this!

Btw, Tapestry Rocks :-)

Regards,

Olve S. Hansen






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to