You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "hv @ Fashion Content" <in...@fashioncontent.com> on 2005/11/18 03:01:47 UTC

How do you set a property of service after construction

Is it possible to override a property of an already defined service using
hivemodule definitions.

In tapestry there is a LinkFactory service. I want to change the contextPath
to blank. How do I specify that ?

Henrik





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Sunday 20 Nov 2005 10:36, hv @ Fashion Content wrote:
> It is actually quite a common deployment strategy.
>
> You have Apache httpd server in front of Tomcat. The httpd server serves
> several domains/hostnames. In this case 6. Each domain has a set of uri
> rewrite rules that prefixes the uri with the context path and passes the
> request on through the connector. So for instance on my site
>
> www.fashioncontent.com/Login.htm becomes /fc-portal/Login.htm when it
> reaches Tomcat.
>
> If I deployed as root I would be forced to have 6 instances of Tomcat
> running on the server.

You don't say what you are actually trying to do by getting a context path set 
to blank.

It sounds like you want to get a URL that is not relative to the application 
but to the root.

I went round this loop a few times, but by the time I came out the other end - 
I just write the thing myself.  Some times I use the @Any component

So <img jwcid="@Any" src="ognl:someString" />, and then implement someString 
in the components associated java



-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by Henrik Vendelbo - Fashion Content <he...@fashioncontent.com>.
Hmm, quite an interesting suggestion. But since I have a working solution in 
T3, I think I will just stick to making the T4 version work the same way. 
Since tapestry is so cleanly designed, patching the contextPath is actually 
quite a simple matter.

Henrik
----- Original Message ----- 
From: "Kent Tong" <ke...@cpttm.org.mo>
Newsgroups: gmane.comp.java.tapestry.user
Sent: Sunday, November 20, 2005 1:19 PM
Subject: Re: How do you set a property of service after construction


> hv  <at>  Fashion Content <info <at> fashioncontent.com> writes:
>
>> You have Apache httpd server in front of Tomcat. The httpd server serves
>> several domains/hostnames. In this case 6. Each domain has a set of uri
>> rewrite rules that prefixes the uri with the context path and passes the
>> request on through the connector. So for instance on my site
>>
>> www.fashioncontent.com/Login.htm becomes /fc-portal/Login.htm when it
>> reaches Tomcat.
>>
>> If I deployed as root I would be forced to have 6 instances of Tomcat
>> running on the server.
>
> Have you tried a mapping that keeps the context path like:
>
> www.fashioncontent.com/Login.htm =>
>  internal.fashioncontent.com:80/Login.htm
>
> www.foo.com/Login.htm =>
>  internal.foo.com:81/Login.htm
>
> Then configure Tomcat like:
>
> <Server ...>
> <Service ...>
> <Connector port="80" proxyName="www.fashioncontent.com" proxyPort="80"/>
> ...
> </Service>
> <Service ...>
> <Connector port="81" proxyName="www.foo.com" proxyPort="80"/>
> ...
> </Service>
> </Server>
>
> In each engine host, deploy your app in the ROOT context. This is
> still just one instance of Tomcat.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by Kent Tong <ke...@cpttm.org.mo>.
hv  <at>  Fashion Content <info <at> fashioncontent.com> writes:

> You have Apache httpd server in front of Tomcat. The httpd server serves 
> several domains/hostnames. In this case 6. Each domain has a set of uri 
> rewrite rules that prefixes the uri with the context path and passes the 
> request on through the connector. So for instance on my site
> 
> www.fashioncontent.com/Login.htm becomes /fc-portal/Login.htm when it 
> reaches Tomcat.
> 
> If I deployed as root I would be forced to have 6 instances of Tomcat 
> running on the server.

Have you tried a mapping that keeps the context path like:

www.fashioncontent.com/Login.htm => 
  internal.fashioncontent.com:80/Login.htm

www.foo.com/Login.htm => 
  internal.foo.com:81/Login.htm

Then configure Tomcat like:

