Hi Howard, Thanks, it works, here is my code, one problem is,
<t:MyImg path="literal:123456.jpg" /> generates following code without the closing tag, any way to fix this? < img src="/av?fid=123456.jpg"> public class MyImg { @Inject @Service("RequestGlobals") private RequestGlobals requestGlobals; @Parameter(required=true) private String _path; boolean beginRender(MarkupWriter writer) { String fullPath = requestGlobals.getRequest().getContextPath() + "/av?fid="; writer.element("img", "src", fullPath + _path); writer.end(); return false; // don't render body } } Howard Lewis Ship wrote: > > You could write a simple component that dynamically generates the tag, > including the URL. You would inject the Request object, in order to get > the > context path. Something like: > -- View this message in context: http://www.nabble.com/T5%3A-using-servlet-tf4555798.html#a13012221 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]