On Mon, Feb 22, 2010 at 1:53 AM, Restel, Hannes <
[email protected]> wrote:

> Hi Nico,
> thanks for your answer.
>
> I think you misunderstood me: I want to redirect to a HTML-page without
> using a SiteMap at all. So the page I redirect to is not registered in any
> place. It simply resides in my 'webapp' folder.
> But when trying to redirect to that page, the resource (i.e. my page) is
> not found.
>

Yes.  This is correct behavior.  If you have defined a SiteMap, Lift will
not serve any pages except those that are defined in the SiteMap.  If you
are using Lift > 1.0.x, there will be a polite message as part of the 404
informing you why the page was not served (if you're running in development
mode.)

You have a couple of choices to serve additional pages.  First, you can
include them in the SiteMap and mark them as "Hidden" such that there's no
menu item displayed, but the page will still be served.  Second, you can
define a subdirectory that all content will be served from.


>
> So please try again :-)
>
> (And yes: I did read The Lift Book :-)
>
> Cheers,
>         Hannes
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Nico Tromp
> Sent: Friday, February 19, 2010 2:46 PM
> To: Lift
> Subject: [Lift] Re: redirectTo in (Stateful)Snippets
>
> Hannes, sorry for the strange :) sentence. It should read:
>
> did you register the page in the Boot class?
>
> If you want to know more about the SiteMap have a look at chapter 5
> from the lift book. At the bottom of the page (http://
> groups.google.com/group/the-lift-book) there is a link to the PDF
> version.
>
> Happy reading
>
> Nico Tromp
>
> On Feb 19, 1:49 pm, Nico Tromp <[email protected]> wrote:
> > Hannes,
> >
> > did you registered the page in the in the Boot class? Below is a small
> > example.
> >
> > ===================================
> > class Boot {
> >   def boot {
> >     // where to search snippet
> >     // LiftRules.addToPackages("<enter your package>")
> >
> >  // Build SiteMap
> >     val entries = Menu(Loc("Home", List("index"), "Home")) ::
> >       Menu(Loc("Search", List("search"), "Search page")) ::
> >       Nil
> >     LiftRules.setSiteMap(SiteMap(entries:_*))
> >   }}
> >
> > ===================================
> > Hope this is helpfull
> >
> > Cheers Nico Tromp
> >
> > On Feb 19, 1:26 pm, "Restel, Hannes"
> >
> >
> >
> > <[email protected]> wrote:
> > > Hi,
> >
> > > I am new to Lift (and Scala) and need help with dispatching/redirecting
> to a page after processing a form.
> >
> > > My problem: I get a "The Requested URL /search was not found on this
> server" error message although the page "search.html" does exist.
> >
> > > When adding the page "search.html" to the LiftRules-SiteMap, then the
> page does exist!
> > > So is there any need to register HTML pages? I hope not!
> >
> > > This is my HTML fragment:
> > > <lift:surround with="default" at="content">
> > >  <h3 class="alt" >Search
> > >   <lift:HelloWorld.search form="POST">
> > >     <entry:searchfield/>
> > >     <entry:submit/>
> > >   </lift:HelloWorld.search>
> > >  </h3>
> > > </lift:surround>
> >
> > > And this is the corresponding Scala code:
> > > class HelloWorld extends StatefulSnippet {
> >
> > >   override def dispatch:DispatchIt = {
> > >     case "search" => search _
> > >   }
> >
> > >   def search(xhtml : NodeSeq) : NodeSeq = {
> > >     object searchExpression extends RequestVar("")
> >
> > >     def processSearch () {
> > >       if (searchExpression.isEmpty) {
> > >         S.error("Must not be empty!")
> > >       }
> > >       else {
> > >         S.notice("Value was: " + searchExpression)
> > >         redirectTo("/search")
> > >       }
> > >     }
> >
> > >     bind("entry", xhtml,
> > >         "searchfield" -> SHtml.text(searchExpression.is,
> searchExpression(_)),
> > >         "submit" -> SHtml.submit("Suche", processSearch)
> > >     )
> > >   }
> >
> > > }
> >
> > > Why cannot my "/search" page be found?
> >
> > > Thanks for help!
> > >         Hannes
> >
> > > Hannes Restel | Fraunhofer Institut für Software- und Systemtechnik
> > > Sichere Business IT-Infrastrukuren, Studentischer Mitarbeiter
> > > Steinplatz 2, 10623 Berlin, Germany
> > > Telefon: +49 (0)30/24 306-324
> > > mailto:[email protected]://www.isst.fraunhofer.de
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

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

Reply via email to