1. 程式人生 > >微信開發準備(二)--springmvc+mybatis專案結構的搭建

微信開發準備(二)--springmvc+mybatis專案結構的搭建

轉自:http://www.cuiyongzhi.com/post/34.html

前面一篇有說道如何在MyEclipse中搭建maven專案,這裡將繼續介紹如何在搭建好的基礎maven專案中引入我們常用的javaweb框架——SpringMVC!

①在建立好的maven專案中的pom.xml檔案引入依賴,程式碼如下:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 < project  xmlns = "http://maven.apache.org/POM/4.0.0"  xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"      xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
"
>      < modelVersion >4.0.0</ modelVersion >      < groupId >wechat.cuiyongzhi.com</ groupId >     
< artifactId >wechat</ artifactId >      < packaging >war</ packaging >      < version >0.0.1-SNAPSHOT</ version >      < name >wechat</ name >      < url >http://maven.apache.org</ url >      < dependencies >          <!-- spring -->          < dependency >              < groupId >org.springframework</ groupId >              < artifactId >spring-test</ artifactId >              < version >3.2.0.RELEASE</ version >          </ dependency >          < dependency >              < groupId >org.springframework</ groupId >              < artifactId >spring-webmvc</ artifactId >              < version >3.2.0.RELEASE</ version >          </ dependency >          < dependency >              < groupId >org.springframework</ groupId >              < artifactId >spring-core</ artifactId >              < version >3.2.0.RELEASE</ version >          </ dependency >            <!-- mybatis -->          < dependency >              < groupId >org.mybatis</ groupId >              < artifactId >mybatis</ artifactId >              < version >3.1.1</ version >          </ dependency >          < dependency >              < groupId >org.mybatis</ groupId >              < artifactId >mybatis-spring</ artifactId >              < version >1.1.1</ version >          </ dependency >            <!-- mysql -->          < dependency >              < groupId >mysql</ groupId >              < artifactId >mysql-connector-java</ artifactId >              < version >5.1.21</ version >          </ dependency >            <!-- junit測試 -->          < dependency >              < groupId >junit</ groupId >              < artifactId >junit</ artifactId >              < version >4.11</ version >              < scope >test</ scope >          </ dependency >            <!-- mysql阿里連線池druid -->          < dependency >              < groupId >com.alibaba</ groupId >              < artifactId >druid</ artifactId >              < version >0.2.9</ version >          </ dependency >            <!-- spring aop包 -->          < dependency >              < groupId >org.aspectj</ groupId >              < artifactId >aspectjweaver</ artifactId >              < version >1.7.1</ version >          </ dependency >            <!-- json包 -->          < dependency >              < groupId >com.alibaba</ groupId >              < artifactId >fastjson</ artifactId >              < version >1.2.7</ version >          </ dependency >            <!-- 檔案上傳包 -->          < dependency >              < groupId >commons-fileupload</ groupId >              < artifactId >commons-fileupload</ artifactId >              < version >1.2.2</ version >          </ dependency >            <!--servlet包 -->          < dependency >              < groupId >javax.servlet</ groupId >              < artifactId >servlet-api</ artifactId >              < version >3.0-alpha-1</ version >          </ dependency >            < dependency >              < groupId >javax.servlet.jsp</ groupId >              < artifactId >jsp-api</ artifactId >              < version >2.1</ version >              < scope >provided</ scope >          </ dependency >            < dependency >              < groupId >javax.servlet</ groupId >              < artifactId >jstl</ artifactId >              < version >1.2</ version >          </ dependency >            <!-- 日誌包 -->          < dependency >              < groupId >log4j</ groupId >              < artifactId >log4j</ artifactId >              < version >1.2.17</ version >          </ dependency >      </ dependencies >      < build >          < finalName >wechat</ finalName >      </ build > </ project >

