挂别人公司做网站可以吗,北京最大做网站的公司有哪些,joomla与wordpress比较,什么网站可以做长图2019独角兽企业重金招聘Python工程师标准 首先#xff0c;检查一下你lib下有没有 common-annotations.jar 这个jar包 没有的话要导入工程。 下一步配置spring的配置文件applicationContex.xml#xff0c;加入命名空间 红色为需要添加的内容 beans xmlns… 2019独角兽企业重金招聘Python工程师标准 首先检查一下你lib下有没有 common-annotations.jar 这个jar包 没有的话要导入工程。 下一步配置spring的配置文件applicationContex.xml加入命名空间 红色为需要添加的内容 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsdcontext:component-scan base-package你要扫描那个包例如com.myprogram annotation-configtrue/ 这句话的意思时当启动服务器的时候spring自动扫描你设置扫描的包下面的添加注解了的类 例如 服务层service定义接口和接口实现类 接口 public interface UsersLogsService {public abstract void delete(UsersLogs persistentInstance);
} 实现类 Service(UsersLogsService)//注解项
public class UsersLogsServiceImpl implements UsersLogsService {public void delete(UsersLogs persistentInstance) {}} 控制层下的某个Action //自己定义需要注意的是/loginAction要与你的struts-config.xml配置文件中映射action的path一致 Controller(/loginAction)//注解项
public class LoginAction extends DispatchAction {//通过Resource注解我们就可以获得刚才注解了的UsersLogsService实例调用他的方法Resource(nameUsersLogsService) private UsersLogsService usersLogsService;public ActionForward checkLogin(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {return null;}} 到此位置配置的流程就是这样Dao数据操作层我没有写创建Dao添加注解 服务层调用Dao就像上面控制层调用服务层一样只要上面流程弄明白了那么恭喜你spring自动扫描的技术你也就学会了。 转载于:https://my.oschina.net/longtutengfei/blog/164741