AddBookAction.java
import com.opensymphony.xwork2.ActionSupport;
public class AddBookAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String id, name,aname,badd;
private String msg = "";
int ok = 0;
public String execute() throws Exception {
Main main = new Main();
try {
ok = main.AddBook(id,name);
if (ok > 0) {
msg = "Registration Successfull";
} else {
msg = "error";
}
} catch (Exception e) {
e.printStackTrace();
}
return "SUCCESS";
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAname() {
return aname;
}
public void setAname(String aname) {
this.aname = aname;
}
public String getBadd() {
return badd;
}
public void setBadd(String badd) {
this.badd = badd;
}
}
Error:
C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\Library\WEB-INF\classes>javac -cp ..\lib\xwork.jar AddBookAction.java
AddBookAction.java:1: error: package com.opensymphony.xwork2 does not exist
import com.opensymphony.xwork2.ActionSupport;
^
AddBookAction.java:3: error: cannot find symbol
public class AddBookAction extends ActionSupport
jars in my lib
Path added in system variable
xwork package added in my lib folder, system variable[class path], but while compiling I'm getting the error stating that the package isn't added on my class path. Doing the project only by notepad file not in the eclipse or any other IDE. This is my task need to do. Tried so many ways but unable to fix.