jsp成品网站源码(下载了一个jsp网站源代码,怎么加载调试都不能运行)

本文目录
- 下载了一个jsp网站源代码,怎么加载调试都不能运行
- 高分求一份jsp 基于mvc设计模式的购物网站的源代码
- 网上下的jsp源码要怎么用
- 下载好的jsp网站源码怎么运行
- jsp中网站的首页源代码
- jsp登陆界面源代码
- 求一个简易JSP网购系统的网站源码
下载了一个jsp网站源代码,怎么加载调试都不能运行
你没下完整啊,NewDao cannot be resolved to a type就是说NewDao这个类没有定义的啊,应该还有个NewDao.java文件,或者是你没有把NewDao所在的包import进来
高分求一份jsp 基于mvc设计模式的购物网站的源代码
煤炭是我国国民经济发展的基础能源,在国家《能源中长期发展规划纲要(2004~2020 年)》中已经确定,中国将“ 坚持以煤炭为主体、电力为中心、油气和新能源全面发展的能源战略”。我国是世界上最大的煤炭生产国和消费国,也是世界上少数几个以煤为主要能源的国家之一,在我国的能源生产和消费结构中,煤炭一直占主导地位,煤炭产量占全国一次能源生产总量的75%左右。煤炭可以作为燃料,但是同时又是重要的工业原料,从煤中可以提取几百种产品,造福人类, 由此可见, 煤炭在国民生产中占据十分重要的位置。显然,煤炭工业是我国的基础产业,其健康、稳定、持续地发展是关系到国家能源安全的重大问题。然而随着煤炭开采深度的加大,地质条件的复杂,与之伴随的矿井次生动力灾害正在加剧。为了高产高
网上下的jsp源码要怎么用
需要部署到服务器中
找到菜单 window → Show View → Servers,打开Servers视图标签,部署的Tomcat 服务
在这个服务上右击,选择“Add Deployment”
在新打开的对话框中,有一个Project项,选择要部署的项目
点击“Finish”完成部署
这样项目就部署到Tomcat里面去了
下载好的jsp网站源码怎么运行
jsp的运行需要有容器支持。同时看这个项目是否需要某些资源文件,类似数据库连接等。
如果是则需要配置才可以正常运行,如果不是则可以直接拷贝connect-web文件夹到tomcat的webapps目录下,启动tomcat,控制台没有异常就算部署成功了。同时要想正确访问该应用,查看web.xml中配置的访问首页,否则会因找不到页面报404错误。
jsp中网站的首页源代码
这是最简单的一个例子,数据库要你自己建,用的是ACCESS
《%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%》
《html》
《head》
《metancon=DriverManager.getConnection("jdbc:odbc:jspdata");//建立数据库链接,jspdata为ODBC数据源名称
//建立Statement对象
Statementstmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSetrs=stmt.executeQuery("select*fromlyb");//建立ResultSet(结果集)对象,并执行SQL语句
%》
《/p》
《palign="center"》NUMB1数据表中记录如下《/p》
《tablewidth="640"border="1"align="center"bordercolor="7188e0"》
《trbgcolor="d1d1ff"》
《thwidth="49"》编号《/th》
《thwidth="90"》姓名《/th》
《thwidth="126"》E-mail《/th》
《thwidth="221"》网站《/th》
《thwidth="80"》QQ《/th》
《/tr》
《%
while(rs.next())
{
%》
《trbgcolor="f8f8f8"》
《th》《%=rs.getString(1)%》《/th》
《th》《%=rs.getString(2)%》《/th》
《th》《%=rs.getString(3)%》《/th》
《thbgcolor="f6f6f8"》《%=rs.getString(4)%》《/th》
《th》《%=rs.getString(5)%》《/th》
《/tr》
《%
}
rs.close();
stmt.close();
con.close();
%》
《/table》
《palign="center"》《br》
如果您能看到表格中的数据,说明连接数据库成功!《/p》
《/body》
《/html》
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:\Users\win8\workspace\Login\image\9dcbdc339e72a5663b5c289fb5573c13_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》
求一个简易JSP网购系统的网站源码
我有一个。连数据库都没有用,直接在页面传递价格等信息。但jsp的技术都使用了,很适合学习的,我就用这个学习,而且还自己添加了很多功能。要的话给我留言。希望可以交流一下。
程序已经发送,注意查收。zhuiwen1987@126.com

本文相关文章:
html css网页源码(网页的源代码是叫css吗还是什么)
2026年5月10日 07:16
html个人简介网页代码(求一个简单的个人网页HTML源代码)
2026年5月9日 07:21
个人图片展示网站源码(想做一个动态展示图片相册的效果,已经下载了很多swf格式的文件,不知道怎么添加源代码在网页中进行展示)
2026年5月4日 09:49
更多文章:
优秀网视频剪辑(可以接单的视频剪辑软件有哪些免费学视频剪辑的软件推荐)
2026年5月3日 17:26
英语 建设 建立 建设同义词的辨析build construct found establis?建立英语怎么说
2026年5月9日 04:20
谷歌seo和新站如何快速排名:谷歌seo和新站如何快速提升排名
2026年6月22日 05:30




















