SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error cannot access class com.opensymphony.xwork2.ActionContext, wrong version

    Error(1,32): cannot access class com.opensymphony.xwork2.ActionContext; class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0
    Code:
    import com.opensymphony.xwork2.ActionContext;
    import com.opensymphony.xwork2.ActionSupport;
    import java.util.Map;
    
    public class loginAction extends ActionSupport 
    {
    private String userId;
      private String password;
      public String execute() throws Exception{
    
        if ("admin".equals(userId) && "admin".equals(password)) {
          Map session = ActionContext.getContext().getSession();
          session.put("logged-in","true");
                return SUCCESS;
            }
        else{
           return ERROR;
        }
        }
    
        public String logout() throws Exception {
    
        Map session = ActionContext.getContext().getSession();
        session.remove("logged-in");
            return SUCCESS;
        }
    
        public String getPassword() {
            return password;
        }
    
        public void setPassword(String password) {
            this.password = password;
        }
    
        public String getUserId() {
            return userId;
        }
    
        public void setUserId(String userId) {
            this.userId = userId;
        }
    }

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2005
    Location
    London
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which version of java are you using?
    it sounds like you need version 1.5 or higher.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •