'Hello world' supposed to work with CF9 beta?

31 views
Skip to first unread message

dizid

unread,
Aug 31, 2009, 3:49:34 PM8/31/09
to ColdFusion on Wheels
Hi,

Is this 'Hello world' sample supposed to work with CF9 beta?

I'm new to Wheels, installed it, wrote the say.cfc with 2 line of code
and i get another error then the 1 described aboved. I've checked if i
have everything doen right, i did get the "You have successfully
installed version 0.9.3 of Wheels." msg.

My "Hello World error":

404

/sites/icse/say

java.io.FileNotFoundException: /sites/icse/say
at jrun.servlet.file.FileServlet.service(FileServlet.java:349)
etc etc

Nothing like the error from fig. 2 above ;)

Oops, submitting this comment (on http://cfwheels.org/docs/chapter/beginner-tutorial%3a-hello-world)
gives:

"There was an error with your entry. Please correct it and try again.
* Website is not a valid URL"

Clarke Bishop

unread,
Sep 1, 2009, 10:39:49 AM9/1/09
to cfwh...@googlegroups.com
This looks like a problem with URL rewriting.

Try this. Make a URL like
http://localhost/index.cfm?controller=show&action=index. Make sure your path
to index.cfm and your controller name and action is right!

If this works, it's definitely a URL rewriting problem. Partial URL
rewriting may work for you. The above URL becomes
http://localhost/index.cfm/show/index

Hope this helps!

Clarke

raulriera

unread,
Sep 1, 2009, 2:48:01 PM9/1/09
to ColdFusion on Wheels
CF built in JRUN will only allow you to have URLRewriting in Partial
and only if you "force it" to with

<cfset set(URLRewriting="Partial")>

In that case your URL would be

localhost/index.cfm/say/

On Sep 1, 10:39 am, "Clarke Bishop" <cbis...@resultantsys.com> wrote:
> This looks like a problem with URL rewriting.
>
> Try this. Make a URL likehttp://localhost/index.cfm?controller=show&action=index. Make sure your path
> to index.cfm and your controller name and action is right!
>
> If this works, it's definitely a URL rewriting problem. Partial URL
> rewriting may work for you. The above URL becomeshttp://localhost/index.cfm/show/index
>
> Hope this helps!
>
>    Clarke
>
>
>
> -----Original Message-----
> From: cfwh...@googlegroups.com [mailto:cfwh...@googlegroups.com] On Behalf
>
> Of dizid
> Sent: Monday, August 31, 2009 3:50 PM
> To: ColdFusion on Wheels
> Subject: [cfwheels] 'Hello world' supposed to work with CF9 beta?
>
> Hi,
>
> Is this 'Hello world' sample supposed to work with CF9 beta?
>
> I'm new to Wheels, installed it, wrote the say.cfc with 2 line of code
> and i get another error then the 1 described aboved. I've checked if i
> have everything doen right, i did get the "You have successfully
> installed version 0.9.3 of Wheels." msg.
>
> My "Hello World error":
>
> 404
>
> /sites/icse/say
>
> java.io.FileNotFoundException: /sites/icse/say
>         at jrun.servlet.file.FileServlet.service(FileServlet.java:349)
> etc etc
>
> Nothing like the error from fig. 2 above ;)
>
> Oops, submitting this comment (onhttp://cfwheels.org/docs/chapter/beginner-tutorial%3a-hello-world)

Bryce

unread,
Sep 3, 2009, 2:36:31 PM9/3/09
to ColdFusion on Wheels
Clarke et. al.,

I'm another noob, and had a lot of frustration with the URL thing,
much the same as dizid.

Your advice was gold, thanks -- that's what it took to render my Hello
world! (http://localhost:8500/wheels_site/index.cfm?
controller=say&action=hello)

Now, can you please advise on what tweaks I should carry out so I can
get this --> http://localhost:8500/wheels_site/say/action

to work?

Thanks,

Bryce

On Sep 1, 7:39 am, "Clarke Bishop" <cbis...@resultantsys.com> wrote:
> This looks like a problem with URL rewriting.
>
> Try this. Make a URL likehttp://localhost/index.cfm?controller=show&action=index. Make sure your path
> to index.cfm and your controller name and action is right!
>
> If this works, it's definitely a URL rewriting problem. Partial URL
> rewriting may work for you. The above URL becomeshttp://localhost/index.cfm/show/index
>
> Hope this helps!
>
>    Clarke
>
> -----Original Message-----
> From: cfwh...@googlegroups.com [mailto:cfwh...@googlegroups.com] On Behalf
>
> Of dizid
> Sent: Monday, August 31, 2009 3:50 PM
> To: ColdFusion on Wheels
> Subject: [cfwheels] 'Hello world' supposed to work with CF9 beta?
>
> Hi,
>
> Is this 'Hello world' sample supposed to work with CF9 beta?
>
> I'm new to Wheels, installed it, wrote the say.cfc with 2 line of code
> and i get anothererrorthen the 1 described aboved. I've checked if i
> have everything doen right, i did get the "You have successfully
> installed version 0.9.3 of Wheels." msg.
>
> My "Hello Worlderror":
>
> 404
>
> /sites/icse/say
>
> java.io.FileNotFoundException: /sites/icse/say
>         at jrun.servlet.file.FileServlet.service(FileServlet.java:349)
> etc etc
>
> Nothing like theerrorfrom fig. 2 above ;)
>
> Oops, submitting this comment (onhttp://cfwheels.org/docs/chapter/beginner-tutorial%3a-hello-world)
> gives:
>
> "There was anerrorwith your entry. Please correct it and try again.

Chris Peters

unread,
Sep 3, 2009, 4:46:15 PM9/3/09
to cfwh...@googlegroups.com
The best way to get it to work correclty is to install your Wheels app in the site root. Also, things will not look pretty until you hook your CF install into a web server like Apache to handle the rewriting, or install the JRun rewriting, as described on Mike Henke's blog:
http://henke.ws/post.cfm/jrun-url-rewriting

Here is the documentation that we have on URL rewriting:
http://cfwheels.org/docs/chapter/url-rewriting

I can't remember if someone has solved the subfolder rewrite problem. If so, can someone step forward and share? ;)

Clarke Bishop

unread,
Sep 3, 2009, 6:00:53 PM9/3/09
to cfwh...@googlegroups.com

If you are running the ColdFusion development server, I don't know how to make it work or if it's even possible.

 

This will probably work, though:

http://localhost:8500/wheels_site/index.cfm/say/action  Notice the index.cfm inserted in the url! For learning and development, this is close enough for me.

 

I covered the basic issues and options in a blog post:

http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-controller-and-view/

 

For production, some of the ideas Chris mentioned are probably best.

 

And, I am still working on through Head First Rails and converting the apps and ideas to CFWheels. Here’ the jump page:

http://www.resultantsys.com/index.php/cfwheels

 

I hope this helps!

dizid

unread,
Sep 5, 2009, 11:46:31 AM9/5/09
to ColdFusion on Wheels
Clarke,

Yep, localhost:8500/sites/icse/index.cfm?controller=say&action=hello
worked.

Thanks.

nb: raulriera's suggestion <cfset set(URLRewriting="Partial")> (I
suppose this cfset has to go in the application.cfc)
gives an error: "Variable SET is undefined." On this url:
http://localhost:8500/sites/icse/index.cfm/say/

