Hi there,

Thanks to both of you for your responses.  I'm running Lift 1.0.

Maybe I'm missing the point of URL rewriting, so here's what I really
want to do.

My "Customers" link shows /customer/list/1, and when I click on this I
want to see a page (cust.html or customer.html -- I don't really mind
which) and be given a page number parameter equal to "1".  At the
bottom of this page will be a "next" button with a URL of /customer/
list/2.

When someone clicks on my "next" link I get the same page shown, but
this time the page number parameter equals "2".  And so on, giving me
basic pagination.  It may take me some time to get there, but that's
my goal!

Regards,

Paul.


On 7 Aug, 18:09, Tim Nelson <tnell...@gmail.com> wrote:
> Paul,
>
> The basic problem here is that whatever you put in the RewiteResponse must
> be in your SiteMap. So, to get a url like /customer/list/1 to be rewritten
> to /cust.html?page=1
>
> you would need:
>
> Menu(Loc("Customers",
> "cust"::Nil, "Customers"))
>
> in your SiteMap. Doing this however means that your menu link will be /cust
> and you would have to manually generate your links.
>
> I am running into this same "problem" and haven't figured out how to handle
> it yet.
>
> Tim
>
> On Fri, Aug 7, 2009 at 11:28 AM, pabraham 
> <paulabraham...@googlemail.com>wrote:
>
>
>
> > Hello again,
>
> > I've been looking at the article on URL rewriting at [1] and am having
> > a problem getting a URL rewrite to work.
>
> > My sitemap contains Menu(Loc("Customers",
> > "customer"::"list"::"1"::Nil, "Customers")), so clicking on Customers
> > gives a link to /customer/list/1.
>
> > My rewrite is:
> >    LiftRules.rewrite.append {
> >      case RewriteRequest(ParsePath("customer"::"list"::page::Nil, _,
> > _, _), _, _) =>
> >      RewriteResponse("cust" :: Nil, Map("page" -> page))
> >    }
>
> > so clicking on /customer/list/1 should show cust.html and give me a
> > "page" parameter.  The cust.html file exists.
>
> > Unfortunately I get "The Requested URL /customer/list/1 was not found
> > on this server".
>
> > Do I need to do anything else to get this to work?
>
> > Paul.
>
> > [1]http://wiki.github.com/dpp/liftweb/about-url-rewriting
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to