3
package com.achala.saraswathi.action;

import com.achala.saraswathi.data.AdminBE;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class AdminLoginAction extends ActionSupport{


    private AdminBE adminBE;

    public String execute(){
        return Action.SUCCESS;
    }


    public String adminLogin(){
        if(adminBE.getUserName().equals("admin")&&adminBE.getPassword().equals("admin")){
            return Action.SUCCESS;
        }
        addActionError("Invalid username or password");
        return Action.INPUT;
    }

    public AdminBE getAdminBE() {
        return adminBE;
    }

    public void setAdminBE(AdminBE adminBE) {
        this.adminBE = adminBE;
    }       
}

After clicking that submit button the

ParametersInterceptor - Unexpected Exception caught Error setting expression 'x' with value 

error is coming, I don't know why?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Naveen Kocherla
  • 399
  • 9
  • 27

2 Answers2

2

I suspected that your form is using submit button with type="image". With this button it will post parameter x,y to the request parameter. So to avoid this error you can:

  • Use another type of button such as with background image
  • Add x, y property to your action class
0

To solve this without destroying your object model, see the detailed answer here:

How to remove x and y on submit in HTML form with Image type button?

Community
  • 1
  • 1
Erica Kane
  • 3,137
  • 26
  • 36