【c 写到指定文件源码】【斗牛源码完整】【表单源码cms】web项目jsp源码_jsp项目源代码

时间:2024-11-26 12:49:25 编辑:淮南源码 来源:快手接单版源码

1.网页源代码的项p项基本结构是什么
2.求jsp登录源码 急急急急急急急急急急急

web项目jsp源码_jsp项目源代码

网页源代码的基本结构是什么

       如图:

       1.无论是动态还是静态页面都是以“<html>”开始,然后在网页最后以“</html>”结尾。目j目源

       2.<head>”页头

       其在<head></head>中的源码内容是在浏览器中内容无法显示的,这里是代码c 写到指定文件源码给服务器、浏览器、项p项链接外部JS、目j目源斗牛源码完整a链接CSS样式等区域,源码而里面“<title></title>”中放置的代码是网页标题。

       3.“<meta name="keywords" content="关键字" /> <meta name="description" content="本页描述或关键字描述" /> ”

       这两个标签里的项p项内容是给搜索引擎看的说明本页关键字及本张网页的主要内容等SEO可以用到。

       4."<body></body> "

       也就是目j目源常说的body区 ,这里放置的源码内容就可以通过浏览器呈现给用户,其内容可以是代码table表格布局格式内容,也可以DIV布局的项p项表单源码cms内容,也可以直接是目j目源文字。这里也是源码最主要区域,网页的电瓶网站源码内容呈现区。

       5.最后是以"</html> "结尾,也就是网页闭合。

       以上是qq领取源码一个完整的最简单的html语言基本结构,通过以上可以再增加更多的样式和内容充实网页。

扩展资料:

       标签详解:

       1.<!doctype>:是声明用哪个 HTML 版本进行编写的指令。并不是 HTML 标签。<!doctype html>:html5网页声明,表示网页采用html5。

       2.<meta>:提供有关页面的元信息(针对搜索引擎和更新频度的描述和关键词等),写在<head>标签内。

       a)<meta charset="UTF-8">:设置页面的编码格式UTF-8;

       b)<meta name="Generator" content="EditPlus">:说明生成工具为EditPlus;

       c)<meta name="Author" content="">:告诉搜索引擎站点制作的作者;

       d)<meta name="Keywords" content="">:告诉搜索引擎网站的关键字;

       e)<meta name="Description" content="">:告诉搜索引擎网站的内容;

       

参考资料:

html代码-百度百科

求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>