使用JavaWeb框架时直接访问Action的时候发生报错:
页面显示:
后台报错:
Action代码:
@Controller
@Scope("prototype")
@ParentPackage("struts-default")
@Namespace("/riskConfig")
public class RiskConfigAction extends BaseAction implements ModelDriven<Map> {
private RiskConfigService riskConfigService;
Map map = new HashMap();
@Override
public Map getModel() {
return map;
}
@Action(value = "getRegionList", results = {
@Result(name = "success", location = "/jsp/riskConfig/region.jsp", type = "dispatcher") })
public String getRegionList() {
List<Map<String, Object>> regionList = riskConfigService.getRegion();
request.setAttribute("regionList", regionList);
return "success";
}
}
struts.xml配置文件内容: