众筹项目总结

1.  JUnit 单元测试时, 测试类必须写在platform工程下的相应目录,且必须在test相同目录下有相同的映射文件。

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath*:spring/applicationContext.xml"})
public class FincTest {
   
    @Autowired
    private IRechargeService rechargeService;
    
    @Before
    public void setUp()
    
        throws Exception {
    }
    
    @After
    public void tearDown()
        throws Exception {
    }
    
    /**
     *
     * @Description: TODO(测试线下充值查询列表)
     * @author:刘被华
     * @date:2015年10月12日 下午5:27:48
     * @throws Exception
     */
    @Test
    public void findOfflineRechargeList()
        throws Exception {
        BusRechargeOfflineForListReq req = new BusRechargeOfflineForListReq();
        req.setRecUserName("张三");
        rechargeService.findOfflineRechargeList(req);
    }

}


2.  项目启动报错,接口调用会有问题。


3.  JSP页面中使用 Conroller中定义的ModelAndView 数据

 @RequestMapping(value = "/articleGuide.do", method = RequestMethod.GET, produces = {"application/json",
        "application/xml"})
    public ModelAndView getArticleGuide(FindArticleGuideReq findReq, HttpServletRequest request, HttpServletResponse response)
        throws Exception
    {
        String typeName = request.getParameter("typeName");
        int type = Integer.parseInt(typeName);
        String linkUrl = "";
        
        // 4关于我们、5联系我们'
        if (type == 4)
        {
            linkUrl = "home/aboutUs.page";
        }
        else if (type == 5)
        {
            linkUrl = "home/contactUs.page";
        }
        
        ModelAndView mv = new ModelAndView(linkUrl);
        
        TSiteArticleInfoReq tfindReq = new TSiteArticleInfoReq();
        tfindReq.setTypeName(findReq.getTypeName());
        String data = new CommonUtil().callInterfaceMethod(tfindReq, "site/articleInfo/articleGuide", RequestMethod.GET, request);
        if(StringUtils.isNotBlank(data)){
            JSONObject jsonArray = (JSONObject)CommonUtil.getJSONObject(data, null);
            mv.addObject("articleInfo",jsonArray);
        }
            
        return mv;
    }

jsp页面中:

                    <div>
                        <p>${articleInfo.content}</p>
                    </div>


4.   通过链接或 浏览器中输入路径(http://localhost:8080/article/aboutus/articleGuide.do?typeName=5)访问Controller中的方法: 

@Controller
@RequestMapping(value = "article/aboutus")
public class ArticleGuideController extends BaseController
{

 @RequestMapping(value = "/articleGuide.do", method = RequestMethod.GET, produces = {"application/json",
        "application/xml"})
    public ModelAndView getArticleGuide(FindArticleGuideReq findReq, HttpServletRequest request, HttpServletResponse response)
        throws Exception
    {

    }

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值