hi all,

if you want to use http://code.google.com/p/shams/
projects with tapestry 5.0.9

you most use response.sendRedirect instead of Link object.

here are classes that most change :

Login.java


    @OnEvent(value = "submit")
    public void login() throws IOException {
        StringBuffer path = new StringBuffer(request.getContextPath())
                .append("/j_acegi_security_check")
                .append("?")
                .append("j_username").append("=").append(username)
                .append("&")
                .append("j_password").append("=").append(password);
        response.sendRedirect(path.toString());
    }



SignUp.java

    @OnEvent(value = "submit")
    public Object save() throws IOException {
        duplicate = false;
        notmatched = false;

        if (!confirm.equals(user.getPassword())) {
            notmatched = true;
            return Signup.class;
        }

        try {
            service.save(user);

            StringBuffer path = new StringBuffer(request.getContextPath())
                    .append("/j_acegi_security_check")
                    .append("?")
                    .append("j_username").append("=").append(
user.getUsername())
                    .append("&")
                    .append("j_password").append("=").append(
user.getPassword());

            response.sendRedirect(path.toString());
            return null;
        } catch (DataIntegrityViolationException e) {
            duplicate = true;
            return Signup.class;
        }
    }


Layout.java


    @OnEvent(value = "action", component = "logout")
    Object logout() throws IOException {
        String path = request.getContextPath() + "/j_acegi_logout";
        response.sendRedirect(path);
        return null;
    }


-- 
sincerely yours
M. H. Shamsi

Reply via email to