Posted by
Markku Laine on
Nov 17, 2009; 9:12am
URL: https://discuss.orbeon.com/xforms-output-mediatype-image-does-not-work-in-the-separate-deployment-mode-tp585891p622646.html
Alex,
On 17.11.2009, at 9.55, Alessandro Vernet wrote:
> On Mon, Nov 16, 2009 at 3:55 AM, Markku Laine <
[hidden email]>
> wrote:
>> Well, sessions do get mixed up in my browser so this maybe it is a
>> bug. I
>> attached a sample Web application so that you can try it out
>> yourself.
>>
>> Instructions:
>> 1) Deploy both WAR files
>> 2) Go to URL:
http://localhost:8080/session/>> 3) Input text and click the "Store text in the session" link
>> 4) Open a new tab and go to the URL:
http://localhost:8080/session/>> 5) It initialized the input text field with the value you stored in
>> the
>> session using a different instance of the application --> bug?
>
> Yes, I see that. And this is how it should behave. The session is
> maintained through cookies, and if a window sets a cookie in your
> browser, when you open a connection to the server through another
> browser window, the browser will send the cookie that was set earlier.
> If this is not the behavior you expect, I'd say you shouldn't use the
> session. And indeed, many developers store date in the session just
> because it is a convenient thing to do, and "well, who opens multiple
> browser windows/tabs anyway?". As XForms developers, I think we should
> store information in instances, and pass those instances to other
> pages when they need that data.
Yes, that's what I initially thought, too. I just got a bit confused
about your comment below:
------------ 8< ---------
> We need to support cookieless user agents as well because some
> mobile phones
> might not support cookies. In addition, if you embed an XForms-based
> widget
> two or more times to a Web page/site using iframe etc., the same
> cookie is
> being used by all widget instances --> things start to get mixed up.
Your point on mobile browsers that don't support cookies is well
taken. However, things should not get mixed up in Orbeon Forms if you
open multiple forms (even the same form multiple times) in different
iframes, or different windows/tabs of the same browser. We have paid
especially attention this (and if it happens, it is a bug!).
------------ 8< ---------
However, I still think Orbeon Forms should work when cookies are
disabled. For instance, we have a portal service, which enables adding
widgets from the library to your personal view. Now, let's say that a
user wants to add TWO weather widgets to his/her personal view
(embedded using the iframe/object element), one showing the weather in
Helsinki and the other showing the weather in Berlin. Due to cookie-
based session maintenance, the sessions get mixed up. URL rewriting
would solve this problem.
I know that this is rather unusual use case but it's something we have
to deal with at the moment. The URL rewriting approach I described in
the previous post solves this problem and using <Context
cookies="false" /> in the context.xml forces the Web application to
rely on URL rewriting even if user agent would support cookies.
>> Here is a short description of what I am doing:
>> * Parse the XHTML+XForms document
>> * Extract all URIs i.e. link values (e.g., xforms:submission
>> resource="...", xhtml:a href="...", etc.)
>> * Before encoding URLs, the URIs need to be transformed into ASCII
>> strings
>> etc. AVTs in the URIs may cause problems here...
>> * Encode the URIs with the following method:
>> response.encodeURL( uriString
>> );
>> * Pass the modified URIs to the XSLT transformation, which
>> replaces the
>> original URIs with the modified ones (containing the JSESSIONID if
>> needed)
>
> For the <xforms:output mediatype="image/*">, you'll need to do the
> rewrite after the XForms engine has run, in the epilogue. In essence,
> some URLs can only be rewritten before the XForms engine runs (e.g.
> submissions's resource="...") and other can only be handled after the
> engine runs (e.g. <xforms:output mediatype="image/*"> or
> <xforms:output mediatype="text/thml">). Maybe this rewriting would be
> better handled by the XForms engine itself.
Yes, I agree. Then Orbeon Forms would also work with user agents ,
which do not support cookies. And if you need any help with the
design, do not hesitate to contact me.
Regards
-Markku
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws