//三个地方, 不过最后那个函数递归的时候最好先关闭文件。 #include "stdio.h" #include "stdlib.h" void fcxxwh(void); void fcxxcx(void); void dc(void); void zz(void); void sr(void); void main() { int a; printf("\t饭店信息维护系统\n...3793
㈡ 在哪里能下载到javaweb项目的源代码
非常多啊, 你说的虚拟社区本质上就是bbs的那些源码
直接springboot写或者springmvc+mybatis写也行
㈢ 求一套完整的JAVA WEB项目的网络购物网站源代码
/**
*@description:
*@authorchenshiqiangE-mail:[email protected]
*@date2014年9月7日下午2:51:50
*@version1.0
*/
packagecom.example.map;
importjava.util.ArrayList;
importjava.util.Collections;
importjava.util.HashSet;
importjava.util.List;
importandroid.app.Activity;
importandroid.os.Bundle;
importandroid.support.v4.view.PagerAdapter;
importandroid.support.v4.view.PagerTabStrip;
importandroid.support.v4.view.ViewPager;
importandroid.text.Editable;
importandroid.util.Log;
importandroid.view.LayoutInflater;
importandroid.view.View;
importandroid.view.ViewGroup;
importandroid.widget.ExpandableListView;
importandroid.widget.ListView;
importcom..mapapi.map.offline.MKOLSearchRecord;
importcom..mapapi.map.offline.MKOLUpdateElement;
importcom..mapapi.map.offline.MKOfflineMap;
importcom..mapapi.map.offline.MKOfflineMapListener;
importcom.example.map.adapters.OfflineExpandableListAdapter;
importcom.example.map.adapters.OfflineMapAdapter;
importcom.example.map.adapters.OfflineMapManagerAdapter;
importcom.example.map.interfaces.;
importcom.example.map.models.OfflineMapItem;
importcom.example.map.utils.CsqBackgroundTask;
importcom.example.map.utils.ToastUtil;
importcom.example.system.R;
istener,
{
//------------------------Constants------------------------
//-------------------------Fields--------------------------
privateViewPagerviewpager;
privatePagerTabStrippagertab;
privateMySearchViewsvDown;
privateListViewlvDown;
privateMySearchViewsvAll;
;
privateListViewlvSearchResult;
privateList<View>views=newArrayList<View>(2);
privateList<String>titles=newArrayList<String>(2);
privateMKOfflineMapmOffline=null;
;
;
;
privateList<OfflineMapItem>itemsDown;//下载或下载中城市
privateList<OfflineMapItem>itemsAll;//所有城市,与热门城市及下载管理对象相同
privateList<OfflineMapItem>itemsProvince;
privateList<List<OfflineMapItem>>itemsProvinceCity;
//-----------------------Constructors----------------------
//--------Methodsfor/fromSuperClass/Interfaces-----------
@Override
protectedvoidonCreate(BundlesavedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_offline_map);
// finalStringpackname=this.getPackageName();
// PackageInfopackageInfo;
// try
// {
// packageInfo=this.getPackageManager().getPackageInfo(packname,PackageManager.GET_SIGNATURES);
//
//
// if(code==-00)
// {
//初始化离线地图管理
mOffline=newMKOfflineMap();
mOffline.init(this);
initViews();
viewpager.setCurrentItem(1);
// }
// }
// catch(NameNotFoundExceptione)
// {
// e.printStackTrace();
// }
}
privatebooleanisResumed=false;
@Override
protectedvoidonResume()
{
super.onResume();
if(!isResumed)
{
isResumed=true;
loadData();
}
}
@Override
protectedvoidonDestroy()
{
super.onDestroy();
mOffline.destroy();
}
/**
*
*@authorchenshiqiangE-mail:[email protected]
*@paramtype
*事件类型:MKOfflineMap.TYPE_NEW_OFFLINE,MKOfflineMap.TYPE_DOWNLOAD_UPDATE,MKOfflineMap.TYPE_VER_UPDATE.
*@paramstate
*事件状态:当type为TYPE_NEW_OFFLINE时,表示新安装的离线地图数目.当type为TYPE_DOWNLOAD_UPDATE时,表示更新的城市ID.
*/
@Override
(inttype,intstate)
{
switch(type)
{
caseMKOfflineMap.TYPE_DOWNLOAD_UPDATE:
MKOLUpdateElementupdate=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;
caseMKOfflineMap.TYPE_NEW_OFFLINE:
//有新离线地图安装
Log.d("OfflineDemo",String.format("addofflinemapnum:%d",state));
break;
caseMKOfflineMap.TYPE_VER_UPDATE:
//版本更新提示
break;
}
}
/**
*网络下载状态改变(暂停--》恢复)居然不回调,所以改变状态时自己得增加接口监听状态改变刷新界面
*
*@authorchenshiqiangE-mail:[email protected]
*@paramitem
*有状态改变的item
*@paramremoved
*item是否被删除
*/
@Override
publicvoidstatusChanged(OfflineMapItemitem,booleanremoved)
{
if(removed)
{
for(inti=itemsDown.size()-1;i>=0;i--)
{
OfflineMapItemtemp=itemsDown.get(i);
if(temp.getCityId()==item.getCityId())
{
itemsDown.remove(i);
}
}
refreshDownList();
}
else
{
loadData();
downAdapter.notifyDataSetChanged();
}
allSearchAdapter.notifyDataSetChanged();
allCountryAdapter.notifyDataSetChanged();
}
//---------------------Methodspublic----------------------
publicvoidtoDownloadPage()
{
viewpager.setCurrentItem(0);
}
//---------------------Methodsprivate---------------------
privatevoidinitViews()
{
//TODO
viewpager=(ViewPager)findViewById(R.id.viewpager);
pagertab=(PagerTabStrip)findViewById(R.id.pagertab);
LayoutInflaterinf=LayoutInflater.from(this);
Viewv1=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);
Viewv2=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(newMyPagerAdapter());
svDown.setSearchListener(newMySearchView.SearchListener()
{
@Override
publicvoidafterTextChanged(Editabletext)
{
refreshDownList();
}
@Override
publicvoidsearch(Stringtext)
{
}
});
svAll.setSearchListener(newMySearchView.SearchListener()
{
@Override
publicvoidafterTextChanged(Editabletext)
{
refreshAllSearchList();
}
@Override
publicvoidsearch(Stringtext)
{
}
});
downAdapter=newOfflineMapManagerAdapter(this,mOffline,this);
lvDown.setAdapter(downAdapter);
allSearchAdapter=newOfflineMapAdapter(this,mOffline,this);
lvSearchResult.setAdapter(allSearchAdapter);
allCountryAdapter=(this,mOffline,this);
lvWholeCountry.setAdapter(allCountryAdapter);
lvWholeCountry.setGroupIndicator(null);
}
/**
*刷新下载列表,根据搜索关键字及itemsDown下载管理数量变动时调用
*/
privatevoidrefreshDownList()
{
Stringkey=svDown.getInputText();
if(key==null||key.length()<1)
{
downAdapter.setDatas(itemsDown);
}
else
{
List<OfflineMapItem>filterList=newArrayList<OfflineMapItem>();
if(itemsDown!=null&&!itemsDown.isEmpty())
{
for(OfflineMapItemi:itemsDown)
{
if(i.getCityName().contains(key))
{
filterList.add(i);
}
}
}
downAdapter.setDatas(filterList);
}
}
/**
*刷新所有城市搜索结果
*/
()
{
Stringkey=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);
List<OfflineMapItem>filterList=newArrayList<OfflineMapItem>();
if(itemsAll!=null&&!itemsAll.isEmpty())
{
for(OfflineMapItemi:itemsAll)
{
if(i.getCityName().contains(key))
{
filterList.add(i);
}
}
}
allSearchAdapter.setDatas(filterList);
}
}
privatevoidloadData()
{
newCsqBackgroundTask<Void>(this)
{
@Override
protectedVoidonRun()
{
//TODOAuto-generatedmethodstub
//导入离线地图包
//将从官网下载的离线包解压,把vmp文件夹拷入SD卡根目录下的BaiMapSdk文件夹内。
//把网站上下载的文件解压,将BaiMapvmpl里面的.dat_svc文件,拷贝到手机BaiMapSDK/vmp/h目录下
intnum=mOffline.importOfflineData();
if(num>0)
{
ToastUtil.showToastInfo(BaiOfflineMapActivity.this,"成功导入"+num+"个离线包",false);
}
List<MKOLSearchRecord>all=null;
try
{
all=mOffline.getOfflineCityList();
}
catch(Exceptione)
{
e.printStackTrace();
}
if(all==null||all.isEmpty())
{
ToastUtil.showToastInfo(BaiOfflineMapActivity.this,"未获取到离线地图城市数据,可能有其他应用正在使用网络离线地图功能!",false);
returnnull;
}
List<MKOLSearchRecord>hotCity=mOffline.getHotCityList();
HashSet<Integer>hotCityIds=newHashSet<Integer>();
if(!hotCity.isEmpty())
{
for(MKOLSearchRecordr:hotCity)
{
hotCityIds.add(r.cityID);
}
}
itemsAll=newArrayList<OfflineMapItem>();
itemsDown=newArrayList<OfflineMapItem>();
itemsProvince=newArrayList<OfflineMapItem>();
itemsProvinceCity=newArrayList<List<OfflineMapItem>>();
//cityType0:全国;1:省份;2:城市,如果是省份,可以通过childCities得到子城市列表
//全国概略图、直辖市、港澳子城市列表
ArrayList<MKOLSearchRecord>childMunicipalities=newArrayList<MKOLSearchRecord>();
proHot.cityName="热门城市";
proHot.childCities=cs;
List<MKOLUpdateElement>updates=mOffline.getAllUpdateInfo();
if(updates!=null&&updates.size()>0)
{
}
@Override
protectedvoidonResult(Voidresult)
{
//TODOAuto-generatedmethodstub
refreshDownList();
refreshAllSearchList();
allCountryAdapter.setDatas(itemsProvince,itemsProvinceCity);
}
}.execute();
}
㈣ javaweb的BBS项目怎么创建楼中楼
我觉得可以这样设计结构,每个楼的div的id做区别(不能用楼数,还要有逻辑意义)用于jquery注入代码,每层楼里有一个div专门用来显示楼中楼,用jquery往里注入,这样楼中楼的里边还可以再插入其他的楼中楼
㈤ jsp登陆界面源代码
1、login.jsp文件
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录页面</title>
</head>
<body>
<form name="loginForm" method="post" action="judgeUser.jsp">
<table>
<tr>
<td>用户名:<input type="text" name="userName" id="userName"></td>
</tr>
<tr>
<td>密码:<input type="password" name="password" id="password"></td>
</tr>
<tr>
<td><input type="submit" value="登录" style="background-color:pink"> <input
type="reset" value="重置" style="background-color:red"></td>
</tr>
</table>
</form>
</body>
</html>
2、judge.jsp文件
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>身份验证</title>
</head>
<body>
<%
request.setCharacterEncoding("GB18030");
String name = request.getParameter("userName");
String password = request.getParameter("password");
if(name.equals("abc")&& password.equals("123")) {
3、afterLogin.jsp文件
%>
<jsp:forward page="afterLogin.jsp">
<jsp:param name="userName" value="<%=name%>"/>
</jsp:forward>
<%
}
else {
%>
<jsp:forward page="login.jsp"/>
<%
}
%>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录成功</title>
</head>
<body>
<%
request.setCharacterEncoding("GB18030");
String name = request.getParameter("userName");
out.println("欢迎你:" + name);
%>
</body>
</html>
java web登录界面源代码:
1、Data_uil.java文件
import java.sql.*;
public class Data_uil
{
public Connection getConnection()
{
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}catch(ClassNotFoundException e)
{
e.printStackTrace();
}
String user="***";
String password="***";
String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=***";
Connection con=null;
try{
con=DriverManager.getConnection(url,user,password);
}catch(SQLException e)
{
e.printStackTrace();
}
return con;
}
public String selectPassword(String username)
{
Connection connection=getConnection();
String sql="select *from login where username=?";
PreparedStatement preparedStatement=null;
ResultSet result=null;
String password=null;
try{
preparedStatement=connection.prepareStatement(sql);
preparedStatement.setString(1,username);
result=preparedStatement.executeQuery();//可执行的 查询
if(result.next())
password=result.getString("password");
}catch(SQLException e){
e.printStackTrace();
}finally
{
close(preparedStatement);
close(result);
close(connection);
}
System.out.println("找到的数据库密码为:"+password);
return password;
}
public void close (Connection con)
{
try{
if(con!=null)
{
con.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
public void close (PreparedStatement preparedStatement)
{
try{
if(preparedStatement!=null)
{
preparedStatement.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
public void close(ResultSet resultSet)
{
try{
if(resultSet!=null)
{
resultSet.close();
}
}catch(SQLException e)
{
e.printStackTrace();
}
}
}
2、login_check.jsp:文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>验证用户密码</title>
</head>
<body>
<jsp:useBean id="util" class="util.Data_uil" scope="page" />
<%
String username=(String)request.getParameter("username");
String password=(String)request.getParameter("password");
if(username==null||"".equals(username))
{
out.print("<script language='javaScript'> alert('用户名不能为空');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
else
{
System.out.println("输入的用户名:"+username);
String passwordInDataBase=util.selectPassword(username);
System.out.println("密码:"+passwordInDataBase);
if(passwordInDataBase==null||"".equals(passwordInDataBase))
{
out.print("<script language='javaScript'> alert('用户名不存在');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
else if(passwordInDataBase.equals(password))
{
out.print("<script language='javaScript'> alert('登录成功');</script>");
response.setHeader("refresh", "0;url=loginSucces.jsp");
}
else
{
out.print("<script language='javaScript'> alert('密码错误');</script>");
response.setHeader("refresh", "0;url=user_login.jsp");
}
}
%>
</body>
</html>
3、loginSucces.jsp文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<hr size="10" width="26%" align="left" color="green">
<font size="6" color="red" >登录成功 </font>
<hr size="10" width="26%" align="left" color="green">
</body>
</html>
4、user_login.jsp文件
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>登录界面</title>
</head>
<body background="C:Userswin8workspaceLoginimage\_10.jpg" >
<center>
<br><br><br><br><br><br>
<h1 style="color:yellow">Login</h1>
<br>
<form name="loginForm" action="login_check.jsp" method="post">
<table Border="0" >
<tr >
<td>账号</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="password">
</td>
</tr>
</table>
<br>
<input type="submit" value="登录" style="color:#BC8F8F">
</form>
</center>
</body>
</html>
㈥ 如何用Java制作bbs急~~
1.建立好数据库
2.在MyEclipse中,建立web项目,把项目部署在服务器(Tomcat)上,把数据库连到项目中
3.在网上下载一个bbs的静态页面, 把它粘贴到web项目中,修改其属性,使其变为jsp文件
4.在web项目中,封装一个连接数据库的类
5.在修改好的jsp文件中,通过递归方法,容器,等把帖子放入容器中,在相关代码处(就是展现帖子的html),通过Iterator再把相关主题贴,回复帖子的主题拿出来,通过参数传递id,超级连接的方式,回复帖子的主题连接到回复帖子的详细内容
只能大致说这么多了,你 可以到网上搜源代码
㈦ java web 写服务器代码后用浏览器打开html出现的是html的源代码
...当然是这个
你想是什么?给你转换成页面吗?转成页面是需要引擎支持的...
㈧ 求Java的在线学习系统源代码
Java 程序员必须收藏的资源大全
古董级工具
这些工具伴随着Java一起出现,在各自辉煌之后还在一直使用。
Apache Ant:基于XML的构建管理工具。
cglib:字节码生成库。
GlassFish:应用服务器,由Oracle赞助支持的Java EE参考实现。
Hudson:持续集成服务器,目前仍在活跃开发。
JavaServer Faces:Mojarra是JSF标准的一个开源实现,由Oracle开发。
JavaServer Pages:支持自定义标签库的网站通用模板库。
Liquibase:与具体数据库独立的追踪、管理和应用数据库Scheme变化的工具。
㈨ 如何快速读懂项目源码javaWeb
一:学会如何读一个JavaWeb项目源代码 步骤:表结构->web.xml->mvc->db->spring
ioc->log-> 代码
1、先了解项目数据库的表结构,这个方面是最容易忘记 的,有时候我们只顾着看每一个方法是怎么进行的,却没
有去了解数据库之间的主外键关联。其实如果先了解数据 库表结构,再去看一个方法的实现会更加容易。
2、然后需要过一遍web.xml,知道项目中用到了什么拦
截器,监听器,过滤器,拥有哪些配置文件。如果是拦截 器,一般负责过滤请求,进行AOP 等;如果是监 可能是定时任务,初始化任务;配置文件有如使用了 spring
后的读取mvc 相关,db 相关,service 相关,aop 相关的文件。
3、查看拦截器,监听器代码,知道拦截了什么请求,这
个类完成了怎样的工作。有的人就是因为缺少了这一步, 自己写了一个action,配置文件也没有写错,但是却怎么
调试也无法进入这个action,直到别人告诉他,请求被拦
4、接下来,看配置文件,首先一定是mvc相关的,如 springmvc
中,要请求哪些请求是静态资源,使用了哪些 view 策略,controller 注解放在哪个包下等。 然后是db 相关配置文件,看使用了什么数据库,使用了
什么orm框架,是否开启了二级缓存,使用哪种产品作 为二级缓存,事务管理的处理,需要扫描的实体类放在什 么位置。最后是spring 核心的ioc
功能相关的配置文件, 知道接口与具体类的注入大致是怎样的。当然还有一些如 apectj 置文件,也是在这个步骤中完成
5、log
相关文件,日志的各个级别是如何处理的,在哪些 地方使用了log 记录日志
6、从上面几点后知道了整个开源项目的整体框架,阅读 每个方法就不再那么难了。
7、当然如果有项目配套的开发文档也是要阅读的。
㈩ 求Java语言编写的bbs论坛设计的源代码
我这有 以前的毕业设计