javaweb源码分享网(html源码分享)
本文目录一览:
- 1、求一套完整的JAVA WEB项目的网络购物网站源代码
- 2、求一个完整的javaweb项目 读书分享交流网站的源代码,
- 3、当前java web 开发用得一般都是哪些框架
- 4、java的代码分享网站有哪些?
- 5、java web怎样实现分享到微信
求一套完整的JAVA WEB项目的网络购物网站源代码
/**
* @description:
* @author chenshiqiang E-mail:csqwyyx@163.com
* @date 2014年9月7日 下午2:51:50
* @version 1.0
*/
package com.example.baidumap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.PagerTabStrip;
import android.support.v4.view.ViewPager;
import android.text.Editable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.ListView;
import com.baidu.mapapi.map.offline.MKOLSearchRecord;
import com.baidu.mapapi.map.offline.MKOLUpdateElement;
import com.baidu.mapapi.map.offline.MKOfflineMap;
import com.baidu.mapapi.map.offline.MKOfflineMapListener;
import com.example.baidumap.adapters.OfflineExpandableListAdapter;
import com.example.baidumap.adapters.OfflineMapAdapter;
import com.example.baidumap.adapters.OfflineMapManagerAdapter;
import com.example.baidumap.interfaces.OnOfflineItemStatusChangeListener;
import com.example.baidumap.models.OfflineMapItem;
import com.example.baidumap.utils.CsqBackgroundTask;
import com.example.baidumap.utils.ToastUtil;
import com.example.system.R;
public class BaiduOfflineMapActivity extends Activity implements MKOfflineMapListener, OnOfflineItemStatusChangeListener
{
// ------------------------ Constants ------------------------
// ------------------------- Fields --------------------------
private ViewPager viewpager;
private PagerTabStrip pagertab;
private MySearchView svDown;
private ListView lvDown;
private MySearchView svAll;
private ExpandableListView lvWholeCountry;
private ListView lvSearchResult;
private ListView views = new ArrayListView(2);
private ListString titles = new ArrayListString(2);
private MKOfflineMap mOffline = null;
private OfflineMapManagerAdapter downAdapter;
private OfflineMapAdapter allSearchAdapter;
private OfflineExpandableListAdapter allCountryAdapter;
private ListOfflineMapItem itemsDown; // 下载或下载中城市
private ListOfflineMapItem itemsAll; // 所有城市,与热门城市及下载管理对象相同
private ListOfflineMapItem itemsProvince;
private ListListOfflineMapItem itemsProvinceCity;
// ----------------------- Constructors ----------------------
// -------- Methods for/from SuperClass/Interfaces -----------
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_offline_map);
// final String packname = this.getPackageName();
// PackageInfo packageInfo;
// try
// {
// packageInfo = this.getPackageManager().getPackageInfo(packname, PackageManager.GET_SIGNATURES);
//
//
// if (code == -00)
// {
// 初始化离线地图管理
mOffline = new MKOfflineMap();
mOffline.init(this);
initViews();
viewpager.setCurrentItem(1);
// }
// }
// catch (NameNotFoundException e)
// {
// e.printStackTrace();
// }
}
private boolean isResumed = false;
@Override
protected void onResume()
{
super.onResume();
if (!isResumed)
{
isResumed = true;
loadData();
}
}
@Override
protected void onDestroy()
{
super.onDestroy();
mOffline.destroy();
}
/**
*
* @author chenshiqiang E-mail:csqwyyx@163.com
* @param type
* 事件类型: MKOfflineMap.TYPE_NEW_OFFLINE, MKOfflineMap.TYPE_DOWNLOAD_UPDATE, MKOfflineMap.TYPE_VER_UPDATE.
* @param state
* 事件状态: 当type为TYPE_NEW_OFFLINE时,表示新安装的离线地图数目. 当type为TYPE_DOWNLOAD_UPDATE时,表示更新的城市ID.
*/
@Override
public void onGetOfflineMapState(int type, int state)
{
switch (type)
{
case MKOfflineMap.TYPE_DOWNLOAD_UPDATE:
MKOLUpdateElement update = mOffline.getUpdateInfo(state);
if (setElement(update, true) != null)
{
if (itemsDown != null itemsDown.size() 1)
{
Collections.sort(itemsDown);
}
refreshDownList();
}
else
{
downAdapter.notifyDataSetChanged();
}
allSearchAdapter.notifyDataSetChanged();
allCountryAdapter.notifyDataSetChanged();
break;
case MKOfflineMap.TYPE_NEW_OFFLINE:
// 有新离线地图安装
Log.d("OfflineDemo", String.format("add offlinemap num:%d", state));
break;
case MKOfflineMap.TYPE_VER_UPDATE:
// 版本更新提示
break;
}
}
/**
* 百度下载状态改变(暂停--》恢复)居然不回调,所以改变状态时自己得增加接口监听状态改变刷新界面
*
* @author chenshiqiang E-mail:csqwyyx@163.com
* @param item
* 有状态改变的item
* @param removed
* item是否被删除
*/
@Override
public void statusChanged(OfflineMapItem item, boolean removed)
{
if (removed)
{
for (int i = itemsDown.size() - 1; i = 0; i--)
{
OfflineMapItem temp = itemsDown.get(i);
if (temp.getCityId() == item.getCityId())
{
itemsDown.remove(i);
}
}
refreshDownList();
}
else
{
loadData();
downAdapter.notifyDataSetChanged();
}
allSearchAdapter.notifyDataSetChanged();
allCountryAdapter.notifyDataSetChanged();
}
// --------------------- Methods public ----------------------
public void toDownloadPage()
{
viewpager.setCurrentItem(0);
}
// --------------------- Methods private ---------------------
private void initViews()
{
// TODO
viewpager = (ViewPager) findViewById(R.id.viewpager);
pagertab = (PagerTabStrip) findViewById(R.id.pagertab);
LayoutInflater inf = LayoutInflater.from(this);
View v1 = inf.inflate(R.layout.view_offline_download, null, false);
svDown = (MySearchView) v1.findViewById(R.id.svDown);
lvDown = (ListView) v1.findViewById(R.id.lvDown);
views.add(v1);
View v2 = inf.inflate(R.layout.view_offline_countrys, null, false);
svAll = (MySearchView) v2.findViewById(R.id.svAll);
lvWholeCountry = (ExpandableListView) v2.findViewById(R.id.lvWholeCountry);
lvSearchResult = (ListView) v2.findViewById(R.id.lvSearchResult);
views.add(v2);
titles.add("下载管理");
titles.add("城市列表");
pagertab.setTabIndicatorColor(0xff00cccc);
pagertab.setDrawFullUnderline(false);
pagertab.setBackgroundColor(0xFF38B0DE);
pagertab.setTextSpacing(50);
viewpager.setOffscreenPageLimit(2);
viewpager.setAdapter(new MyPagerAdapter());
svDown.setSearchListener(new MySearchView.SearchListener()
{
@Override
public void afterTextChanged(Editable text)
{
refreshDownList();
}
@Override
public void search(String text)
{
}
});
svAll.setSearchListener(new MySearchView.SearchListener()
{
@Override
public void afterTextChanged(Editable text)
{
refreshAllSearchList();
}
@Override
public void search(String text)
{
}
});
downAdapter = new OfflineMapManagerAdapter(this, mOffline, this);
lvDown.setAdapter(downAdapter);
allSearchAdapter = new OfflineMapAdapter(this, mOffline, this);
lvSearchResult.setAdapter(allSearchAdapter);
allCountryAdapter = new OfflineExpandableListAdapter(this, mOffline, this);
lvWholeCountry.setAdapter(allCountryAdapter);
lvWholeCountry.setGroupIndicator(null);
}
/**
* 刷新下载列表, 根据搜索关键字及itemsDown 下载管理数量变动时调用
*/
private void refreshDownList()
{
String key = svDown.getInputText();
if (key == null || key.length() 1)
{
downAdapter.setDatas(itemsDown);
}
else
{
ListOfflineMapItem filterList = new ArrayListOfflineMapItem();
if (itemsDown != null !itemsDown.isEmpty())
{
for (OfflineMapItem i : itemsDown)
{
if (i.getCityName().contains(key))
{
filterList.add(i);
}
}
}
downAdapter.setDatas(filterList);
}
}
/**
* 刷新所有城市搜索结果
*/
private void refreshAllSearchList()
{
String key = svAll.getInputText();
if (key == null || key.length() 1)
{
lvSearchResult.setVisibility(View.GONE);
lvWholeCountry.setVisibility(View.VISIBLE);
allSearchAdapter.setDatas(null);
}
else
{
lvSearchResult.setVisibility(View.VISIBLE);
lvWholeCountry.setVisibility(View.GONE);
ListOfflineMapItem filterList = new ArrayListOfflineMapItem();
if (itemsAll != null !itemsAll.isEmpty())
{
for (OfflineMapItem i : itemsAll)
{
if (i.getCityName().contains(key))
{
filterList.add(i);
}
}
}
allSearchAdapter.setDatas(filterList);
}
}
private void loadData()
{
new CsqBackgroundTaskVoid(this)
{
@Override
protected Void onRun()
{
// TODO Auto-generated method stub
// 导入离线地图包
// 将从官网下载的离线包解压,把vmp文件夹拷入SD卡根目录下的BaiduMapSdk文件夹内。
// 把网站上下载的文件解压,将\BaiduMap\vmp\l里面的.dat_svc文件,拷贝到手机BaiduMapSDK/vmp/h目录下
int num = mOffline.importOfflineData();
if (num 0)
{
ToastUtil.showToastInfo(BaiduOfflineMapActivity.this, "成功导入" + num + "个离线包", false);
}
ListMKOLSearchRecord all = null;
try
{
all = mOffline.getOfflineCityList();
}
catch (Exception e)
{
e.printStackTrace();
}
if (all == null || all.isEmpty())
{
ToastUtil.showToastInfo(BaiduOfflineMapActivity.this, "未获取到离线地图城市数据,可能有其他应用正在使用百度离线地图功能!", false);
return null;
}
ListMKOLSearchRecord hotCity = mOffline.getHotCityList();
HashSetInteger hotCityIds = new HashSetInteger();
if (!hotCity.isEmpty())
{
for (MKOLSearchRecord r : hotCity)
{
hotCityIds.add(r.cityID);
}
}
itemsAll = new ArrayListOfflineMapItem();
itemsDown = new ArrayListOfflineMapItem();
itemsProvince = new ArrayListOfflineMapItem();
itemsProvinceCity = new ArrayListListOfflineMapItem();
// cityType 0:全国;1:省份;2:城市,如果是省份,可以通过childCities得到子城市列表
// 全国概略图、直辖市、港澳 子城市列表
ArrayListMKOLSearchRecord childMunicipalities = new ArrayListMKOLSearchRecord();
proHot.cityName = "热门城市";
proHot.childCities = cs;
ListMKOLUpdateElement updates = mOffline.getAllUpdateInfo();
if (updates != null updates.size() 0)
{
}
@Override
protected void onResult(Void result)
{
// TODO Auto-generated method stub
refreshDownList();
refreshAllSearchList();
allCountryAdapter.setDatas(itemsProvince, itemsProvinceCity);
}
}.execute();
}
求一个完整的javaweb项目 读书分享交流网站的源代码,
开源的应该不好找,不过推介一个地方,淘宝小店友鹏软件,java的
当前java web 开发用得一般都是哪些框架
1.S2SH(struts2+spring+hibernate)
基于Struts2+Spring3+Hibernate4开发java Web企业应用开源框架s2jh源码分享
spring+hibernate+struts2开发OA企业办公管理系统源码分享
Struts2+Hibernate3+Spring三大框架技术实现MySQL数据分页
Spring+struts2+hibernate+easyui基础权限管理框架
Spring+Struts2+Hibernate三大框架开发企业人力资源管理系统源代码下载
Spring mvc+struts2+Hibernate整合实例代码(注解详解)
2.S2SM(struts2+spring+mybatis)
Spring+Struts2+mybatis手动配置三大框架整合源代码下载
Struts2+mybatis开发音乐分享系统
3.SSH(spring mvc+spring+hibernate或struts+spring+hibernate)
Spring MVC+Spring+Hibrenarte实现javaweb源码分享网的简单javaweb源码分享网的CRUD项目实例
springMVC注解与hibernate完美结合完成基本javaweb源码分享网的增删改查demo源码下载
springmvc+hibernate+spring+easyui开发bsalse进销存后台管理系统源代码下载
spring 3.0+spring MVC+Hibernate框架搭建教程(附javaweb源码分享网:springMVC文件上传功能)
spring+struts2+Hibernate三大框架开发某制药厂管理系统源代码下载
Spring mvc+struts2+Hibernate整合实例代码(注解详解)
4.SSM(spring mvc+spring+mybatis)
SpringMVC+Mybatis整合实现简单权限控制系统代码
java的代码分享网站有哪些?
1. java2s
这个网站非常好,分成三大类,分别是Example 、Products 、 Articles ,每个大类下又分别设许多小类,还有搜索功能,这样查找起来非常方便。。比如,如果要学习SWT/JFace,只要把Example下的SWT JFace Eclipse 研究一下也就可以了。另外,这个网站还有JavaScript DHTML 、 C# / C Sharp 、 C / ANSI-C 、 SQL / MySQL 等类。总之,非常好。
2. codeZoo
这是O'Reily旗下的,除了Java之外,还有Ruby、Python。
3. Java学习源代码检索系统
难得看见国产的,好歹也要支持一下,分类也算清楚。
4. Koders
是个综合查询的网站,不过它好像是从代码中查找关键词,包含的语言挺多的。
5. Resources for Java server-side developers
确切的说,它是一个资源收集的网站,代码查询并不多。不过它分类相当细,如Articles、Books、Examples、Extensions、Frameworks等类,你可以输入Spring或Hibernate作为关键词搜索一下看看。
-----
java web怎样实现分享到微信
代码很简单,我这里就不多废话了,直接奉上源码:
复制代码 代码如下:
%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%
%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
html
head
base href="%=basePath%"
title喝喝/title
meta http-equiv="pragma" content="no-cache"
meta http-equiv="cache-control" content="no-cache"
meta http-equiv="expires" content="0"
meta http-equiv="keywords" content="keyword1,keyword2,keyword3"
meta http-equiv="description" content="This is my page"
!--
link rel="stylesheet" type="text/css" href="styles.css"
--
script
var imgUrl = '
var lineLink = '
var descContent = "万达狂欢节, 夺宝幸运星大抽奖活动开始啦!";
var shareTitle = '万达狂欢节';
var appid = 'wxc9937e3a66af6dc8';
function shareFriend() {
WeixinJSBridge.invoke('sendAppMessage',{
"appid": appid,
"img_url": imgUrl,
"img_width": "640",
"img_height": "640",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
_report('send_msg', res.err_msg);
})
}
function shareTimeline() {
WeixinJSBridge.invoke('shareTimeline',{
"img_url": imgUrl,
"img_width": "640",
"img_height": "640",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
_report('timeline', res.err_msg);
});
}
function shareWeibo() {
WeixinJSBridge.invoke('shareWeibo',{
"content": descContent,
"url": lineLink,
}, function(res) {
_report('weibo', res.err_msg);
});
}
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function(argv){
shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv){
shareTimeline();
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function(argv){
shareWeibo();
});
}, false);
/script
/head
body
!-- script
var imgUrl = "
var lineLink = "
var descContent = '测试别当真';
var shareTitle = '分享';
var appid = 'wx1259b351c201841d';
function shareFriend() {
WeixinJSBridge.invoke('sendAppMessage',{
"appid": appid,
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
//_report('send_msg', res.err_msg);
});
}
function shareTimeline() {
WeixinJSBridge.invoke('shareTimeline',{
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
//_report('timeline', res.err_msg);
});
}
function shareWeibo() {
WeixinJSBridge.invoke('shareWeibo',{
"content": descContent,
"url": lineLink,
}, function(res) {
//_report('weibo', res.err_msg);
});
}
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function(argv){
shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv){
shareTimeline();
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function(argv){
shareWeibo();
});
}, false);
/script --
h1呵呵呵呵/h1
/body
/html