Hello, I've making a Login app with Struts2.
This is my code so far

Form panel :
Code:
var loginForm = new Ext.FormPanel({
    url          : 'Login.action',
    ...
    items:[{
        fieldLabel : '사용자 ID',
        inputType  : 'text',
        id         : 'id',
        allowBlank : false
    },{
        fieldLabel : '사용자 PW',
        inputType  : 'password',
        id         : 'password',
        allowBlank : false
    }],

    buttons:[{
        text:'login',
        id:'btn_login',
        type:'submit',
        formBind: true,
        handler:function(){
            loginForm.getForm().submit({
                method:'POST',
                waitTitle:'...',
                waitMsg:'Please wait..',
        
                success:function(){ 
                    Ext.Msg.alert('message', 'login success!', function(btn, text){
                        if (btn == 'ok'){
                            var redirect = 'main.jsp'; 
                            window.location = redirect;
                        }
                    });
                   },

                failure:function(form, action){
                    Ext.MessageBox.show({
                        title: 'failed.',
                        msg: action.result.data,
                        buttons: Ext.MessageBox.OK,
                        icon: Ext.MessageBox.WARNING,
                        modal:false
                    });
                }
            })
        }
    }]
});
Login.java(the 'Login.action' action) :
Code:
public class Login extends ActionSupport {
    private String id;
    private String password;
    public String execute() throws Exception{
        if ("admin".equals(id)) {
            Map session = ActionContext.getContext().getSession();
            session.put("logged_in","true");
            System.out.println("success");
            return SUCCESS;
        }
        else{
            System.out.println("failed");
            return ERROR;
        }
    }
    
    getters&setters of the variables 'id' & 'password'
}
'Login' action in struts.xml :
Code:
<action name="Login" class="action.Login" > 
            <result name="success" type="json">
                <param name="location">main.jsp</param>
            </result>
            <result name="error" type="json">
                <param name="location">main.jsp</param>
            </result>
        </action>
No matter what result is, it shows up the fail massage box. But weird thing is that Login action is OK. I mean, if I type 'admin' and submit, it excutes 'System.out.println("success");' and in opposite case, it excutes 'System.out.println("failed");'. So, I think the Login action is not wrong. What is the wrong with my code?

Thanks.
Stan