|
|||||||||||
�O�̃N���X ���̃N���X | �t���[������ �t���[���Ȃ� | ||||||||||
�T�v: ����q | �t�B�[���h | �R���X�g���N�^ | ���\�b�h | �ڍ�: �t�B�[���h | �R���X�g���N�^ | ���\�b�h |
Servlet ���N���C�A���g�ɑ���Ԃ����X�|���X�����b�v����I�u�W�F�N�g���`���Ă��܂��B
ServletResponse
�^�̃I�u�W�F�N�g��
Servlet �R���e�i���������Aservice
���\�b�h�̈�����
Servlet �ɓn���܂��B
�o�C�i���f�[�^�� MIME �̃��b�Z�[�W�{�f�B�ɃZ�b�g���đ���Ԃ��ꍇ��
getOutputStream()
���\�b�h�Ŏ擾�ł���
ServletOutputStream
�I�u�W�F�N�g���g���Ă��������B�܂��A
�����f�[�^�𑗂�Ԃ��ꍇ�́AgetWriter()
���\�b�h�ɂ��擾�ł���
PrintWriter
�I�u�W�F�N�g���g�����������B
�o�C�i���f�[�^�ƃe�L�X�g�f�[�^�����݂��郌�X�|���X��Ԃ��ꍇ�́A
�Ⴆ�}���`�p�[�g�ō\������郌�X�|���X�����A
ServletOutputStream
���g���ĕ����f�[�^�����������v���O������p�ӂ��܂��B
MIME �̃{�f�B�ɃZ�b�g���đ���Ԃ����X�|���X�̕����G���R�[�f�B���O��
setContentType(java.lang.String)
���\�b�h�Ŏw��ł��܂��B�Ⴆ�A
"text/html; charset=Shift_JIS" �̂悤�ɂ��܂��B
���邢�́A�����G���R�[�f�B���O�� setLocale(java.util.Locale)
���\�b�h���g���ăZ�b�g���邱�Ƃ��\�ł��B
�����G���R�[�f�B���O���w�肳��Ȃ������ꍇ��
ISO-8850-1 ��K�p���܂��BsetContentType()
����сA
setLocale()
���\�b�h�͕K�� getWriter()
���\�b�h�����O�Ɏ��s����Ȃ�������܂���B
����͕����G���R�[�f�B���O�����ďo�͗p�̃I�u�W�F�N�g���\�z���Ă��邱�Ƃ����R�ł��B
MIME �Ɋւ���ڍׂ�m�肽���ꍇ�� RFC 2045 �Ȃǂ� RFC ���Q�Ƃ��Ă��������BSMTP �� HTTP �Ȃǂ̃v���g�R���� MIME �̃v���t�@�C�����`���Ă��܂����A �W���ƂȂ���@�͂��܂��ɏC�����J��Ԃ���Ă��܂��B
ServletOutputStream
���\�b�h�̊T�v | |
void |
flushBuffer()
�o�b�t�@�����O����Ă���R���e���c�������I�ɃN���C�A���g�ɏo�͂��܂��B |
int |
getBufferSize()
���̃��X�|���X�ɐݒ肳��Ă�����o�b�t�@�T�C�Y��Ԃ��܂��B |
String |
getCharacterEncoding()
���̃��X�|���X�ő���Ԃ� MIME �{�f�B�ɓK�p����Ă��镶���G���R�[�f�B���O����Ԃ��܂��B |
Locale |
getLocale()
���X�|���X�ɐݒ肳��Ă��郍�P�[����Ԃ��܂��B |
ServletOutputStream |
getOutputStream()
���X�|���X�Ƀo�C�i���f�[�^���o�͂���ۂɎg�p���� ServletOutputStream �^�̃I�u�W�F�N�g��Ԃ��܂��B
|
PrintWriter |
getWriter()
�����f�[�^���N���C�A���g�ɑ���Ԃ��̂Ɏg�p���� PrintWriter �I�u�W�F�N�g��Ԃ��܂��B
|
boolean |
isCommitted()
���X�|���X�����łɃR�~�b�g���ꂽ���ǂ��������� boolean ��Ԃ��܂��B |
void |
reset()
�o�b�t�@�����O����Ă���f�[�^�A�X�e�[�^�X�R�[�h�ƃw�b�_�t�B�[���h�̒l���폜���܂��B |
void |
resetBuffer()
���X�|���X�̃w�b�_�t�B�[���h�̒l��X�e�[�^�X�R�[�h�����̂܂܂ɂ��ăo�b�t�@�ɗ��߂��Ă���R���e���c���������܂��B |
void |
setBufferSize(int size)
�K���ȃo�b�t�@�T�C�Y�����X�|���X�Ɋ܂܂�郁�b�Z�[�W�{�f�B�̃T�C�Y�ɐݒ肵�܂��B |
void |
setContentLength(int len)
���X�|���X�̃��b�Z�[�W�{�f�B�����̒������Z�b�g���܂��B |
void |
setContentType(String type)
�N���C�A���g�ɑ���Ԃ���郌�X�|���X�̃R���e���g�^�C�v���Z�b�g���܂��B |
void |
setLocale(Locale loc)
���X�|���X�̃��P�[�����Z�b�g���܂����A���̂Ƃ�(Content-Type �Ŏw�肷�镶���G���R�[�f�B���O���܂�)�w�b�_���K���Ȓl�ɃZ�b�g���܂��B |
���\�b�h�̏ڍ� |
public String getCharacterEncoding()
�����G���R�[�f�B���O���ݒ肳��Ă��Ȃ��ꍇ�͈ÖٓI��
ISO-8859-1
(Latin-1
)���Z�b�g����܂��B
�����G���R�[�f�B���O�� MIME �ɂ��ďڍׂ�m�肽���ꍇ�� RFC 2047 (http://ds.internic.net/rfc/rfc2045.txt) ���Q�Ƃ��Ă��������B
String
�B
�Ⴆ�AISO-8859-1
public ServletOutputStream getOutputStream() throws IOException
ServletOutputStream
�^�̃I�u�W�F�N�g��Ԃ��܂��B
Servlet �R���e�i���o�C�i���f�[�^�̃G���R�[�h�����邱�Ƃ͂���܂���B
���X�|���X���R�~�b�g����ɂ� ServletOutputStream ��
flush() ���\�b�h���Ăяo���Ă��������B���̃��\�b�h��
getWriter()
���\�b�h�̂ǂ��炩�����b�Z�[�W�{�f�B�̏o�͂Ɏg���܂��B
�������g�����Ƃ͂ł��܂���B
ServletOutputStream
IllegalStateException
- ���̃��X�|���X�ł��ł�
getWriter()
���\�b�h�����s����Ă����ꍇ
IOException
- ���o�͎��ɗ�O�����������ꍇgetWriter()
public PrintWriter getWriter() throws IOException
PrintWriter
�I�u�W�F�N�g��Ԃ��܂��B
�����œK�p����镶���G���R�[�f�B���O�� setContentType(java.lang.String)
���\�b�h�� charset=
�̌`���Ŏw�肵�����̂ł��B
�w��̕����G���R�[�f�B���O�ɑΉ�����PrintWriter
�^�̃I�u�W�F�N�g���擾����ɂ͂��̃��\�b�h���� �O ��
setContentType(java.lang.String)
���\�b�h�����s����Ă��Ȃ���Ȃ�܂���B
�K�v�Ȃ�A�g�p����Ă��镶���G���R�[�f�B���O�f����悤�Ƀ��X�|���X�� MIME �^�C�v���C������܂��B
PrintWriter
�� flash()
���\�b�h���Ăяo���ƃ��X�|���X���R�~�b�g����܂��B
���̃��\�b�h�� getOutputStream()
���\�b�h�̂ǂ��炩���{�f�B���b�Z�[�W�̏o�͂Ɏg�p���܂��B�����͎g���܂���B
PrintWriter
�I�u�W�F�N�g
UnsupportedEncodingException
- setContentType
���\�b�h�Ŏw�肳�ꂽ�����G���R�[�f�B���O���T�|�[�g����Ă��Ȃ��ꍇ
IllegalStateException
- ���̃��X�|���X�I�u�W�F�N�g��
getOutputStream
���\�b�h�����łɎ��s����Ă����ꍇ
IOException
- ���o�͎��ɗ�O�����������ꍇgetOutputStream()
,
setContentType(java.lang.String)
public void setContentLength(int len)
len
- �N���C�A���g�ɑ���Ԃ����b�Z�[�W�{�f�B�̒������w�肷�鐮���l�B
HTTP �� Content-Length �w�b�_�t�B�[���h�̒lpublic void setContentType(String type)
text/html; charset=ISO-8859-4
�̂悤�ɕ����G���R�[�f�B���O�̃^�C�v���܂܂�邱�Ƃ�����܂��B
PrintWriter
�I�u�W�F�N�g���擾����ꍇ�͂��炩���߂��̃��\�b�h�����s���Ă����ׂ��ł��B
type
- �R���e���g�^�C�v���w�肷�� String
getOutputStream()
,
getWriter()
public void setBufferSize(int size)
getBufferSize()
���\�b�h���g���Ǝ擾�ł��܂��B
�����߂̃o�b�t�@�T�C�Y���m�ۂ��Ă����ƁA ���ۂɃR���e���c����������Ԃ���Ă��Ȃ����_�ł������̃f�[�^���������߂�悤�ɂȂ�܂��B ���̂��߁A���K�ȃX�e�[�^�X�R�[�h��w�b�_���� Servlet ���Z�b�g�ł���]�n������܂��B �����߂̃o�b�t�@�T�C�Y���w�肷��ƁA�T�[�o�̃����������ጸ�ł���̂ŃN���C�A���g����葬���f�[�^�̎�M���J�n�ł���悤�ɂȂ�܂��B
���̃��\�b�h�̓��X�|���X�Ƀ��b�Z�[�W�{�f�B���o�͂����O�ɌĂяo���Ȃ���Ȃ�܂���B
���łɏo�͂��ꂽ��ɂ��̃��\�b�h���Ăяo������
IllegalStateException
���X���[���܂��B
size
- �K���ȃo�b�t�@�T�C�Y���w�肷�鐮���l
IllegalStateException
- ���łɃR���e���c���o�͂��ꂽ��ł��̃��\�b�h�����s���ꂽ�ꍇgetBufferSize()
,
flushBuffer()
,
isCommitted()
,
reset()
public int getBufferSize()
setBufferSize(int)
,
flushBuffer()
,
isCommitted()
,
reset()
public void flushBuffer() throws IOException
IOException
setBufferSize(int)
,
getBufferSize()
,
isCommitted()
,
reset()
public void resetBuffer()
IllegalStateException
���X���[���܂��B
setBufferSize(int)
,
getBufferSize()
,
isCommitted()
,
reset()
public boolean isCommitted()
setBufferSize(int)
,
getBufferSize()
,
flushBuffer()
,
reset()
public void reset()
IllegalStateException
���X���[���܂��B
IllegalStateException
- ���X�|���X�����łɃR�~�b�g����Ă���ꍇsetBufferSize(int)
,
getBufferSize()
,
flushBuffer()
,
isCommitted()
public void setLocale(Locale loc)
getWriter()
���\�b�h�����O�ɌĂяo���Ă����ׂ��ł��B
�f�t�H���g�ł̓��X�|���X�̃��P�[���̓T�[�o��
�f�t�H���g���P�[���ł��B
loc
- ���X�|���X�̃��P�[�����w�肷�� java.util.Locale �I�u�W�F�N�ggetLocale()
public Locale getLocale()
setLocale(java.util.Locale)
|
|||||||||||
�O�̃N���X ���̃N���X | �t���[������ �t���[���Ȃ� | ||||||||||
�T�v: ����q | �t�B�[���h | �R���X�g���N�^ | ���\�b�h | �ڍ�: �t�B�[���h | �R���X�g���N�^ | ���\�b�h |
���̃h�L�������g�́AJa-Jakarta Project �ɂ��|��܂����B�R�����g������ꍇ�́A[email protected]�܂ł��肢���܂��B
Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.