I kinda figured I'd have to modify the BaseTagWriter - but I wasn't sure
if this was being used somewhere else and if it was what the
consequences would be if I used my own writer. 

Anyways, I guess there is no harm to use your own as this works fine for
you.

Thanks for your help.

-----Original Message-----
From: Jan Normann Nielsen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006 4:28 PM
To: Tapestry users
Subject: Re: disable rendering of <base> tag (solution for Tapestry 4)

Mazhar, Osman (Home Office) skrev:
> It seems like the Shell component creates an http base tag as follows:
>
>  
>
> <base href="http://127.0.0.1:9090/MyApp/"/>
>  
> Because of this base tag, I cannot have apache http server serve as a
> reverse proxy to my tapestry application as it messes up all links on
> the page.
>  
>
> Is there a way to disable rendering of this base tag somehow? Or is
> there another trick, perhaps in apache http server?
>   
This answer works for Tapestry 4:

Yes, it's definitely possible but it took me quite some work to figure 
it out a couple of months ago. I looked at the Tapestry source code but 
also had help from this mailing list.

The <base> tag is rendered by a Hivemind service, so if you need to 
change the way the tag is rendered (e.g. by not rendering it at all), 
add the file hivemodule.xml (or append to the file if it already exists)

in your WEB-INF folder of your Tapestry 4 web application:


<?xml version="1.0" encoding="iso-8859-1"?>

<!--
    This HiveMind module overrides the Tapestry
"tapestry.url.BaseTagWriter"
    service implementation so no base tag isn't rendered at all in any 
pages.
-->

<module id="mymoduleid" version="1.0.0" package="mypackage">
    <implementation service-id="tapestry.url.BaseTagWriter">
        <create-instance class="MyBaseTagWriter" />
    </implementation>
</module>


(fill out "mymoduleid", "mypackage" and "MyBaseTagWriter" appropriately)

and implement the mypackage.MyBaseTagWriter class like e.g.


package mypackage;

import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRender;
import org.apache.tapestry.IRequestCycle;

/**
 * A BaseTagWriter that does nothing.
*/
public class MyBaseTagWriter implements IRender {

    /**
     * Constructor.
     */
    public MyBaseTagWriter() {
        super();
    }

    public void render(IMarkupWriter arg0, IRequestCycle arg1) {
        // Do nothing.
    }

}


This did the trick for me.

Best wishes,
Jan Nielsen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




______________________________________________________________________
This e-mail has been scanned by The Leukemia & Lymphoma Society Managed Email 
Content Service, provided by MCI and Message Labs.

NOTICE: This message, including all attachments transmitted with it, is for the 
use of the addressee only. It may contain proprietary, confidential and/or 
legally privileged information. No confidentiality or privilege is waived or 
lost by any mistransmission. If you are not the intended recipient, you must 
not, directly or indirectly, use, disclose, distribute, print or copy any part 
of this message. If you believe you have received this message in error, please 
delete it and all copies of it from your system and notify the sender 
immediately by reply e-mail. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to