Routing Feature Request

View: New views
10 Messages — Rating Filter:   Alert me  

Routing Feature Request

by Brendan Rice :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I just read a post from Phil Haack's blog:

http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx

Some of you might have read my post about CMS routing (if not please
do):

http://groups.google.com/group/castle-project-users/browse_thread/thread/6ed0c3b0d39edfc

The problem with the route specified in that post is that it catches
everything, even the Monorail Javascript files and any CSS files.

Haack's post descibes how Microsoft have got round this by introducing
the following:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

Would it be possible for Monorail routing to have something similar?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Strange.. by default MR's routing skips any url that matches a physical file...

On Wed, Jul 23, 2008 at 5:46 PM, Brendan Rice <gumpshen@...> wrote:

>
> I just read a post from Phil Haack's blog:
>
> http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx
>
> Some of you might have read my post about CMS routing (if not please
> do):
>
> http://groups.google.com/group/castle-project-users/browse_thread/thread/6ed0c3b0d39edfc
>
> The problem with the route specified in that post is that it catches
> everything, even the Monorail Javascript files and any CSS files.
>
> Haack's post descibes how Microsoft have got round this by introducing
> the following:
>
> routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
>
> Would it be possible for Monorail routing to have something similar?
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by josh robb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Thu, Jul 24, 2008 at 7:35 AM, Hamilton Verissimo
<hammett@...> wrote:
>
> Strange.. by default MR's routing skips any url that matches a physical file...

+1 - this is the correct way to handle this. Anyone that thinks
otherwise needs a meeting with Oren's 2x4.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Brendan Rice :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Could someone please try the route in the other post as it causes
files to be caught in the routing rule. Monorails javascript files do
not get loadeded using it,

Thanks,

Brendan

On Jul 23, 8:05 pm, "josh robb" <josh_r...@...> wrote:
> On Thu, Jul 24, 2008 at 7:35 AM, Hamilton Verissimo
>
> <hamm...@...> wrote:
>
> > Strange.. by default MR's routing skips any url that matches a physical file...
>
> +1 - this is the correct way to handle this. Anyone that thinks
> otherwise needs a meeting with Oren's 2x4.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Andre Loker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try to restrict the routing rules to not match the Monorail area:
new PatternRoute(...).Restrict("area").AnythingBut("monorail")

Regards,
Andre

Could someone please try the route in the other post as it causes
files to be caught in the routing rule. Monorails javascript files do
not get loadeded using it,

Thanks,

Brendan

On Jul 23, 8:05 pm, "josh robb" josh_r...@... wrote:
  
On Thu, Jul 24, 2008 at 7:35 AM, Hamilton Verissimo

hamm...@... wrote:

    
Strange.. by default MR's routing skips any url that matches a physical file...
      
+1 - this is the correct way to handle this. Anyone that thinks
otherwise needs a meeting with Oren's 2x4.
    

  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I double checked the code,
http://svn.castleproject.org:8080/svn/castle/trunk/MonoRail/Castle.MonoRail.Framework/Routing/RoutingModuleEx.cs

                        if (File.Exists(request.PhysicalPath))
                        {
                                return; // Possibly requesting a static file, so we skip routing altogether
                        }


On Thu, Jul 24, 2008 at 4:31 AM, Brendan Rice <gumpshen@...> wrote:

>
> Could someone please try the route in the other post as it causes
> files to be caught in the routing rule. Monorails javascript files do
> not get loadeded using it,
>
> Thanks,
>
> Brendan
>
> On Jul 23, 8:05 pm, "josh robb" <josh_r...@...> wrote:
>> On Thu, Jul 24, 2008 at 7:35 AM, Hamilton Verissimo
>>
>> <hamm...@...> wrote:
>>
>> > Strange.. by default MR's routing skips any url that matches a physical file...
>>
>> +1 - this is the correct way to handle this. Anyone that thinks
>> otherwise needs a meeting with Oren's 2x4.
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Brendan Rice :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


That would maybe exlpain things a little better.  The routing threw an
exception 5 times once for the css and 4 for the javascript files that
are embedded in the Monorail assembly.  My page was stilled styled but
I lost all javascript.  I got an error along the lines of "$ not
recogised".

Would it be possible that this is a bug and Monorail should ignore
embedded JS files as well as they will not exist in the file system?



On Jul 24, 2:10 pm, "Hamilton Verissimo"
<hamm...@...> wrote:

