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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]