Package com.freewebsys.blog.service

Examples of com.freewebsys.blog.service.PostTypeService


    int pageSize = 10;
    ApplicationContext applicationContext = WebApplicationContextUtils
        .getWebApplicationContext(request.getSession()
            .getServletContext());
    PostTypeService postTypeService = (PostTypeService) applicationContext
        .getBean("postTypeService");
    PostService postService = (PostService) applicationContext
        .getBean("postService");
    List<Post> postList = null;
    List<PostType> postTypeList = null;
    try {
      postList = postService.findAllPost();
      postTypeList = postTypeService.findAllPostType();
    } catch (Exception e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
View Full Code Here


   */
  public void init(ServletConfig config) throws ServletException {
    System.out.println("inti");
    ApplicationContext applicationContext = WebApplicationContextUtils
        .getWebApplicationContext(config.getServletContext());
    PostTypeService postTypeService = (PostTypeService) applicationContext
        .getBean("postTypeService");
   
    OptionService optionService = (OptionService) applicationContext
        .getBean("optionService");
    try {
      PostType postType = postTypeService.findHomePostType();
      if (postType == null) {
        postType = new PostType();
        postType.setName("首页");
        postType.setIsHome(1);
        // 设置排序号
        postType.setOrderId(new Date().getTime());
        // 保存
        postTypeService.savePostType(postType);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
   
View Full Code Here

TOP

Related Classes of com.freewebsys.blog.service.PostTypeService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.