JspWriter
| 日本語 | ジャバ給仕頁書き |
| 英語 | JSP writer |
| ふりがな | じぇいえすぴーらいたー、じぇーえすぴーらいたー |
| フリガナ | ジェイエスピーライター、ジェーエスピーライター |
J2EEに含まれるクラスのひとつ。パッケージも含めたクラス名はjavax.servlet.jsp.JspWriter。
JSPでHTML出力を行うためのクラス。
PrintStreamクラス同様、print()メソッド及びprintln()メソッドで、あらゆるプリミティブ型やクラスを出力することができる。
JSP暗黙オブジェクトのout変数はこのクラスである。
JSPでHTML出力を行うためのクラス。
PrintStreamクラス同様、print()メソッド及びprintln()メソッドで、あらゆるプリミティブ型やクラスを出力することができる。
JSP暗黙オブジェクトのout変数はこのクラスである。
参考サイト
<%-- webapps/sample-servlet/sample.jsp --%>
<%-- http://localhost:8080/sample-servlet/sample.jsp でアクセスできます。 --%>
<%@ page contentType="text/html; charset=Windows-31J" pageEncoding="Windows-31J" %>
<%--
pageEncodingには、このファイルを保存した時の文字コードを指定してください。
Windowsであれば"Windows-31J"を指定すればいいでしょう。
--%>
<html>
<head>
<title>JSPのサンプル</title>
</head>
<body>
<%
// JspWriterクラスの変数を作り、out変数を代入します。
JspWriter jspWriter = out;
jspWriter.print( 100 );
jspWriter.println( "あいうえお" );
jspWriter.println( "<br>" );
%>
<%!
// JSP
%>
<%-- 出力結果 --%>
<%--
100あいうえお
--%>
</body>
</html>
<%-- http://localhost:8080/sample-servlet/sample.jsp でアクセスできます。 --%>
<%@ page contentType="text/html; charset=Windows-31J" pageEncoding="Windows-31J" %>
<%--
pageEncodingには、このファイルを保存した時の文字コードを指定してください。
Windowsであれば"Windows-31J"を指定すればいいでしょう。
--%>
<html>
<head>
<title>JSPのサンプル</title>
</head>
<body>
<%
// JspWriterクラスの変数を作り、out変数を代入します。
JspWriter jspWriter = out;
jspWriter.print( 100 );
jspWriter.println( "あいうえお" );
jspWriter.println( "<br>" );
%>
<%!
// JSP
%>
<%-- 出力結果 --%>
<%--
100あいうえお
--%>
</body>
</html>
<%-- webapps/sample-servlet/sample.jsp --%>
<%-- http://localhost:8080/sample-servlet/sample.jsp でアクセスできます。 --%>
<%@ page contentType="text/html; charset=Windows-31J" pageEncoding="Windows-31J" %>
<%--
pageEncodingには、このファイルを保存した時の文字コードを指定してください。
Windowsであれば"Windows-31J"を指定すればいいでしょう。
--%>
<html>
<head>
<title>JSPのサンプル</title>
</head>
<body>
<%
// JspWriterクラスの変数を作り、out変数を代入します。
JspWriter jspWriter = out;
jspWriter.print( 100 );
jspWriter.println( "あいうえお" );
jspWriter.println( "<br>" );
%>
<%!
// JSP
%>
<%-- 出力結果 --%>
<%--
100あいうえお
--%>
</body>
</html>




