Issue 231: Javascript API has no knowledge of table's context path
Status:  Fixed
Owner: ----
Closed:  Mar 2011
Reported by bgo...@e1b.org, Nov 19, 2009
I have the following scenario...

* Page URL has one context path (in this case,
http://myserver.net/myportal/etc.../)

 * JMesa table resides in an application under another context path (i.e.,
http://myserver.net/myapp)

The application with the table is included in the page via cross-context
dispatching, so the browser only sees the page URL.  This causes the
following POST in submitWsColumn to fail:

$.post('jmesa.wrk?', eval('(' + data + ')'), function(data) {});

My fix for this was to make HtmlSnippetsImpl extend from
AbstractContextSupport so that it has access to the WebContext.  Then, if
the web context is set on the snippets, the following line is output from
initJavaScriptLimit:

jQuery.jmesa.setContextPath('myTableId','/myapp')

I made modifications to jquery.jmesa.js to support setContextPath() and
getContextPath() on a per-table basis.  Finally, if the context path has
indeed been set via initJavaScriptLimit(), that value is prepended in
submitWsColumn.  Otherwise the old behavior is used.

These changes should be 100% backwards compatible.  Please let me know if
this is a good solution, or if I should try something else.  Patch is attached.
javascript_context_path.patch
8.1 KB   View   Download
Nov 19, 2009
#1 bgo...@e1b.org
of course, my last patch had a couple of bugs in the javascript file.  Here's a
better one.
javascript_context_path_round2.patch
9.0 KB   View   Download
Nov 27, 2009
Project Member #2 jeff.johnston.mn@gmail.com
Thank you! I did not notice that you posted the patch here...I will get this in. I
will also do a release fairly soon. There is a language patch that was sent to me
that I want to release as well.
Status: Accepted
Nov 27, 2009
Project Member #3 jeff.johnston.mn@gmail.com
Have the patch applied now.
Mar 9, 2011
Project Member #4 jeff.johnston.mn@gmail.com
(No comment was entered for this change.)
Status: Fixed