JSP 04课 (2)

2021-03-31 07:27

阅读:674

YPE HTML>

标签:contex   java   serve   uname   art   coding   password   desc   imp   

技术图片技术图片

"java" import="java.util.*" pageEncoding="utf-8"%>

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

span>"-//W3C//DTD HTML 4.01 Transitional//EN">base href="">
    
    My JSP <span>‘</span><span>login.jsp</span><span>‘</span> starting page"pragma" content="no-cache">
    "cache-control" content="no-cache">
    "expires" content="0">    
    "keywords" content="keyword1,keyword2,keyword3">
    "description" content="This is my page">
    

  
  
  
    
"doLogin.jsp" method="post">
"center" style="background: url(images/Snap1.jpg);background-repeat:no-repeat;background-position-x:50%;height:500px">
"margin-left:250px;margin-top:130px">

用户名:

"text" name="uname" style="width:150px;height:30">

密码:

"password" name="upwd" style="width:150px;height:30">

"submit" name="LOGIN" value=" " style="background: url(images/login.gif);background-repeat:no-repeat;heigth:20px;width:110px" >
"java" import="java.util.*" pageEncoding="utf-8"%>

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

span>"-//W3C//DTD HTML 4.01 Transitional//EN">

  base href="">
    
    My JSP <span>‘</span><span>doLogin.jsp</span><span>‘</span> starting page"pragma" content="no-cache">
    "cache-control" content="no-cache">
    "expires" content="0">    
    "keywords" content="keyword1,keyword2,keyword3">
    "description" content="This is my page">
    

  
  
  
  
  request.setCharacterEncoding("utf-8");
  String name=request.getParameter("uname");
  String pwd=request.getParameter("upwd");
  if(name.equals("lucky")&&pwd.equals("123456")){
  request.getRequestDispatcher("welcome.jsp").forward(request,response);
  }else{
  request.getRequestDispatcher("login.jsp").forward(request,response);
  }
   %>
  
"java" import="java.util.*" pageEncoding="utf-8"%>

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

span>"-//W3C//DTD HTML 4.01 Transitional//EN">

  base href="">
    
    My JSP <span>‘</span><span>welcome.jsp</span><span>‘</span> starting page"pragma" content="no-cache">
    "cache-control" content="no-cache">
    "expires" content="0">    
    "keywords" content="keyword1,keyword2,keyword3">
    "description" content="This is my page">
    

  
  
  
    
"center">

你好!Lucky!

 

JSP 04课 (2)

标签:contex   java   serve   uname   art   coding   password   desc   imp   

原文地址:https://www.cnblogs.com/naoguakerteng/p/12588223.html


评论


亲,登录后才可以留言!