<Server ...>
<Service ...>
<Connector port="80" proxyName="www.fashioncontent.com" proxyPort="80"/>
...
</Service>
<Service ...>
<Connector port="81" proxyName="www.foo.com" proxyPort="80"/>
...
</Service>
</Server>

In each engine host, deploy your app in the ROOT context. This is
still just one instance of Tomcat.



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by Kent Tong <ke...@cpttm.org.mo>.
hv  <at>  Fashion Content <info <at> fashioncontent.com> writes:

> You have Apache httpd server in front of Tomcat. The httpd server serves 
> several domains/hostnames. In this case 6. Each domain has a set of uri 
> rewrite rules that prefixes the uri with the context path and passes the 
> request on through the connector. So for instance on my site
> 
> www.fashioncontent.com/Login.htm becomes /fc-portal/Login.htm when it 
> reaches Tomcat.
> 
> If I deployed as root I would be forced to have 6 instances of Tomcat 
> running on the server.

Have you tried a mapping that keeps the context path like:

www.fashioncontent.com/Login.htm => 
  internal.fashioncontent.com:80/Login.htm

www.foo.com/Login.htm => 
  internal.foo.com:81/Login.htm

Then configure Tomcat like:

<Server ...>
<Service ...>
<Connector port="80" proxyName="www.fashioncontent.com" proxyPort="80"/>
...
</Service>
<Service ...>
<Connector port="81" proxyName="www.foo.com" proxyPort="80"/>
...
</Service>
</Server>

In each engine host, deploy your app in the ROOT context. This is
still just one instance of Tomcat.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
It is actually quite a common deployment strategy.

You have Apache httpd server in front of Tomcat. The httpd server serves 
several domains/hostnames. In this case 6. Each domain has a set of uri 
rewrite rules that prefixes the uri with the context path and passes the 
request on through the connector. So for instance on my site

www.fashioncontent.com/Login.htm becomes /fc-portal/Login.htm when it 
reaches Tomcat.

If I deployed as root I would be forced to have 6 instances of Tomcat 
running on the server.

Henrik

"Kent Tong" <ke...@cpttm.org.mo> skrev i en meddelelse 
news:loom.20051120T055434-801@post.gmane.org...
> hv  <at>  Fashion Content <info <at> fashioncontent.com> writes:
>
>> <contribution configuration-id="tapestry.InfrastructureOverrides">
>>   <property name="contextPath" value=""/>
>> </contribution>
>>
>> Doesn't seem to have any effect though. Links still include the context
>> path.
>>
>> I wonder why???
>
> It won't work because the Infrastructure class has a getContextPath()
> method. The properties added this way are consulted only when it
> doesn't have a real Java property of the same name.
>
> However, why would you like to set the context path to empty? This
> will break lots of stuff. Why not just deploy your app as ROOT?
>
> --
> Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by Kent Tong <ke...@cpttm.org.mo>.
hv  <at>  Fashion Content <info <at> fashioncontent.com> writes:

> <contribution configuration-id="tapestry.InfrastructureOverrides">
>   <property name="contextPath" value=""/>
> </contribution>
> 
> Doesn't seem to have any effect though. Links still include the context 
> path.
> 
> I wonder why???

It won't work because the Infrastructure class has a getContextPath()
method. The properties added this way are consulted only when it
doesn't have a real Java property of the same name.

However, why would you like to set the context path to empty? This
will break lots of stuff. Why not just deploy your app as ROOT?

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How do you set a property of service after construction

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
Ok found the answer myself

<contribution configuration-id="tapestry.InfrastructureOverrides">
  <property name="contextPath" value=""/>
</contribution>

Doesn't seem to have any effect though. Links still include the context 
path.

I wonder why???

Henrik

"hv @ Fashion Content" <in...@fashioncontent.com> skrev i en meddelelse 
news:dljcm4$h7m$2@sea.gmane.org...
> Is it possible to override a property of an already defined service using
> hivemodule definitions.
>
> In tapestry there is a LinkFactory service. I want to change the 
> contextPath
> to blank. How do I specify that ?
>
> Henrik
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org