�����ꂩ��ÓI���\�b�h���Ăяo���FJavaTips �`JSP�^�T�[�u���b�g��

» 2005�N03��30�� 10��00�� ���J
[�R�c�ˊ��C��IT]

�@JSP 2.0����́uFunctions�i�֐��j�v�Ƃ����@�\�𗘗p���邱�ƂŁA������i${�`}�j����Java��public static���\�b�h�i�ÓI���\�b�h�j���Ăяo�����Ƃ��”\�ɂȂ�܂����B�ȒP�Ȑ��l���Z�╶������H�A���̑��̒P���ȏ��̎擾�ɂ‚��ẮA���炩����Functions�Ƃ��ăA�v���P�[�V�����ɓo�^���Ă������ƂŁAJSP�y�[�W����璷�ȃX�N���v�e�B���O�v�f����菜�����Ƃ��ł��܂��B

�@�ȉ��ł͋�̓I�ȗ�Ƃ��āAFunctions�𗘗p����JSP�y�[�W��ŃV�X�e���E�v���p�e�B���擾������@�ɂ‚��ďЉ�܂��B

�i1�j�ÓI���\�b�h���܂�Java�N���X���`����

�@�V�X�e���E�v���p�e�B���擾���邽�߂�systemProperty���\�b�h��public static���\�b�h�Ƃ��Ē�`���܂��B

���X�g1�@MyFunctions.java
package to.msn.wings.javatips;
 
public class MyFunctions {
  public static String systemProperty(String name) {
    return System.getProperty(name);
  }
}

�i2�j�^�O���C�u�����E�f�B�X�N���v�^���`����

�@�ÓI���\�b�h���^�O���C�u�����E�f�B�X�N���v�^�ɓo�^���܂��B<function>�v�f�́AJSP 2.0����V���ɒlj����ꂽ�v�f�ŁA�^�O���C�u�������Functions���`���邽�߂̂��̂ł��B�����ł́Ato.msn.wings.javatips.MyFunctions�N���X��systemProperty���\�b�h��systemProperty�֐��Ƃ��ēo�^���Ă��܂��B�����ł́A�Ƃ肠�������ۂ̃��\�b�h���Ɗ֐����Ƃ𓙂����ݒ肵�Ă��܂����A�������A�܂������قȂ閼�O�ł��\���܂���B

���X�g2�@MyTag.tld
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
 version="2.0">
  <tlib-version>2.0</tlib-version>
  <function>
    <name>systemProperty</name>
    <function-class>to.msn.wings.javatips.MyFunctions</function-class>
    <function-signature>java.lang.String systemProperty(java.lang.String)</function-signature>
  </function>
</taglib>

�i3�j�f�v���C�����g�E�f�B�X�N���v�^���`����

�@���ɁA�f�v���C�����g�E�f�B�X�N���v�^�ɁA���X�g2�̃^�O���C�u�����E�f�B�X�N���v�^��o�^���܂��B

���X�g2 web.xml
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
  version="2.4">
  <jsp-config>
    <taglib>
      <taglib-uri>http://www.wings.msn.to/mytag/</taglib-uri>
      <taglib-location>/WEB-INF/MyTag.tld</taglib-location>
    </taglib>
    <taglib>
  </jsp-config>
</web-app>

�i4�jJSP�y�[�W���`����

�@�i1�j�`�i3�j�Őݒ肵��Functions�����������삵�Ă��邩�ǂ������m�F���邽�߂ɁAJSP�y�[�W��Ŏ��ۂ�Functions���L�q���Ă݂܂��BFunctions���g�p����ɂ́A�^�O���C�u�������g���ꍇ�Ɠ��l��@taglib�f�B���N�e�B���Ń^�O���C�u������L��������K�v������܂��B

���X�g3 function.jsp
<%@ page contentType="text/html;charset=Windows-31J" %>
<%@ taglib prefix="my" uri="http://www.wings.msn.to/mytag/" %>
�ꎞ�t�H���_�̃p�X�F${my:systemProperty("java.io.tmpdir")}

�@��L�����s���āA�ȉ��̂悤�Ȍ��ʂ��\�������ΐ����ł��B

s

Copyright © ITmedia, Inc. All Rights Reserved.

'; this.insertTarget = document.querySelector('#cmsBody .subscription') || document.querySelector('#cmsBody .inner'); }; BodyAdIMSWithCCE.prototype = Object.create(BodyAdContent.prototype); BodyAdIMSWithCCE.prototype.activate = function () { refreshGam('InArtSpecialLink'); } // global reference window.itm = itm; //entry point BodyAdEventBase.polyfill(); const bodyAdManager = BodyAdManager.getInstance(); bodyAdManager.addEventListener(BodyAdManager.EVENTS.READY, function (ev) { bodyAdManager.loadAdvertise(); }); bodyAdManager.init(); })();
�X�|���T�[����̂��m�点PR

���ڂ̃e�[�}

Microsoft  WindowsőO2025
AI for GWjAO
[R[h^m[R[h Zg by IT - ITGWjArWlX̒SŊ􂷂gD
Cloud Native Central by IT - XP[uȔ\͂gD
�V�X�e���J���m�E�n�E �y�����i�r�zPR
���Ȃ��ɂ������߂̋L��PR

RSS�ɂ‚���

�A�C�e�B���f�B�AID�ɂ‚���

���[���}�K�W���o�^

��IT�̃��[���}�K�W���́A �������A���ׂĖ����ł��B���Ѓ��[���}�K�W�������w�ǂ��������B