- 浏览: 62931 次
- 性别:
- 来自: 广州
-
最新评论
文章列表
<html>
<body bgcolor="green">
<!-- Forward to a servlet,这个servlet存放在web-inf的servlet目录下 -->
<jsp:forward page="/servlet/ServletToJSP" />
</html>
<%@ page contentType="text/html;charset=gb2312"%>
<html>
<meta context="text/html;charset=gb2312" >
<head>
<title>Servlet使用JSP</title>
</head>
<body bgcolor="gray">
<h2>Servlet使用JSP的例子:</h2>
<h2>
...
<form action=b.jsp method=get >
<input name=user value=我们>
<input type=submit value=get>
</form>
<form action=b.jsp method=post >
<input name=user value=他们>
<input type=submit value=post>
</form>
<a href="http://127.0.0.1/my/b. ...
<html>
<head>
<title>数据输入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p>请输入数据</p>
<form method=&qu ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
Example of using jsp:setProperty and an explicity association
with an input parameter. See SaleEntry1.jsp
and SaleEntry3.jsp for alternatives.
-->
<HTML>
<HEAD>
<TITLE>Using jsp: ...
<%-- *********** ApplicationBean.jsp ************ --%>
<%--
<jsp:useBean id="counterBean"
scope="application"
class="bean.CounterBean" />
--%>
<%
bean.CounterBean counterBean = (bean.CounterBean)a ...
<%-- *************** SessionBean.jsp **************** --%>
<jsp:useBean id="counterBean"
scope="session"
class="bean.CounterBean" />
<%--
<%
bean.CounterBean counterBean = (bean.CounterBean)session.ge ...
[code="java]<%-- ************* RequestBean.jsp ************** --%>
<jsp:useBean id="counterBean"
scope="request"
class="bean.CounterBean" />
<%--
<%
bean.CounterBean counterBean = (bean.CounterBean)request.getAttribute ...
<%-- *************** PageBean.jsp **************** --%>
<jsp:useBean id="counterBean"
scope="page"
class="bean.CounterBean" />
<HTML>
<BODY>
<H3>CounterBean scope="page" Example</H3>
<B> ...
引用//=================== CounterBean.java =================
package bean;
import java.io.Serializable;
@SuppressWarnings("serial")
public class CounterBean implements Serializable {
private int count = 0;
public CounterBean() {
}
public int getCount() {
count ++;
return count;
} ...
引用<html>
<head>
<title>forward example</title>
<body bgcolor=red>
welcome to here!
<jsp:forward page="forforward1.jsp">
<jsp:param name="name" value="m" />
<jsp:param name="oldName" value='<%=request.getParamete ...
引用<html>
<head>
<title>Compute</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<form method="post" action="Co ...
引用<%@page contentType="text/html;charset=gb2312"%>
<HTML> <!-- *************** TestBar.jsp ***************** -->
<HEAD>
<TITLE>TestBar.jsp</TITLE>
</HEAD>
<BODY>
<TABLE WIDTH="100%">
<TR><TD><%@ include file=&quo ...
<%@page import="java.util.*" session="false"%>
<%@page contentType="text/html;charset=gb2312"%>
<%= new Date() %>
<%
out.println("你好!");
%>
<%-- ********* ErrPage.jsp ********** --%>
<%@ page contentType="text/htm ...
<!--
Example of JSP Expressions.
-->
<HTML>
<HEAD>
<TITLE>JSP Expressions</TITLE>
<META NAME="author" CONTENT="Marty Hall">
<META NAME="keywords"
CONTENT="JSP,expressions,JavaServer,Pages,servlets"> ...