<p dir="ltr"><br>
On Nov 21, 2012 9:25 AM, &quot;Max Rydahl Andersen&quot; &lt;<a href="mailto:max.andersen@redhat.com">max.andersen@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; we&#39;ve seen a few issues with the browsersim not working all smooth with WebKit, but I guess for VPV this is less of a concern since we will simply just<br>
&gt; &gt; be using whatever built-into-eclipse browser is enabled by the user on his platform, correct?<br>
&gt; &gt; Yeah, it will use any browser. But of course, each browser, has its own features/bugs which should be taken into account when creating the viewer.<br>
&gt;<br>
&gt; I guess those changes will actually leak into the various templates ? i.e. the code would have to do &quot;if browser=ie do X else do Y&quot; ?<br>
I hope none or only several of them will be affected, like rich:calendar, which is very complicated and really &#39;rich&#39;.<br>
&gt;<br>
&gt; &gt; &gt; If it is a rewrite we should make sure to move everything that is not public api into internal packages.<br>
&gt; &gt; &gt; Will do it.<br>
&gt; &gt;<br>
&gt; &gt; Would also be good to make an effort on making the API to add support for other libraries more approachable than previous VPE.<br>
&gt; &gt; i.e. documented API&#39;s, example of how to do it etc.<br>
&gt; &gt; Agree. We could also make creation of templates more approachable by creating a simpler templating system. Now in VPE only Java and XML tamples are allowed. But we could allow also something like javascript micro-templating.<br>

&gt;<br>
&gt; interesting idea.<br>
&gt;<br>
&gt; &gt; &gt; How is that handled?<br>
&gt; &gt; &gt; One http server for one eclipse instance. Pages on the server will be available under paths like localhost:xxxx/project/pathtopage/page.jsp. We could also dispose the server when no VPE editor is opened.<br>

&gt; &gt;<br>
&gt; &gt; How about absolute relative paths like &quot;/images/funky.png&quot; - I guess that will be handled the same way as before where the href&#39;s are rewritten to have a proper &quot;root&quot; ?<br>
&gt;<br>
&gt; &gt; Good question. I just forget about this root-relative case.<br>
&gt; &gt; It looks like one server per viewer or at least one server per workspace is needed to handle it. I assume, that our users may have several editors opened, so one server with changing root directory is not an option.<br>

&gt; &gt; Obvious drawbacks of multiple servers are:<br>
&gt; &gt; - we have to manage their creation/disposal<br>
&gt; &gt; - these servers will consume more resources (not much, but at least a port and a connection-waiting thread per each)<br>
&gt; &gt; - pages from different projects will not be able communicate with each other, because of same-origin policy. (Anyway, now I am not planning that they will communicate even on one server per workspace.)<br>
&gt; &gt; These seem to be not very big problems, probably it is worth it to create a server per editor, which should be pretty easy to maintain.<br>
&gt;<br>
&gt; well multiple open ports for an app is not exactly awesome.<br>
&gt;<br>
&gt; Especially not if these threads aren&#39;t fast to shutdown (i.e. instantly)<br>
&gt;<br>
&gt; How about multiplexing these somehow - can you control part of the useragent or other parts of the browser which you could use in the request to make the server respond differently ?<br>
&gt;<br>
&gt; i.e. useragent set to &quot;VPV-root: xxxx/project/&quot; and let the server respond accordingly?<br>
&gt;<br>
&gt; Someway to expose the properties the visual page editor already have in context of &quot;root&quot; and &quot;absolute root&quot; settings already.<br>
I wouldn&#39;t like to change the user agent, because client logic may depend on it. Changing/adding of another request headers won&#39;t work in WebKit.</p>
<p dir="ltr">Today we found that the following approach may work.</p>
<p dir="ltr">If we set URL as <a href="http://localhost:1234/index.jsp?root=xxxx/project/">http://localhost:1234/index.jsp?root=xxxx/project/</a>, then all linked resources will be requested with the &#39;Referer&#39; header set to this URL. This header may be used on the server to return right resources.</p>

<p dir="ltr">What I like in this approach is that it will also work for any browser, a SWT embedded browser or a stand alone browser.</p>
<p dir="ltr">Redirects/clicks from one page to another should be handled separately, but it is possible in SWT to do URL rewrite before the page requests are sent.</p>
<p dir="ltr">Another drawback we found is that html frames won&#39;t work this way.<br>
&gt;<br>
&gt; &gt; btw. who&#39;s github branch are you doing this work in ? Would be nice to take a look and try run it from time to time.<br>
&gt; &gt; Now it scaterred locally and in old svn workspaces. I will create a vpv branch in github/yradtsevich/jbosstools-vpe.<br>
&gt;<br>
&gt; okey - let us know when something to look at.<br>
&gt;<br>
&gt; /max</p>