java网页授权获取用户基本信息_java微信网页授权获取用户信息以及JSSDK自定义分享等功能<一>...

博主采用的是eclipse+springmvc+jsp来做这一功能讲解。如控制器采用的是其他组件,原理一样,自己结合自己的实际环境来调整。

尊重原创,觉得有用多多推广,顺便给个赞。谢谢。

分三步:

第一,web.xml和applicationContext.xml的配置,如已掌握的童鞋,可自动忽略这节。

新建一个web工程,然后在src目录下新建一个applicationContext.xml文件

web.xm文件,源码在图片下方

63442aefb8c31741d19c399dac13e9a9

xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

springmvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:applicationContext.xml

1

springmvc

*.do

encodingfilter

org.springframework.web.filter.CharacterEncodingFilter

encoding

UTF-8

encodingfilter

/*

/WEB-INF/index.jsp

404

/WEB-INF/404.jsp

applicationContext.xml文件

9a939cad58653195f1f82d7f0d43da9a

xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"

xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"

xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:mvc="http://www.springframework.org/schema/mvc"

xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

class="org.apache.commons.dbcp.BasicDataSource">

class="org.springframework.web.servlet.view.InternalResourceViewResolver">

整个工程目录如下:

665229a49229296c5a92bd0ff968d417

项目引入jar包如下:这些是工程中用到的全部jar包,包括加解密,xml解析,springmvc等用到的全部jar包。如你的工程不需要则可以自行删除对应jar包。

33b6c69a342eb740e12630ff465920e5

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值