Hi there.

I'm doing my first steps with Scala and Lift and so far I'm enjoying
this fresh approach in web development.

After some playing around I'm trying now to port an existing web
application to Lift.
However I'm struggling on redirects.
I have a login page and on pressing submit button a login method is
called which should do a redirect to another page.
Although the html page exists the server sais: "The Requested URL /
main.html was not found on this server".
What am I doing wrong?

This is the snippet that does the redirect:

class Login {
    def render(xhtml:NodeSeq) = {
        Log.trace("rendering login...")

        // we need some vars here
        var username = ""
        var password = ""
        var host = ""

        def login() = {
            // some value checking can be done here
            Log.trace("login called!")
            Log.debug("username: " + username)
            Log.debug("password: " + password)
            Log.debug("host: " + host)

            // store in session
            S.set("LoggedInUsername", username)
            S.set("LoggedInHost", host)

            S.error("This is a demo error string!")
            S.notice("This is a demo notice string!")

            // redirect to main
            S.redirectTo("/main.html")
        }

        bind("entry", xhtml,
            "username" -> SHtml.text("", username = _),
            "password" -> SHtml.password("", password = _),
            "host" -> SHtml.text("", host = _),
            "submit" -> SHtml.submit("Login", login))
    }
}


Regards,
Manfred

--~--~---------~--~----~------------~-------~--~----~
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