404 error if APIs not in root

40 views
Skip to first unread message

Raffaele Castagno

unread,
May 27, 2013, 5:43:23 PM5/27/13
to taffy...@googlegroups.com
I have this strange behavior:

if I install my API in the root of my railo webapp, it works, both as rest as trough the dashboard


but, if I try to move it in a subfolder, it no longer works as REST


HTTP ERROR 404

Problem accessing /api/index.cfm/barcode. Reason:

    Not Found

but works just right trough the dashboad.

The reason is that the dashboard uses a different URL


Is this a known issue? I've been unable to find a solution.

Raffaele

Raffaele Castagno

unread,
May 28, 2013, 8:48:44 AM5/28/13
to taffy...@googlegroups.com
I'll answer myself:

I had to create a web.xml in WEB-INF

and add this maping

  <servlet-mapping>
    <servlet-name>CFMLServlet</servlet-name>
      <!-- -->
      <url-pattern>/api/index.cfm/*</url-pattern>

it did the trick.

Bye

Raffaele

Adam Tuttle

unread,
May 28, 2013, 9:15:23 AM5/28/13
to taffy...@googlegroups.com
Glad you figured it out. Since this gets asked so often, I've created a wiki page for it:


Adam

Adam


--
You received this message because you are subscribed to the Google Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Raffaele Castagno

unread,
May 30, 2013, 7:37:15 PM5/30/13
to taffy...@googlegroups.com
By the way, I've discovered just today that there's a more global place to make the modification, that is

{railo_home}/etc/webdefault.xml

again, search for

<servlet-mapping></servlet-mapping>

and add 

<url-pattern>/api/index.cfm/*</url-pattern>

This way, every context created in that particular instance of Railo will inherit this config.

Raffaele
Reply all
Reply to author
Forward
0 new messages