You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Eli Doran (JIRA)" <ta...@jakarta.apache.org> on 2005/07/28 16:33:18 UTC
[jira] Commented: (TAPESTRY-451) I wish that Page service url extension can including DOT (.)
[ http://issues.apache.org/jira/browse/TAPESTRY-451?page=comments#action_12317092 ]
Eli Doran commented on TAPESTRY-451:
------------------------------------
Write your own implementation of org.apache.tapestry.engine.ServiceEncoder. If it needs configuration then make it a service singleton and configure it in a <invoke-factory>. Then contribute it to "tapestry.url.ServiceEncoders". To make it override the page encoder give it the id "page"; same with other services.
<service-point id="PageEncoder" interface="org.apache.tapestry.engine.ServiceEncoder">
<invoke-factory>
<construct class="com.elidoran.tapestry.encoder.PageServiceEncoder">
<!-- put your <set>, <set-service> <set-object>, etc in here -->
</construct>
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="page" object="service:PageEncoder"/>
</contribution>
> I wish that Page service url extension can including DOT (.)
> ------------------------------------------------------------
>
> Key: TAPESTRY-451
> URL: http://issues.apache.org/jira/browse/TAPESTRY-451
> Project: Tapestry
> Type: Wish
> Components: Framework
> Versions: 4.0
> Environment: T4 beta3, hivemind 1.1beta2
> Reporter: sorphi
> Priority: Minor
>
> <module id="ui.friendlyurl" version="1.0.0">
> <contribution configuration-id="tapestry.url.ServiceEncoders">
> <page-service-encoder id="page" extension="html" service="page"/>
> ....
> i want to set extension="page.html", but because of the implementation of org.apache.tapestry.engine.encoders.PageServiceEncoder, i can't.
> Could you please change the following codes: ( org.apache.tapestry.engine.encoders.PageServiceEncoder.java)
> line 64-77
> String servletPath = encoding.getServletPath();
> int dotx = servletPath.lastIndexOf('.');
> if (dotx < 0)
> return;
> String extension = servletPath.substring(dotx + 1);
> if (!extension.equals(_extension))
> return;
> // Skip the slash and the dot.
> String page = servletPath.substring(1, dotx);
> to:
> String servletPath = encoding.getServletPath();
> String extension = new StringBuffer(".").append(_extension).toString();
> if (!servletPath.endsWith(extension)) {
> return;
> }
> // Skip the slash and the extension.
> String page = servletPath.substring(1,
> servletPath.length() - extension.length());
> The changed code let me to set extension to whatever i want. (certainly matched with servlet speciacation.)
> (
> Because i want Apache web server to service static page(.html), and j2ee application server (through plugin for apache web server) to service tapestry page. so i want specialize tapestry page service's url could be *.page.html
> I don't like url just like *.page because of some search engine's rules.
> and I don't think url like */page/*.html is good, because there is great probability that it conflict with other common pages in apache web server.
> Also, direct service's url can be *.dir.html , etc.....
> I have also ever tried to set page name to "Home.page" for example, but tapestry Application specification didn't allow that.
> The third effort is that i want to override PageServiceEncoder's implements in my hivemind config file, but i have no enough ability. :(
> Or you can tell me how to override default implements, please. Thank you!
> )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org