OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | January 2007 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] Url rewriting configuration


Alexandre,

If you will write the simplest jsp page, without
portal/portlet-container, the URL doesn't changed, whether not so?

=== index.jsp ===
Hello<br/>
<img src='<%=response.encodeURL(request.getContextPath()+"/FR/speedo.gif")
%>'><br/>
=============

PS: I have tested it and works with url <img src='<%= "http://"; +
request.getServerName() + ":" + request.getServerPort() +
request.getContextPath() + "/images/mypicture.gif" %>'><br/>

Regards,
Alexey


On 1/30/07, Alexandre-Michael Neubert <alexandre-michael.neubert@xxxxxxxxxxxx> wrote:




Hello List,

I am trying to access JSR 168 Portlets remotely using the wsrp features
provided by exo. For this, I use two exo portlet container 1.5 bundled with
tomcat on two remote machines. The first tomcat acts as server and deploys
my portlets; The other one is acting as client as deploys nothing but the
portlet container.

Fyi, these exo PC bindles where downloaded from the forge site and no custom
configuration has been done on them.



I start my two tomcat instances and the tcp monitor to see what soap
messages are exchanged between them.

Here is what I get: On the server, I have a portlet deployed with one form
which leads to a jsp containing one image.



The line to display the image is :

<img
src='<%=renderResponse.encodeURL(renderRequest.getContextPath()+"/FR/speedo.gif")
%>'>



 If I access this portlet locally (on the server instance), everything works
fine and my image is displayed.

But, if I configure the WSRPProducer Portlet of my client's tomcat (with the
url of the server instance) and if I try to display my portlet using the
client's WSRPConsumer Portlet, no image is displayed. This subject was
already the subject of another mail send a few weeks ago (I will go farther
in the explanations).



I looked at the client's page generated code to see where exo tries to
search the image to display. I found this in the generated file: <img
src='/TestImgPortlet/FR/speedo.gif'>




So far, the url should have been reencoded since the jsp used the encodeURL method.



Now, I look at the tcp monitor to see what soap fragments are exchanged
between client and server. Here is what I get:



HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Date: Tue, 30 Jan 2007 13:14:08 GMT

Connection: close



<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

   <soapenv:Body>

      <getMarkupResponse
xmlns="urn:oasis:names:tc:wsrp:v1:types">

         <markupContext>

            <useCachedMarkup>false</useCachedMarkup>

            <mimeType>text/html</mimeType>

            <markupString>Hello&lt;br/&gt;toto&lt;img
src='/TestImgPortlet/FR/speedo.gif'&gt;&lt;br/&gt;1bis&lt;br/&gt;&lt;form
action=&quot;http://localhost:8080/portal/?portal:componentId=wsrp/WSRPConsumerPortlet&amp;portal:type=action&amp;portal:mode=&amp;portal:windowState=&amp;portal:isSecure=false&amp;wsrp-portletHandle=TestImgPortlet/TestImgPortlet/7322e7bac0a878820197871d912c7b5b&amp;wsrp-portletInstanceKey=&amp;wsrp-navigationalState=73241442c0a878820124d50432114f25&amp;wsrp-sessionID=7322e8b4c0a878820071d29a0aeb8c91&amp;wsrp-userContextKey=&amp;wsrp-url=&amp;wsrp-requiresRewrite=&amp;wsrp-interactionState=&amp;wsrp-fragmentID=action&amp;amp;formaction=displayForm&quot;
method=&quot;post&quot;&gt;   &lt;input type=&quot;SUBMIT&quot;
value=&quot;Retour&quot; /&gt;&lt;/form&gt; </markupString>

            <locale>en</locale>


<requiresUrlRewriting>false</requiresUrlRewriting>

            <cacheControl>

               <expires>-1</expires>

               <userScope>wsrp:perUser</userScope>


<validateTag>73241442c0a8788200d2883b42630713</validateTag>

            </cacheControl>

            <preferredTitle>TestImgPortlet</preferredTitle>

         </markupContext>

         <sessionContext>


<sessionID>7322e8b4c0a878820071d29a0aeb8c91</sessionID>

            <expires>900</expires>

         </sessionContext>

      </getMarkupResponse>

   </soapenv:Body></soapenv:Envelope>



This stack is the soap fragment that is passed when I try to access the jsp
that s displaying the image.

Here, I notice few things:

1. img src='/TestImgPortlet/FR/speedo.gif' is the path that
he tries to resolve to the image(in the markup string). As previously sayed,
this url is not encoded (although it should be).

2. <requiresUrlRewriting>false</requiresUrlRewriting> is
false. I suppose this is the parameter that allows to encode the url of my
portlet

3. <expires>900</expires> My session will expire in 900 seconds.



Now, here are my questions:

Is the parameter <requiresUrlRewriting> related to the fact that the path to
my image is not reencoded ? If yes, how and where can I set this parameter?
If not, is there another way to make exo reencode the urls?
I noticed that after a few minutes of inactivity, I cannot use the consumer
any more. An error is thrown. Does that come from <expires> parameter? If
yes, how and where can I set this so that my session never expires? If not,
where does that error come from and how am I able to prevent session
expiring?



In case someone wants to reproduce my problem, I join my portlet war to this
mail (it is really a very simple app).



Has somebody already had the same problems? Can someone help me out?



Thanks for all your answers?



Regards,



Alexandre





-----------------------

Alexandre Neubert

Edifixio



--
You receive this message as a subscriber of the exoplatform@xxxxxxxxxxxxx
mailing list.
To unsubscribe:
mailto:exoplatform-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws







<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.