I'm using LWF 1.0.1 to create a widget which I export from LWF using Properties -> 'Build War for Production deployment' function.
The production war file is subsequently used to get the widget added into the MushupHub catalog (via 'Upload Widget' -> iWidget Package (.war)) and then added to the Lotus Mashups using 'Add to Lotus Mashups' function. The process works fine in that the widget becomes available in Mashups. However, I'm running into issues with the context root that my application (i.e. widget) is deployed under in WAS.
The Add to Lotus Mashups function seems to be deploying applications with "/widgets/" in the first part of the context root name.
This problem is only happening when the 'Add to Mashups' is used to deploy my production war file.
I can test (i.e. Run) the model from within LWF designer using my local Mashups Center without any problems. It also works fine when the 'Publish Widgets to Lotus Mashups toolbox' is used to publish the widget locally.
What's the best way of resolving this issue?
This topic has been locked.
5 replies Latest Post - 2009-05-26T20:13:09Z by SystemAdmin
Pinned topic Context root problem
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2009-05-26T20:13:09Z at 2009-05-26T20:13:09Z by SystemAdmin
Re: Context root problem2009-05-06T13:49:00Z in response to SystemAdminJ2EE web applications (including LWF widgets) should not be written to be dependent on their application context path. This is especially important in the Mashups world: the collaborative nature of such a platform makes it very likely that you will not be able to count on a specific app context (even if you could request a specific context, that may have already been allocated to some other component, etc.)
When I've had to deal with something like this, I've parameterized my script's knowledge of the context path, computed it in Java/JSP code, and passed the result to the script. I've attached an example of one way to do this.
Re: Context root problem2009-05-26T20:07:47Z in response to SystemAdminHi,
I am having the same problem...
I am creating an iWidget for Business Spaces...
I just want to display an image without hardcoding the contentroot in the src attribute e.g.
<img id="_IWID_image" src="/MYCONTEXT/images/myimage.gif">
I tried using a class of "iw-RewriteURI" e.g.
<img id="_IWID_image" src="images/myimage.gif" class="iw-RewriteURI">
but it didn't work.
There must be a way to do this in markup, anyone know???
From the iWidget Primer...
"The specification provides two means for requesting assistance in rewriting URIs:
1. An optional method is defined (iContext.io.rewriteURI) that accepts a URI as a parameter and returns a URI that can be used
to access the underlying resource.
2. A class of "iw-RewriteURI" can be placed on any element and the iContext replaces the value of the URI-oriented attribute
of that element (for example the "src" attribute on an tag or the "href" attribute of an tag) with what would have
been returned if the optional method iContext.io.rewriteURI had been called. If this method is not implemented, the value of
the URI is left unchanged."
jasonCornell 060001JGYY7 Posts