I'm using DWR for Ajax calls in my code and I've this class defined which works fine when I'm calling the method locationList like ManageLocation.locationList(selectedVal,displayInfo);
However, if I try to do the same thing with another method from the javascript code like this ManageLocation.test(selectedVal,displayInfo);, it's not even hitting this class and I get a Javascript error that this method test doesn't exist.
public class ManageLocation {
WebContext ctx = WebContextFactory.get();
ServletContext cs = ctx.getServletContext();
WebApplicationContext webctx = WebApplicationContextUtils.getRequiredWebApplicationContext(cs);
CompanyLocationManager clMgr = (CompanyLocationManager) webctx.getBean("companyLocationManager");
public String locationList(String val) {
return clMgr.getCompanyLocationByQuery("name LIKE '" + val + "%'").toString();
}
public String test(Integer val) {
return clMgr.getCompanyLocationByQuery("where id='" + val + "'").toString();
}
}
Is there anything like I can have only one method inside the DWR related classes?