struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Weis <djw...@sjdjweis.com>
Subject Redirecting from an action
Date Mon, 11 Feb 2002 16:58:57 GMT

I'm trying to do something simple that isn't working - I want to make my
action reshow a form if it isn't happy with the contents. This is how I
have my struts-config.xml setup:

    <action  path="/login/form"
             type="org.apache.struts.action.ForwardAction"
             parameter="/login.jsp" 
             redirect="true" />

    <action  path="/login/submit"
             type="com.internetsolver.login.LoginAction"
             name="LoginForm"
             scope="request"
             validate="false"
             input="/login/form">
     <forward name="success" path="/admin/" redirect="true" />
    </action>

and this is what I'm doing in my LoginAction

if (username.equals("invalid-test")) {
    return (mapping.findForward("/login/form"));
} else {
    return (mapping.findForward("success"));
}

I have used this username for testing until the database part is
written. Entering a username besides the one above does redirect me to
/admin/ like I want, but entering the invalid-test username sends me to
/login/submit.do and just stays there. The contents of the page are
<html><body></body></html>. How do I make my login action send me
back to
/login/form.do with whatever I entered prefilled? 

Thanks
dave


-- 
Dave Weis             "I believe there are more instances of the abridgement
djweis@sjdjweis.com   of the freedom of the people by gradual and silent
                      encroachments of those in power than by violent 
                      and sudden usurpations."- James Madison


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message