• Jsp 简单复习-不要太在意细节


    1, http://localhost:8080/MyWebApp/HelloWorld.jsp
    
    3, http://localhost:8080/MyWebApp/AccessCounts.jsp   最佳实践 : 尽量不要在Servlet中,设计成员变量
    4, http://localhost:8080/MyWebApp/BGColor.jsp?bgColor=red  知识点4 : request.getParameter("bgColor");
    		String bgColor = request.getParameter("bgColor");
    		boolean hasExplicitColor;
    		if (bgColor != null) {
    		  hasExplicitColor = true;
    		} else {
    		  hasExplicitColor = false;
    		  bgColor = "WHITE";
    		}
    		%>
    		<BODY BGCOLOR="<%= bgColor %>">
    5, <% %> 之中的,运行在服务器端,其他html语句运行在客户端     知识点5 : 注释语句
    6, http://localhost:8080/MyWebApp/TestDirective.jsp   知识点6 : 编译指令
        <%@page import="java.util.*" session="false"%>
    	<%@page contentType="text/html;charset=gb2312"%>
    	<%= new Date() %>
    	<%
    		out.println("ÄãºÃ!");
    	%>
    	Jsp 编译指令
         (Directive-page)
    7, http://localhost:8080/MyWebApp/TestErr.jsp   知识点7 : 错误转到
    	    <%@page errorPage="ErrPage.jsp"%>
    		<%
    		String s="123Plus";
    		int i=Integer.parseInt(s);
    		out.println("s=" + s + "  i=" + i);
    		%>
       http://localhost:8080/MyWebApp/ErrPage.jsp
            <%-- ********* ErrPage.jsp ********** --%>
    		<%@ page contentType="text/html;charset=gb2312" %>
    		<%@ page isErrorPage="true" %>
    		<HTML>
    		<BODY TEXT="red">
    
    		ŽíÎóÐÅÏ¢£º<%= exception.getMessage() %>
    		</BODY>
    		</HTML>
    8, http://localhost:8080/MyWebApp/TestBar.jsp   知识点8 : 静态包含
            <%@page contentType="text/html;charset=gb2312"%>
    		<HTML> <!-- *************** TestBar.jsp ***************** -->
    		<HEAD>
    		<TITLE>TestBar.jsp</TITLE>
    		</HEAD>
    		<BODY>
    		<TABLE WIDTH="100%">
    		<TR><TD><%@ include file="TitleBar.jsp" %></TD></TR>
    		<TR><TD><% out.println("<P>ÕâÊÇÓû§ÏÔÊŸÇø</P>"); %></TD></TR>
    	http://localhost:8080/MyWebApp/TitleBar.jsp
    		<%@page contentType="text/html;charset=gb2312"%>
    		<TABLE> <!-- ********** TitleBar.jsp ************** -->
    		<TR>
    		<TD>
    		</TD>
    		<TD>
    		<% out.println("Hi: " + request.getParameter("user"));%>
    		<%=new java.util.Date()%>
    		</TD>
    		</TR>
    		</TABLE>
    9, http://localhost:8080/MyWebApp/include/include.jsp  知识点9 : 动态包含  (不常用)
       http://localhost:8080/MyWebApp/include/date.jsp
    10, http://localhost:8080/MyWebApp/forward/test.jsp    知识点10 : 转向
        http://localhost:8080/MyWebApp/forward/forward.jsp
        http://localhost:8080/MyWebApp/forward/forward1.jsp
        JSP-编程 04 转向 jsp:forward 与 sendRedirect
        http://blog.csdn.net/robbyo/article/details/17758109
       
    
    
    
    


  • 相关阅读:
    ejbca 无其他数据库支持情况下的安装
    VC巨资注入开源软件产业 商业模式仍需摸索
    EJBCA 3.0 开源CA系统软件初探
    ejbca安装指南
    Navicat for ORACLE 导出数据
    cannot create oci environment/Navicat for oracle
    EL表达式 (详解)
    10个步骤让你成为高效的Web开发者
    jquery.validationEngine+ajax验证
    让您的 web 应用程序飞起来
  • 原文地址:https://www.cnblogs.com/robbychan/p/3786526.html
Copyright © 2020-2023  润新知