②修改專案路徑下的web.xml檔案如下:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 <? xml  version = "1.0"  encoding = "UTF-8" ?> < web-app  xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"      xmlns:web = "http://java.sun.com/xml/ns/javaee"  xmlns = "http://java.sun.com/xml/ns/javaee"      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd      http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket.xsd"      id = "WebApp_ID"  version = "3.0" >      < display-name >com.cuiyongzhi.wechat</ display-name >      < context-param >          < param-name >contextConfigLocation</ param-name >          < param-value >classpath:spring.xml,classpath:spring-mybatis.xml</ param-value >          <!-- ,classpath:spring-quartz.xml 用於做任務排程 任務定時都可以 -->      </ context-param >      < context-param >          < param-name >log4jConfigLocation</ param-name >          < param-value >classpath:log4j.properties</ param-value >      </ context-param >      < listener >          < listener-class >org.springframework.web.util.Log4jConfigListener</ listener-class >      </ listener >      <

相關推薦

開發準備()--springmvc+mybatis專案結構搭建

轉自:http://www.cuiyongzhi.com/post/34.html 前面一篇有說道如何在MyEclipse中搭建maven專案,這裡將繼續介紹如何在搭建好的基礎maven專案中引入我們常用的javaweb框架——SpringMVC! ①在建立好的maven專案中的pom.xml檔案引入依賴

開發準備(一)--Maven倉庫管理新建WEB專案

轉自:http://www.cuiyongzhi.com/post/13.html 在我們的專案開發中經常會遇到專案週期很長,專案依賴jar包特別多的情況,所以我們經常會在專案中引入Maven外掛,建立起Maven專案,今天我就記錄一個簡單的Maven專案建立的簡單流程! ①Maven基礎專案的建立(前提

開發準備(一)——Maven倉庫管理新建WEB項目

情況 IT 分享圖片 dex 記錄 項目依賴 完全 大致 .com 在我們的項目開發中經常會遇到項目周期很長,項目依賴jar包特別多的情況,所以我們經常會在項目中引入Maven插件,建立起Maven項目,今天我就記錄一個簡單的Maven項目建立的簡單流程! ①Maven基礎

springboot與開發

關注、接收和傳送訊息 上一節講述了配置介面,這次看一下關注、接收和傳送訊息。 我們先看效果圖 在上一次的controller裡面加上: @PostMapping("/wx") public void doPost(HttpServletRequest

開發)——獲取信使用者的基本資訊

我們在微信開發過程中,很可能需要獲取授權使用者的微信頭像來作為系統的預設頭像,這是個非常簡單的實現 現在我們的手上已經用於openid和accesstoken(這不是全域性token!!!),不知道如何獲取的見上一節,微信開發獲取openid 我們通過以下方法

企業開發,嵌入自定義專案,及JS-SDK的引用

