You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jean-Philippe Bouchard <je...@mail.mcgill.ca> on 2005/02/06 00:31:01 UTC

AbstractService bug?

On the 3.0 branch, I'm using AbstractService.getServiceContext() to 
build a service link. However, it fails with a NPE on

int slashx = service.indexOf('/');

when the service http param is not defined which is the case when 
loading the home page initially.

Is that a bug?

Thanks
JPB

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: AbstractService bug?

Posted by Jean-Philippe Bouchard <je...@mail.mcgill.ca>.

Kent Tong wrote:
> Jean-Philippe Bouchard <jean-philippe.bouchard <at> mail.mcgill.ca> writes:
> 
> 
>>On the 3.0 branch, I'm using AbstractService.getServiceContext() to 
>>build a service link. However, it fails with a NPE on
>>
>>int slashx = service.indexOf('/');
>>
>>when the service http param is not defined which is the case when 
>>loading the home page initially.
>>
>>Is that a bug?
> 
> 
> It's not a bug. It's just that you shouldn't call getServiceContext() 
> if you don't have a parameter named "service". This is the case with 
> the HomeService. If you're developing your own service, you should 
> have this parameter, right?

I'm developing a component that will call a custom service through 
javascript. In order to get the service url, I call the service 
getLink() method which I implemented using getServiceContext(). When the 
component is used on any page it works but when used on the home page, 
it fails when the home page is called as the default.

Anyway, I'm now passing null there instead calling getServiceContext() 
and it works.

> 
> 
> ---------------------------------------------------------------------
> 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: AbstractService bug?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Jean-Philippe Bouchard <jean-philippe.bouchard <at> mail.mcgill.ca> writes:

> 
> On the 3.0 branch, I'm using AbstractService.getServiceContext() to 
> build a service link. However, it fails with a NPE on
> 
> int slashx = service.indexOf('/');
> 
> when the service http param is not defined which is the case when 
> loading the home page initially.
> 
> Is that a bug?

It's not a bug. It's just that you shouldn't call getServiceContext() 
if you don't have a parameter named "service". This is the case with 
the HomeService. If you're developing your own service, you should 
have this parameter, right?



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org