[Catalyst] forward not working with Apache web server

Berk Birand berkbirand at superonline.com
Thu Feb 7 02:55:34 GMT 2008


Hello everyone,

I have been using Catalyst for about 2 months, and I thought I had a 
good grasp of how things worked. Yet I am facing a problem right now and 
I'm clueless as to how to deal with it.

I use the built-in server to do my development, and then use Apache as 
the main server. For this specific problem, the built-in server behaves 
as expected, but Apache doesn't. I have some code where the Controller 
first uses "$c->forward()" to redirect to another action, and then uses 
"$c->response->redirect" to redirect the page flow.

Although the outputs from the "Action trace" suggests that the forward 
does happen, when I add print statements, they are definitely not 
printed with Apache. The final redirection works in both occasions.

I have no other means of debugging this, so I would appreciate any kind 
of help.

Thanks,
  Berk Birand

Here's the code for the 'add' controller

... 

  80     $c->stash->{add_item} = "$proj_action p:$proj_name"; 
 

  81 
 

  82     $c->forward('/actions/add'); 
 

  83 
 
 

  85     $c->response->redirect($c->req->referer);
...



Here's the output of the built-in server:




[info] *** Request 3 (0.231/s) [27823] [Wed Feb  6 21:20:05 2008] ***
[debug] Query Parameters are:
.-------------------------------------+--------------------------------------.
| Parameter                           | Value 
      |
+-------------------------------------+--------------------------------------+
| action                              | grae gr aegrae aerg 

| project                             | test_project 

'-------------------------------------+--------------------------------------'
[debug] "GET" request for "projects/add" from "127.0.0.1"
[debug] Path is "projects/add"
[debug] Redirecting to "http://localhost:3000/projects/list/test_project"
[info] Request took 0.009705s (103.040/s)
.----------------------------------------------------------------+-----------.
| Action                                                         | Time 
      |
+----------------------------------------------------------------+-----------+
| /auto                                                          |
| /projects/add                                                  |
|  -> /actions/add                                               |
| /end                                                           |
'----------------------------------------------------------------+-----------'




And here's the output that I get from Apache's error.log:




[info] *** Request 1 (0.021/s) [27984] [Wed Feb  6 21:22:02 2008] ***
[debug] Query Parameters are:
.-------------------------------------+--------------------------------------.
| Parameter                           | Value 
      |
+-------------------------------------+--------------------------------------+
| action                              | gre gregaeraer 

| project                             | test_project 

'-------------------------------------+--------------------------------------'
[debug] "GET" request for "projects/add" from "127.0.0.1"
[debug] Path is "projects/add"
[debug] Redirecting to 
"http://localhost:2506/gtd/projects/list/test_project"
[info] Request took 0.021774s (45.926/s)
.----------------------------------------------------------------+-----------.
| Action                                                         | Time 

+----------------------------------------------------------------+-----------+
| /auto                                                          |
| /projects/add                                                  |
|  -> /actions/add                                               |
| /end                                                           |
'----------------------------------------------------------------+-----------'

[info] *** Request 2 (0.042/s) [27984] [Wed Feb  6 21:22:02 2008] ***
[debug] "GET" request for "projects/list/test_project" from "127.0.0.1"
[debug] Path is "projects/list"
[debug] Arguments are "test_project"
[debug] Rendering template "projects/list.tt2"
[debug] Applying HTML page layout wrappers to projects/list.tt2
[info] Request took 0.349265s (2.863/s)
.----------------------------------------------------------------+-----------.
| Action                                                         | Time 
      |
+----------------------------------------------------------------+-----------+
| /auto                                                          |
| /projects/list                                                 |
| /end                                                           |
|  -> GTD::View::TT->process                                     |
'----------------------------------------------------------------+-----------'



More information about the Catalyst mailing list