I am using coldfusion for years now but I am still in the old way of coding
with the application.cfm and the tag version of the code … (yeah I know,
I am playing the old guy but it’s from the jeremy allaire old time).
I am puting together an API REST with lucee … and I am not able to set
any application variables … getting stuck on this is just upsetting me so
bad …
so I have an application.cfc with that kind of code :
this.nom0='bonjour0'; //debug test
variables.nom1='bonjour1'; //debug test
application.nom2='bonjour2'; //debug test
public function onApplicationStart()
{
writeLog(file="apilog", text="Lancement REST API");
this.nom0_b='bonjour0_onappstart';
variables.nom1_b='bonjour1_onappstart';
application.ipgranted = "195.258.70.167";
application.logname = "api";
application.logname_error = "api_error";
return true;
}
public function onApplicationEnd()
{
writeLog(file="apilog", text="FIN REST API");
return;
}
public boolean function onRequestStart()
{
writeLog(file="apilog", text="Request START");
return true;
}
public void function onError(e){
writeLog(file="api_error", text="#GetFunctionCalledName()# called
avec #serialize(e)#");
writeDump(var=e, label=“ERROR”);
abort;
}
}
and I have just this in a test.cfc file :
component restpath=“/test” rest=“true” displayname=“get test”{
remote any function get_test(numeric id restargsource=“Path”) httpmethod
=“GET” restpath=“{id}” {
Some pointers
The URL for will always start with /rest (or as defined in server.xml)
Then the the rest application mapping - set up in Lucee admin or with RestInitApplication() :: Lucee Documentation
Then the path to the resource
So will be something like
/rest/api/test/1
If you want a version number in the URLs add it to restpath- most likely on
the componentOn Friday, 23 October 2015, Stéphane MERLE <@Stephane_MERLE> wrote:
Hi,
I am using coldfusion for years now but I am still in the old way of
coding with the application.cfm and the tag version of the code … (yeah
I know, I am playing the old guy but it’s from the jeremy allaire old time).
I am puting together an API REST with lucee … and I am not able to set
any application variables … getting stuck on this is just upsetting me so
bad …
so I have an application.cfc with that kind of code :
this.nom0='bonjour0'; //debug test
variables.nom1='bonjour1'; //debug test
application.nom2='bonjour2'; //debug test
public function onApplicationStart()
{
writeLog(file="apilog", text="Lancement REST API");
this.nom0_b='bonjour0_onappstart';
variables.nom1_b='bonjour1_onappstart';
application.ipgranted = "195.258.70.167";
application.logname = "api";
application.logname_error = "api_error";
return true;
}
public function onApplicationEnd()
{
writeLog(file="apilog", text="FIN REST API");
return;
}
public boolean function onRequestStart()
{
writeLog(file="apilog", text="Request START");
return true;
}
public void function onError(e){
writeLog(file="api_error", text="#GetFunctionCalledName()# called
avec #serialize(e)#");
writeDump(var=e, label=“ERROR”);
abort;
}
}
and I have just this in a test.cfc file :
component restpath=“/test” rest=“true” displayname=“get test”{
remote any function get_test(numeric id restargsource=“Path”)
httpmethod=“GET” restpath=“{id}” {
Some pointers
The URL for will always start with /rest (or as defined in server.xml)
Then the the rest application mapping - set up in Lucee admin or with RestInitApplication() :: Lucee Documentation
Then the path to the resource
So will be something like
/rest/api/test/1
If you want a version number in the URLs add it to restpath- most likely
on the component
On Friday, 23 October 2015, Stéphane MERLE <stephan...@gmail.com <javascript:>> wrote:
Hi,
I am using coldfusion for years now but I am still in the old way of
coding with the application.cfm and the tag version of the code … (yeah
I know, I am playing the old guy but it’s from the jeremy allaire old time).
I am puting together an API REST with lucee … and I am not able to set
any application variables … getting stuck on this is just upsetting me so
bad …
so I have an application.cfc with that kind of code :
this.nom0='bonjour0'; //debug test
variables.nom1='bonjour1'; //debug test
application.nom2='bonjour2'; //debug test
public function onApplicationStart()
{
writeLog(file="apilog", text="Lancement REST API");
this.nom0_b='bonjour0_onappstart';
variables.nom1_b='bonjour1_onappstart';
application.ipgranted = "195.258.70.167";
application.logname = "api";
application.logname_error = "api_error";
return true;
}
public function onApplicationEnd()
{
writeLog(file="apilog", text="FIN REST API");
return;
}
public boolean function onRequestStart()
{
writeLog(file="apilog", text="Request START");
return true;
}
public void function onError(e){
writeLog(file="api_error", text="#GetFunctionCalledName()#
called avec #serialize(e)#");
writeDump(var=e, label=“ERROR”);
abort;
}
}
and I have just this in a test.cfc file :
component restpath=“/test” rest=“true” displayname=“get test”{
remote any function get_test(numeric id restargsource=“Path”)
httpmethod=“GET” restpath=“{id}” {
Some pointers
The URL for will always start with /rest (or as defined in server.xml)
Then the the rest application mapping - set up in Lucee admin or with RestInitApplication() :: Lucee Documentation
Then the path to the resource
So will be something like
/rest/api/test/1
If you want a version number in the URLs add it to restpath- most likely
on the component
I am using coldfusion for years now but I am still in the old way of
coding with the application.cfm and the tag version of the code … (yeah
I know, I am playing the old guy but it’s from the jeremy allaire old time).
I am puting together an API REST with lucee … and I am not able to set
any application variables … getting stuck on this is just upsetting me so
bad …
so I have an application.cfc with that kind of code :
this.nom0='bonjour0'; //debug test
variables.nom1='bonjour1'; //debug test
application.nom2='bonjour2'; //debug test
public function onApplicationStart()
{
writeLog(file="apilog", text="Lancement REST API");
this.nom0_b='bonjour0_onappstart';
variables.nom1_b='bonjour1_onappstart';
application.ipgranted = "195.258.70.167";
application.logname = "api";
application.logname_error = "api_error";
return true;
}
public function onApplicationEnd()
{
writeLog(file="apilog", text="FIN REST API");
return;
}
public boolean function onRequestStart()
{
writeLog(file="apilog", text="Request START");
return true;
}
public void function onError(e){
writeLog(file="api_error", text="#GetFunctionCalledName()#
called avec #serialize(e)#");
writeDump(var=e, label=“ERROR”);
abort;
}
}
and I have just this in a test.cfc file :
component restpath=“/test” rest=“true” displayname=“get test”{
remote any function get_test(numeric id restargsource=“Path”)
httpmethod=“GET” restpath=“{id}” {
Some pointers
The URL for will always start with /rest (or as defined in server.xml)
Then the the rest application mapping - set up in Lucee admin or with RestInitApplication() :: Lucee Documentation
Then the path to the resource
So will be something like
/rest/api/test/1
If you want a version number in the URLs add it to restpath- most likely
on the component
On Friday, 23 October 2015, Stéphane MERLE <stephan...@gmail.com <javascript:>> wrote:
Hi,
I am using coldfusion for years now but I am still in the old way of
coding with the application.cfm and the tag version of the code … (yeah
I know, I am playing the old guy but it’s from the jeremy allaire old time).
I am puting together an API REST with lucee … and I am not able to set
any application variables … getting stuck on this is just upsetting me so
bad …
so I have an application.cfc with that kind of code :
this.nom0='bonjour0'; //debug test
variables.nom1='bonjour1'; //debug test
application.nom2='bonjour2'; //debug test
public function onApplicationStart()
{
writeLog(file="apilog", text="Lancement REST API");
this.nom0_b='bonjour0_onappstart';
variables.nom1_b='bonjour1_onappstart';
application.ipgranted = "195.258.70.167";
application.logname = "api";
application.logname_error = "api_error";
return true;
}
public function onApplicationEnd()
{
writeLog(file="apilog", text="FIN REST API");
return;
}
public boolean function onRequestStart()
{
writeLog(file="apilog", text="Request START");
return true;
}
public void function onError(e){
writeLog(file="api_error", text="#GetFunctionCalledName()#
called avec #serialize(e)#");
writeDump(var=e, label=“ERROR”);
abort;
}
}
and I have just this in a test.cfc file :
component restpath=“/test” rest=“true” displayname=“get test”{
remote any function get_test(numeric id restargsource=“Path”)
httpmethod=“GET” restpath=“{id}” {