> I double checked the code,http://svn.castleproject.org:8080/svn/castle/trunk/MonoRail/Castle.Mo...
>
>                         if (File.Exists(request.PhysicalPath))
>                         {
>                                 return; // Possibly requesting a static file, so we skip routing altogether
>                         }
>
>
>
> On Thu, Jul 24, 2008 at 4:31 AM, Brendan Rice <gumps...@...> wrote:
>
> > Could someone please try the route in the other post as it causes
> > files to be caught in the routing rule. Monorails javascript files do
> > not get loadeded using it,
>
> > Thanks,
>
> > Brendan
>
> > On Jul 23, 8:05 pm, "josh robb" <josh_r...@...> wrote:
> >> On Thu, Jul 24, 2008 at 7:35 AM, Hamilton Verissimo
>
> >> <hamm...@...> wrote:
>
> >> > Strange.. by default MR's routing skips any url that matches a physical file...
>
> >> +1 - this is the correct way to handle this. Anyone that thinks
> >> otherwise needs a meeting with Oren's 2x4.
>
> --
> Cheers,
> hamilton verissimo
> hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andre has sent a patch that made routing ignore that area/controller,
but I had to revert it as it made the resources unavailable. I just
added a route rule that fixed:

                        ruleContainer.Add(
                                new PatternRoute("mrfiles", "/MonoRail/Files/<action>").
                                        DefaultForArea().Is("MonoRail").
                                        DefaultForController().Is("Files")
                                );



On Thu, Jul 24, 2008 at 2:35 PM, Brendan Rice <gumpshen@...> wrote:
>
> That would maybe exlpain things a little better.  The routing threw an
> exception 5 times once for the css and 4 for the javascript files that
> are embedded in the Monorail assembly.  My page was stilled styled but
> I lost all javascript.  I got an error along the lines of "$ not
> recogised".
>
> Would it be possible that this is a bug and Monorail should ignore
> embedded JS files as well as they will not exist in the file system?



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by Brendan Rice :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks Hamilton.

On Jul 24, 8:08 pm, "Hamilton Verissimo"
<hamm...@...> wrote:

> Andre has sent a patch that made routing ignore that area/controller,
> but I had to revert it as it made the resources unavailable. I just
> added a route rule that fixed:
>
>                         ruleContainer.Add(
>                                 new PatternRoute("mrfiles", "/MonoRail/Files/<action>").
>                                         DefaultForArea().Is("MonoRail").
>                                         DefaultForController().Is("Files")
>                                 );
>
> On Thu, Jul 24, 2008 at 2:35 PM, Brendan Rice <gumps...@...> wrote:
>
> > That would maybe exlpain things a little better.  The routing threw an
> > exception 5 times once for the css and 4 for the javascript files that
> > are embedded in the Monorail assembly.  My page was stilled styled but
> > I lost all javascript.  I got an error along the lines of "$ not
> > recogised".
>
> > Would it be possible that this is a bug and Monorail should ignore
> > embedded JS files as well as they will not exist in the file system?
>
> --
> Cheers,
> hamilton verissimo
> hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Routing Feature Request

by c.sokun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


isn't it a prefer to store resource file in separate virtual dir
On Jul 25, 6:26 am, Brendan Rice <gumps...@...> wrote:

> Thanks Hamilton.
>
> On Jul 24, 8:08 pm, "Hamilton Verissimo"
>
> <hamm...@...> wrote:
> > Andre has sent a patch that made routing ignore that area/controller,
> > but I had to revert it as it made the resources unavailable. I just
> > added a route rule that fixed:
>
> >                         ruleContainer.Add(
> >                                 new PatternRoute("mrfiles", "/MonoRail/Files/<action>").
> >                                         DefaultForArea().Is("MonoRail").
> >                                         DefaultForController().Is("Files")
> >                                 );
>
> > On Thu, Jul 24, 2008 at 2:35 PM, Brendan Rice <gumps...@...> wrote:
>
> > > That would maybe exlpain things a little better.  The routing threw an
> > > exception 5 times once for the css and 4 for the javascript files that
> > > are embedded in the Monorail assembly.  My page was stilled styled but
> > > I lost all javascript.  I got an error along the lines of "$ not
> > > recogised".
>
> > > Would it be possible that this is a bug and Monorail should ignore
> > > embedded JS files as well as they will not exist in the file system?
>
> > --
> > Cheers,
> > hamilton verissimo
> > hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price