OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | January 2007 Index

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

Re: RE : [exoplatform] Url rewriting configuration


Alexandre ,
I tested it on two remote servers (with two tomcats ) "my" url works.
Show me the source page in browser on consumer side with this url test.

Session expires and portlet expires are different, is it?
So, in portlet xml you wrote <expiration-cache>-1</expiration-cache>
it means never expires portlet, but seesion will expire.
MarkupOperationsInterfaceImpl:

   SessionContext sessionContext = new SessionContext();
   sessionContext.setSessionID(session.getId());
   sessionContext.setExpires(TransientStateManager.SESSION_TIME_PERIOD);
// HERE session expires = 900 sec

   MarkupContext markupContext = new MarkupContext();
   markupContext.setMimeType(mimeType);
   markupContext.setCacheControl(cacheControl); // HERE
cacheControl.getExpires() portlet expires
   markupContext.setMarkupString(new String(output.getContent()));
   markupContext.setPreferredTitle(output.getTitle());
   markupContext.setRequiresUrlRewriting(new
Boolean(conf.isDoesUrlTemplateProcessing()));
   markupContext.setUseCachedMarkup(new Boolean(false));

What about requiresUrlRewriting...
MarkupOperationsInterfaceImpl the line was wrong, COMMITED new line:
markupContext.setRequiresUrlRewriting(new
Boolean(conf.isDoesUrlTemplateProcessing()));
(was:
markupContext.setRequiresUrlRewriting(new
Boolean(!conf.isDoesUrlTemplateProcessing()));
)


Tooday i'm looking into tomcat sources for encodeURL, wsrp impl need to modificate. Changes cooming soon.

Regards,
Alexey


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

Hello Alexey, Well, your answer surprises me. If you access a portlet locally, the url doesn't change indeed, but here we are accessing an application which does not know on which remote server the image is stored (WSRP Consumer accesses the remote portlet through the WSRP Producer). So I don't see how it could work without url encoding.

We tested the url you proposed:
<img src='<%= "http://"; +request.getServerName() + ":" +
request.getServerPort() +
request.getContextPath() + "/images/speedo.gif" %>'><br/> on two remote
servers where one has /context/images/speedo.gif (server) and the other not
(client).
The image is not displayed. Did you test with two servers too (and cleaned
the cache of your web browser)?
The page code of the client is:
<img src='http://localhost:8080/TestImgPortlet/images/speedo.gif'>

This is no surprise, the machine on which runs the client tomcat does not
have any file in /TestImgPortlet/images/speedo.gif

Apart from that, my mail showed a soap message with two parameters I would
like to change:
<expires>900</expires> (from the session)
<requiresUrlRewriting>false</requiresUrlRewriting>

How can I do that? Are these properties? Portlet Preferences?

Regards,

Alexandre

P.S We have the same problems when trying to access this portlet using
another consumer (WebSphere).

-----------------------
Alexandre Neubert
Edifixio


-----Message d'origine----- De: alexey.zavizionov@xxxxxxxxx [mailto:alexey.zavizionov@xxxxxxxxx] De la part de Alexey Zavizionov Envoyé: mercredi 31 janvier 2007 17:03 À: exoplatform@xxxxxxxxxxxxx Objet: 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/WSRPConsu merPortlet&amp;portal:type=action&amp;portal:mode=&amp;portal:windowState=&a mp;portal:isSecure=false&amp;wsrp-portletHandle=TestImgPortlet/TestImgPortle t/7322e7bac0a878820197871d912c7b5b&amp;wsrp-portletInstanceKey=&amp;wsrp-nav igationalState=73241442c0a878820124d50432114f25&amp;wsrp-sessionID=7322e8b4c 0a878820071d29a0aeb8c91&amp;wsrp-userContextKey=&amp;wsrp-url=&amp;wsrp-requ iresRewrite=&amp;wsrp-interactionState=&amp;wsrp-fragmentID=action&amp;amp;f ormaction=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.