nb2:
The total execution time was 274 ms (first time) and around 150ms
thereafter...
A hello.cfm without wheels takes 25ms (first time) and 5ms thereafter
Not sure if that is an indication for real applications, but there
defenitely is some overhead involved.


On Sep 1, 4:39 pm, "Clarke Bishop" <cbis...@resultantsys.com> wrote:
> This looks like a problem with URL rewriting.
>
> Try this. Make a URL likehttp://localhost/index.cfm?controller=show&action=index. Make sure your path
> to index.cfm and your controller name and action is right!
>
> If this works, it's definitely a URL rewriting problem. Partial URL
> rewriting may work for you. The above URL becomeshttp://localhost/index.cfm/show/index
>
> Hope this helps!
>
>    Clarke
>
> -----Original Message-----
> From: cfwh...@googlegroups.com [mailto:cfwh...@googlegroups.com] On Behalf
>
> Of dizid
> Sent: Monday, August 31, 2009 3:50 PM
> To: ColdFusion on Wheels
> Subject: [cfwheels] 'Hello world' supposed to work with CF9 beta?
>
> Hi,
>
> Is this 'Hello world' sample supposed to work with CF9 beta?
>
> I'm new to Wheels, installed it, wrote the say.cfc with 2 line of code
> and i get another error then the 1 described aboved. I've checked if i
> have everything doen right, i did get the "You have successfully
> installed version 0.9.3 of Wheels." msg.
>
> My "Hello World error":
>
> 404
>
> /sites/icse/say
>
> java.io.FileNotFoundException: /sites/icse/say
>         at jrun.servlet.file.FileServlet.service(FileServlet.java:349)
> etc etc
>
> Nothing like the error from fig. 2 above ;)
>
> Oops, submitting this comment (onhttp://cfwheels.org/docs/chapter/beginner-tutorial%3a-hello-world)

Chris Peters

unread,
Sep 5, 2009, 2:14:36 PM9/5/09
to cfwh...@googlegroups.com
You should put the call to <cfset set(URLRewriting="Partial)> in config/settings.cfm. In order for that change to take effect, you'll need to call your app with ?reload=true at the end of the URL to reload the app.

Regarding performance... When you install your app, the environment setting in config/environment.cfm is set to "design". There are different environments that use different levels of caching, mainly for convenience as you're developing. "production" performs the best but is inconvenient when you're trying to develop your app on your machine.

On first page load, your app will cache a lot of settings and queries (depending on how you set up caching in the different layers), so first load will take longer. After that's all loaded, Wheels performs very well.

More about environments:
http://cfwheels.org/docs/chapter/switching-environments

More about caching:
http://cfwheels.org/docs/chapter/caching
Reply all
Reply to author
Forward
0 new messages