How to realize online Flower Shop Mall by Java
Editor to share with you how Java realizes the online florist mall. I hope you will get something after reading this article. Let's discuss it together.
I. brief introduction of the project
Function: a complete online florist shopping mall system, which supports the registration and landing system messages of foreground members, flower variety selection, details browsing, joining shopping cart, buying flowers, etc.; backstage support administrator's flower species addition, flower details addition and modification, user management, message management, shopping mall news management and so on.
II. Project operation
Environment configuration: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (both supported by IntelliJ IDEA,Eclispe,MyEclispe,Sts)
Project technology: JSP + Servlert + html+ css + JavaScript + JQuery + Ajax + Fileupload and so on.
Mall merchandise query and display code: mall merchandise query: @ Controllerpublic class GoodsController {@ Resource private NewBeeMallGoodsService newBeeMallGoodsService; @ Resource private NewBeeMallCategoryService newBeeMallCategoryService; @ GetMapping ({"/ search", "/ search.html"}) public String searchPage (@ RequestParam Map params, HttpServletRequest request) {if (params.get ("page")) {params.put ("page", 1) } params.put ("limit", Constants.GOODS_SEARCH_PAGE_LIMIT); / / encapsulating classified data if (params.containsKey ("goodsCategoryId") & &! StringUtils.isEmpty (params.get ("goodsCategoryId") + "")) {Long categoryId = Long.valueOf (params.get ("goodsCategoryId") + ""); SearchPageCategoryVO searchPageCategoryVO = newBeeMallCategoryService.getCategoriesForSearch (categoryId) If (searchPageCategoryVO! = null) {request.setAttribute ("goodsCategoryId", categoryId); request.setAttribute ("searchPageCategoryVO", searchPageCategoryVO) }} / / Encapsulation parameters for the front end to echo if (params.containsKey ("orderBy") & &! StringUtils.isEmpty (params.get ("orderBy") + "") {request.setAttribute ("orderBy", params.get ("orderBy") + "");} String keyword = "" / / A pair of keyword filters if (params.containsKey ("keyword") & &! StringUtils.isEmpty ((params.get ("keyword") + ") .trim ()) {keyword = params.get (" keyword ") +";} request.setAttribute ("keyword", keyword); params.put ("keyword", keyword) / / encapsulate commodity data PageQueryUtil pageUtil = new PageQueryUtil (params); request.setAttribute ("pageResult", newBeeMallGoodsService.searchNewBeeMallGoods (pageUtil)); return "mall/search";} @ GetMapping ("/ goods/detail/ {goodsId}") public String detailPage (@ PathVariable ("goodsId") Long goodsId, HttpServletRequest request) {if (goodsId < 1) {return "error/error_5xx" } NewBeeMallGoods goods = newBeeMallGoodsService.getNewBeeMallGoodsById (goodsId); if (goods = = null) {return "error/error_404";} NewBeeMallGoodsDetailVO goodsDetailVO = new NewBeeMallGoodsDetailVO (); BeanUtil.copyProperties (goods, goodsDetailVO); goodsDetailVO.setGoodsCarouselList (goods.getGoodsCarousel (). Split (","); request.setAttribute ("goodsDetail", goodsDetailVO); return "mall/detail" }} verification code generation code: verification code generation: @ Componentpublic class KaptchaConfig {@ Bean public DefaultKaptcha getDefaultKaptcha () {com.google.code.kaptcha.impl.DefaultKaptcha defaultKaptcha = new com.google.code.kaptcha.impl.DefaultKaptcha (); Properties properties = new Properties (); properties.put ("kaptcha.border", "no"); properties.put ("kaptcha.textproducer.font.color", "black") Properties.put ("kaptcha.image.width", "150"); properties.put ("kaptcha.image.height", "40"); properties.put ("kaptcha.textproducer.font.size", "30"); properties.put ("kaptcha.session.key", "verifyCode"); properties.put ("kaptcha.textproducer.char.space", "5"); Config config = new Config (properties) DefaultKaptcha.setConfig (config); return defaultKaptcha;}} after reading this article, I believe you have a certain understanding of "how Java realizes the online florist mall". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!