You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by tapestrycn <ta...@yahoo.com.cn> on 2005/07/24 10:24:20 UTC
How to configure my own url ServiceEndoder implementions?
Hi,
I'd like to config my own ServiceEndoer implementions for direct-service-
encoder,page-service-encoder,extension-encoder and asset-encoder,but how can I
do this in hivemind.xml?
thanks,
tapestrycn
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
How to encode query parameters to friendly url.?
Posted by tapestrycn <ta...@yahoo.com.cn>.
Thank you Eli Doran ,It's working now.
But could you tell me how to attach parameters for encoders including
external,direct and extension service encoders?
thank you
tapestrycn
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to configure my own url ServiceEndoder implementions?
Posted by Eli Doran <el...@gmail.com>.
First, you have declared 2 encoders for the page service and 2 for the
external service. Each "id" needs to be unique. Either use the <encoder>
version or the <page-service-encoder> but not both. Second, the
<encoder> version you used won't work because the standard tapestry
page/external service encoder needs to have the service name and
extension set on them. My custom class did not so you didn't see this.
If you make a custom service encoder for page or external encodings you
may want to configure them some. This is how you'd need to configure the
standard page/external encoder. The <page-service-encoder> schema setup
for you makes this much simpler to write by doing most of this for you.
to see all of this look at
TAPESTRY_HOME/framework/src/descriptor/META-INF/tapestry.url.xml. that
has the schema and configuration info you need to know.
<service-point id="PageEncoder"
interface="org.apache.tapestry.engine.ServiceEncoder">
<invoke-factory>
<construct
class="org.apache.tapestry.engine.encoders.PageServiceEncoder">
<set property="serviceName" value="page"/>
<set property="extension" value="page"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="ExternalEncoder"
interface="org.apache.tapestry.engine.ServiceEncoder">
<invoke-factory>
<construct
class="org.apache.tapestry.engine.encoders.PageServiceEncoder">
<set property="serviceName" value="external"/>
<set property="extension" value="html"/>
</construct>
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="page" object="service:PageEncoder"/>
<encoder id="external" object="service:ExternalEncoder"/>
</contribution>
all of the above is done much more simply below. Only if you need custom
classes and configurations would you need to customize the above version.
<contribution configuration-id="tapestry.url.ServiceEncoders">
<page-service-encoder id="page" service="page" extension="page"/>
<page-service-encoder id="external" service="external" extension="html"/>
</contribution>
~eli
tapestrycn wrote:
>thank you Eli Doran.
>I tried in hivemind.xml as following:
>
> <service-point id="PageEncoder"
>interface="org.apache.tapestry.engine.ServiceEncoder">
> <create-instance
>class="org.apache.tapestry.engine.encoders.PageServiceEncoder"/>
> </service-point>
>
> <contribution configuration-id="tapestry.url.ServiceEncoders">
>
> <encoder id="page" object="service:PageEncoder"/>
> <encoder id="external" object="service:PageEncoder"/>
>
> <page-service-encoder id="page" extension="page" service="page"/>
> <page-service-encoder id="external" extension="html"
>service="external"/>
> <direct-service-encoder id="direct" stateless-extension="direct"
>stateful-extension="sdirect"/>
> <asset-encoder id="asset" path="/assets/"/>
> <extension-encoder id="ext" extension="svc" after="*"/>
> </contribution>
>
>but exception always throws as following:
>
>Exceptions:
>
>java.lang.NullPointerException
>org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:282)
>com.test.tapestry.services.Engine.service(Engine.java:34)
>org.apache.tapestry.services.impl.InvokeEngineTerminator.service
>(InvokeEngineTerminator.java:60)
>$WebRequestServicer_1054bd9214c.service($WebRequestServicer_1054bd9214c.java)
>$WebRequestServicer_1054bd9214b.service($WebRequestServicer_1054bd9214b.java)
>$WebRequestServicer_1054bd92148.service($WebRequestServicer_1054bd92148.java)
>$WebRequestServicer_1054bd92147.service($WebRequestServicer_1054bd92147.java)
>org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service
>(WebRequestServicerPipelineBridge.java:56
>)
>$ServletRequestServicer_1054bd92136.service
>($ServletRequestServicer_1054bd92136.java)
>$ServletRequestServicer_1054bd92135.service
>($ServletRequestServicer_1054bd92135.java)
>org.apache.tapestry.multipart.MultipartDecoderFilter.service
>(MultipartDecoderFilter.java:52)
>
>I don't know why?Could you help me?
>
>
>---------------------------------------------------------------------
>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 to configure my own url ServiceEndoder implementions?
Posted by tapestrycn <ta...@yahoo.com.cn>.
thank you Eli Doran.
I tried in hivemind.xml as following:
<service-point id="PageEncoder"
interface="org.apache.tapestry.engine.ServiceEncoder">
<create-instance
class="org.apache.tapestry.engine.encoders.PageServiceEncoder"/>
</service-point>
<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="page" object="service:PageEncoder"/>
<encoder id="external" object="service:PageEncoder"/>
<page-service-encoder id="page" extension="page" service="page"/>
<page-service-encoder id="external" extension="html"
service="external"/>
<direct-service-encoder id="direct" stateless-extension="direct"
stateful-extension="sdirect"/>
<asset-encoder id="asset" path="/assets/"/>
<extension-encoder id="ext" extension="svc" after="*"/>
</contribution>
but exception always throws as following:
Exceptions:
java.lang.NullPointerException
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:282)
com.test.tapestry.services.Engine.service(Engine.java:34)
org.apache.tapestry.services.impl.InvokeEngineTerminator.service
(InvokeEngineTerminator.java:60)
$WebRequestServicer_1054bd9214c.service($WebRequestServicer_1054bd9214c.java)
$WebRequestServicer_1054bd9214b.service($WebRequestServicer_1054bd9214b.java)
$WebRequestServicer_1054bd92148.service($WebRequestServicer_1054bd92148.java)
$WebRequestServicer_1054bd92147.service($WebRequestServicer_1054bd92147.java)
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service
(WebRequestServicerPipelineBridge.java:56
)
$ServletRequestServicer_1054bd92136.service
($ServletRequestServicer_1054bd92136.java)
$ServletRequestServicer_1054bd92135.service
($ServletRequestServicer_1054bd92135.java)
org.apache.tapestry.multipart.MultipartDecoderFilter.service
(MultipartDecoderFilter.java:52)
I don't know why?Could you help me?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to configure my own url ServiceEndoder implementions?
Posted by Eli Doran <el...@gmail.com>.
This is how I use my custom ServiceEncoder for page/external services.
<service-point id="PageEncoder"
interface="org.apache.tapestry.engine.ServiceEncoder">
<create-instance
class="com.elidoran.tapestry.encoder.PageServiceEncoder"/>
</service-point>
<contribution configuration-id="tapestry.url.ServiceEncoders">
<encoder id="page" object="service:PageEncoder"/>
<encoder id="external" object="service:PageEncoder"/>
</contribution>
tapestrycn wrote:
>Hi,
>I'd like to config my own ServiceEndoer implementions for direct-service-
>encoder,page-service-encoder,extension-encoder and asset-encoder,but how can I
>do this in hivemind.xml?
>
>thanks,
>tapestrycn
>
>
>---------------------------------------------------------------------
>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