You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Normann Nielsen <li...@dubbekarl.dk> on 2006/02/07 22:27:39 UTC

Re: disable rendering of 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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org