My JSP/Struts application exports web pages to Microsoft Word by returning the pages with with Content-Type: application/msword;charset=ISO-8859-1. Backbase-enabled areas of the exported web pages were processed and displayed successfully with Backbase_Struts_Edition_3.3.1 but are ignored with Backbase_Client_Edition_4_1_2 and the Struts connector.
For example, the areas delimited by bcon:area are now ignored:
<bcon:engine include="../backbase/behaviors/common.xml,../backbase/behaviors/tasklist.xml" />
.
.
<div style="float:right">
<bcon:area>
<spring:message code="dashboard.initiatives.showDateDetails" />
<input type="checkbox" id="showDateDetails" e:behavior="pbl:showHideDateDetails"/>
</bcon:area>
</div>
.
.
<bcon:area>
<jsp:include page="/common/tasklist.jsp"/>
</bcon:area>
.
.
.
.
<div style="float:right">
<bcon:area>
<spring:message code="dashboard.initiatives.showDateDetails" />
<input type="checkbox" id="showDateDetails" e:behavior="pbl:showHideDateDetails"/>
</bcon:area>
</div>
.
.
<bcon:area>
<jsp:include page="/common/tasklist.jsp"/>
</bcon:area>
.
.
How can I get the Backbase-enabled areas to process and display corrrectly in the exported web pages?
Thanks,
essearcy

bcon:area removed from tag library
15 May, 2008 - 14:38 — AlexanderHi essearcy,
With the start of the 4 line the bcon:area is removed from the tag library.
The bcon:area is rendered as a script element with a prefixed set of required namespaces on it, exactly for this reason we decided to remove this tag in order to give the developer more flexibility and transparency.
Just use
<xmp backbase="true" xmlns="..." ...all namespaces..></xmp>or
<script type="text/backbase+xml" xmlns="..." ...all namespaces></script>instead of the bcon:area.
RE: bcon:area is removed from the tag library
15 May, 2008 - 17:51 — essearcyI have analyzed the HTTP/HTML being returned from the server and confirmed that the
<bcon:area>tags are returned as<script type="text/backbase+xml>tags in version 4.1.2. All expected content within the tags is also returned -- but not displayed.The tags work fine when the response content-type is 'text/html'. The problem only occurs when the response content-type is 'application/msword'.
Hi essearcy, I'm sorry for
15 May, 2008 - 18:20 — AlexanderHi essearcy,
I'm sorry for this, you were right, the bcon:area tag has been removed from version 4.2. Still it is the case that in every version you can use the xmp or script tag. For your problem; I do not think if I really fully understand it.. so you trying to request a fragment with content-type is 'application/msword' with backbase islands within a backbase environment?
Response with Content-Type: ...msword;...
15 May, 2008 - 19:56 — essearcyAlexander,
This is a struts/backbase-enabled web page. A small portion of the page content is not valid xtml markup and is therefore outside of any
<bcon:area>tags. Most of the page content is valid xtml markup and resides within<bcon:area>tags.The page is navigated to and displayed just like any other web page. However, the page contains an Export button that allows the user to export the page to either Word or Excel.
The page displays with no problems when viewed as a normal web page (Content-Type: text/html) -- including the content within
<bcon:area>tags.When the user exports the page to Word, the page is simply re-sent to the browser with a response header of 'Content-Type: application/msword'. This causes the browser (IE7 and Firefox 2) to display the page using Word.
The problem we are having is that all content inside of the
<bcon:area>tags is being ignored by the browser during the export. I can place debug markup before, inside, and after each<bcon:area>and only the before and after markup gets displayed. The same problem occurs for Excel but, for the sake of simplicity, I am focusing only on Word at this time.This problem did not occur with version 3.3.1.
Thanks
Oke so you basically request
16 May, 2008 - 11:23 — AlexanderOke so you basically request the same page again, but with the 'Content-Type: application/msword'... ,probably the word processor ignores namespaced tag elements... interesting thing is of course that you had this all working with version 3.3.1, did you also changed your office/word version? And do you see the bcon:engine for example?
The response content looks fine...
16 May, 2008 - 15:39 — essearcy<bcon:engine>is returned as<script type="application/backbase+xml" ... boot.js><bcon:area>is returned as<script type="application/backbase+xml" ...>Our version of Office/Word has not changed.
The question is: Does the 4.1.2 Backbase engine process content inside of
<script type="application/backbase+xml" ...>tags when a response header of "Content-Type: application/msword" is present?Re: Response with Content-Type: ...msword;...
16 May, 2008 - 16:43 — GrauwSo when you click the Export button, the entire page reloads and get processed and displayed by MS Word instead of by the browser?
When you say “processed and displayed successfully” in your original message, what do you mean by that exactly? Does the Backbase Javascript engine run inside MS Word and process and display the Backbase tags? Or does the bcon:area contain just HTML and did it previously show (and parse) as HTML, and is the Backbase engine not involved at all? Maybe you can send a dump of the request (headers, content) in 3.3.1 and 4.2? That would make it more clear as to what is happening exactly.
Thanks -- Problem Solved
16 May, 2008 - 17:21 — essearcyAs you guys suggested, Word and Excel ignore content inside of the 4.1.2
<bcon:area>tags. They did not ignore content inside of the 3.3.1<bstruts:area>tags.I now include the
<bcon:area>tags in the page only when NOT in export mode and all is well.Hi essearcy, Good to hear
16 May, 2008 - 17:34 — AlexanderHi essearcy,
Good to hear that your problem is solved, but I think I do understand the problem now. The bcon:area is rendered as a script tag which is by default not visible (and maybe even ignored by Word for security issues....), as far as I remember the bstruts:area tag rendered a xmp tag. So you might try to use
<xmp backbase="true" .....> </...>instead of the bcon:area.