JSP 04课 (1)

2021-03-31 07:26

阅读:603

YPE HTML>

标签:pre   rpo   com   his   tle   sep   sheet   path   form   

技术图片

技术图片

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

用户名:

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

密码:

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

"submit" name="LOGIN" value="登录" >
"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!

"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);
  }
   %>
  

 

JSP 04课 (1)

标签:pre   rpo   com   his   tle   sep   sheet   path   form   

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


评论


亲,登录后才可以留言!