目標:          基於H5開發專案,嵌入到企業微信中,並接入js-sdk 並運用企業微信介面。 開發環境:         騰訊企業微信最新版本。後端環境不做要求,能跑通即可(這裡我選用的是eclipse的maven專案,之前也出了一篇搭建後臺專案的部落格,可以

開發準備(三)--框架以及工具的基本使用

轉自:http://www.cuiyongzhi.com/post/35.html 在前面兩篇中我們從基本的專案建立到框架搭建,將專案已經搭建成功,並將基本的配置項也都已經配置完成,那麼這裡我們就進入到對框架的熟悉和一個工具generator的使用! (一)專案部分配置檔案的初始化 我們在前面框架中層在

開發準備(四)--nat123內網地址公網對映實現

轉自:http://www.cuiyongzhi.com/post/37.html 在前面幾篇中我們一直說的開發準備工作主要是基於開發框架上的,這裡我們說的就逐漸接近開發過程中的實體操作了,如果你之前還沒有了解微信平臺開發那麼你或許是不知道的但是你現在是必須要知道的:【微信公眾平臺開發對接必須以http:/

開發準備(四)--nat123內網地址公網映射實現

現在 .html them 平臺 default 但是 域名 過程 調試 轉自:http://www.cuiyongzhi.com/post/37.html 在前面幾篇中我們一直說的開發準備工作主要是基於開發框架上的,這裏我們說的就逐漸接近開發過程中的實體操作了,如果你之前

埠對映ngrok(開發準備

由於要接入微信公眾號,查看了官網上的接入文件,必需是80埠而且微信伺服器需要驗證token,那我本地開發不可能每次都把原始碼上傳到伺服器上吧,而且也不方便,這就需要能內網穿透的工具,能讓外網通過外網域名訪問我本機的127.0.0.1IP,於是研究了一下ngrok,ngro

[1]java開發-準備工作

閒話   畢業兩年多,從事軟體開發工作兩年多,本人經歷就是一個從入門到懵逼的過程。大大小小也經歷了不少專案,但似乎什麼都沒學到,似乎專案中用到的知識又都知道了。思來想去,歸根結底還是缺少總結,沒記錄下自己學習的腳步。今天(2017年7月6日)開始自己的部落格生

Android開發):程式碼分析

package com.example.teststudyshare.wxapi; import java.io.ObjectOutputStream.PutField; import android.R; import android.app.Activity; import android.content

從壹開始服務 [ DDD ] 之 ║ DDD入門 & 專案結構搭建

前言 哈嘍大家好,今天是週二,我們的DDD系列文章今天正式開始講解,我這兩天一直在學習,也一直在思考如何才能把這一個系列給合理的傳遞給大家,並且達到學習的目的,還沒有特別好的路線,只是一個大概的模糊的安排,畢竟我沒有做過講師,但是我感覺還是需要對自己負責,至少要對得起這個熬夜寫的部落格吧

開發 網頁應用 本地測試環境的搭建(多圖)

剛剛接觸微信公眾號開發,完全是一個小白。今天搭建本地測試環境真的是弄了整整一下午,一直到剛剛,才弄好。話不多說,下面分享一下整個搭建過程; 1.下載微信web開發者工具 安裝並登入,登陸前要確保已經登陸的賬號有微信公眾號的測試許可權 2.將本地tomcat伺服器埠改成80

開發01 --- 接入專案 + springBoot +mybatis

1.公眾號的申請,成功之後大概是這個樣子的 2.找到開發,點選基本配置,同意成為開發者之後 3.你會看到如下圖 4.配置內網穿透工具 natapp:  官網:https://www.zhexi.tech/ 注意:申請試用賬號,2個小時會改變一次ur

開發SpringMVC將url生成維碼圖片直接展示在頁面上

利用google的開源包zxing生成二維碼 第一步:maven專案的zxing依賴 1 <!-- google zxing 生成二維碼 --> 2 <dependency> 3 <groupId>com.goog

開發準備工作簡版)

scale tro ima acc client XML 帳號 red wid 1.準備工作 1.1 首先需要一個url地址,用來接收相關的數據 1.2 註冊開發者賬號進行開發(可用公眾平臺測試賬號) 1.3 appid,第三方用戶唯一憑證(你的AppID) 1.4 sec

php開發之帶參數維碼的使用

cor odin ews json 保存 explode 想要 int gty 最近做微信PC端網頁微信相關功能的開發,從一個新手的角度來說,微信公眾號的文檔還是不好理解的,網上找的帖子大都也都基本上是復制微信公眾平臺上給的文檔,開發微信帶參數二維碼過程中還是遇到不少坑的,

開發H5十人牛牛出租源碼下載搭建

小遊戲 思路 數據 打開網頁 手機 scope dev ans cut 微信開發H5十二人牛牛出租源碼下載搭建h5.fanshubbs.com聯系Q1687054422不同於傳統的手遊商店下載模式,HTML5 手機網頁遊戲是可以直接運行在微信內置的瀏覽器裏。   先上圖,感

基於java的公眾號開發視頻教程

質量 經典 數據分析 大數據 spark leet hadoop 專家 擴展 query 詳情請交流 QQ 709639943 00、基於java的微信公眾號二次開發視頻教程 00、leetcode 算法 面試 00、北風網 零基礎到數據(大數據)分析專家-首席分