java购物网站源代码 购物商城java源代码

JAVA 项目购物网站源代码去买这本书《精通Java Web整合开发:JAP+AJAX+Struts+Hibernate》
最后章节就是购物车的数据建模、模块设计、代码分析
源代码都在光盘里
java中如何根据一个网址获得该网页的源代码?package test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class HttpTest {
private String u;
private String encoding;
public static void main(String[] args) throws Exception {
HttpTest client = new HttpTest("", "UTF-8");
client.run();
}
public HttpTest(String u, String encoding) {
this.u = u;
this.encoding = encoding;
}
public void run() throws Exception {
URL url = new URL(u);// 根据链接(字符串格式),生成一个URL对象
HttpURLConnection urlConnection = (HttpURLConnection) url
.openConnection();// 打开URL
BufferedReader reader = new BufferedReader(new InputStreamReader(
urlConnection.getInputStream(), encoding));// 得到输入流 , 即获得了网页的内容
String line; // 读取输入流的数据,并显示
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
}
}
根据具体问题类型 , 进行步骤拆解/原因原理分析/内容拓展等 。
具体步骤如下:/导致这种情况的原因主要是……
求一套完整的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; // 下载或下载中城市

推荐阅读