1.quot网站源码是网站什么意思
2.求jsp登录源码 急急急急急急急急急急急
quot网站源码是什么意思
网站源码,我们可以把它理成源文代码,源码就拿我们当前看到的网站这个网页来说吧,其实它是源码试玩返利平台源码由一大堆的源代码组成,通过我们的网站IE(Microsoft Internet Explorer)浏览器(或服务器)翻译成现在我们所看到的这个样子。网站源码也分为两种,源码一种是网站动态源码如:ASP,PHP,源码JSP,网站.NET,源码CGI等,网站剑侠2新传 源码一种是源码静态源码如:HTML等。什么是网站动态源码呢?最大的特点就是能够和用户之间互动。比如说网易的源码信箱,张三登陆的网站时候,会看到欢迎光临张三,影视免采集源码李四又登陆了,李四又看到欢迎光临李四,其实他们两个人登陆的是一个页面,这个就是动态源码的好处,如果要是facebook专页源码用静态源码,好么网易有几百万的邮箱用户,每个人做一个页面那要多少页啊?动态源码不单单只有这么一点用处,比如说我们常见的一些论坛、留言本、计数器、vg读取mif源码聊天室等,都是由动态源码开发的。什么是静态源码呢,比如说我们当前看到的这个网页他就是静态的源码,静态源码无法实现以上的那些功能。现在有不少源码下载站,提供别人开发好的源码让我们下载。他们开发的都不错,美工也相当不错,基本上下载下来,只要稍加改动就可以使用了,更方便了我们建站,您可以跟据自己所需去下载,更重要的是,要先看看您自己使用的网站空间,是那一种的,比如说您使用的是ASP空间,那么您一定要下载ASP源码,不然下载别的是不能运行的。。
求jsp登录源码 急急急急急急急急急急急
登陆页面 index.jsp源码:
<%@ 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. Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>login</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">
-->
</head>
<body>
<form action="LoginServlet" method="post">
用户名:<input type="text" name="username" ><br>
密码:<input type="password" name="userpass"><br>
<input type="submit" value="登陆"> <input type="reset" value="取消">
</form>
</body>
</html>
-------------
LoginServlet.java 源码:
package servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LoginServlet extends HttpServlet {
/
*** Constructor of the object.
*/
public LoginServlet() {
super();
}
/
*** Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/
*** The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//获得jsp页面传输的参数
String username=request.getParameter("username");
String userpass=request.getParameter("userpass");
//判断
if(username.equals("user")&&userpass.equals("")){
response.sendRedirect("1.jsp");
}else if(username.equals("admin")&&userpass.equals("")){
response.sendRedirect("2.jsp");
}else{
response.sendRedirect("index.jsp");
}
}
/
*** The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
}
/
*** Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
-------------
1.jsp:
<%@ 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. Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP '1.jsp' starting page</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">
-->
</head>
<body>
This is 1.jsp <br>
</body>
</html>
-------------
2.jsp
<%@ 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. Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP '1.jsp' starting page</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">
-->
</head>
<body>
This is 2.jsp <br>
</body>
</html>