I am learning Smalltalk, and I am developing a REST service on top of Pharo 3 with Latest update #30859. I have installed the latest SeaSide I have done a Manual Installation of the most recent Configuration of SeaSide. And I have installed the latest SeaSide30Addons. I would like to ask a few questions: 1) Why do I see this error in SeaSide, and how do I fix it? I have the latest SeaSide running on latest Pharo 3 with Seaside-REST Error: you are forbidden to access "/" 2) I have a Seaside REST object that is not responding to the URL request below. I have the following class/instance configuration. Am I missing something else? WARestfulHandler subclass: #WeightRestHandler its class initialize method contains: WAAdmin register: self at: self 'weight'. And it has an instance method "weight" with following annotation: <get> <produces: 'text/json'> <path: '/{toUnit}?{fromUnit}={aNumber}'> Rubens
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
There may be no default handler, or your REST service is the default and is not matching “/“ Try: or which will allow you to set the default.
you may need a method selector that defines the keywords toUnit, fromUnit and aNumber. ie. weight: toUnit from: fromUnit value: aNumber <get> <produces: ‘text/json’> <path: '/{toUnit}?{fromUnit}={aNumber}’> I’ve just started working with REST so let me know if it doesn’t work :) Cheers, Jupiter _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Rubens Gomes
Hi Rubens,
On 31 Oct 2014, at 02:36, Rubens Gomes <[hidden email]> wrote:
When you say “latest”, which is that? Just to be sure that you did not load incompatible things: Note that the Seaside-REST package is included in Seaside 3.1 and should not be loaded from the separate ConfigurationOfSeasideRest (which is for Seaside 3.0 only). You should load the ‘REST’ group from the ConfigurationOfSeaside3, and probably also the ‘JSON’ group: (ConfigurationOfSeaside3 project version: #’release3.1’) load: #(‘Core’ ‘REST’ ‘JSON’)
I have the impression that Seaside was not started yet or that something else has been wrongly configured.
That does not seem to be correct. There is a ’self’ too much, it should be: WAAdmin register: self at: ‘weight’ Did you execute this? Mind that a class initialize method is only executed when the class is loaded.
Looks reasonable, but probably you did not add the arguments to the method itself. But before we focus on this, let’s get the other issues out of the way and make sure Seaside works. Johan _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |