¥Ñ¥ï¡¼¥Ó¡¼¥ó¥º¡¦¥³¡¼¥Ç¥£¥ó¥°µ¬Ìó


Contents

  1. ̿̾µ¬Ìó
  2. import¤ÎÀë¸À
  3. if¡¢while¡¢for¤Îµ¬Â§
  4. JDBC»ÈÍÑ»þ¤Îµ¬Â§
  5. JavaDoc¤Îµ¬Â§
  6. EJB¥¯¥é¥¹Ì¾¤Î̿̾µ¬Â§


¥Ñ¥ï¡¼¥Ó¡¼¥ó¥º¡¦¥³¡¼¥Ç¥£¥ó¥°µ¬Ìó

¥×¥í¥°¥é¥à³«È¯¤Ë¤ª¤±¤ë¥³¡¼¥Ç¥£¥ó¥°µ¬Ìó¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Þ¤¹¡£

̿̾µ¬Ìó



¥í¡¼¥«¥ëÊÑ¿ô̾¡¢°ú¿ô̾¡¢¥¯¥é¥¹Ì¾¡¢¥á¥½¥Ã¥É̾¡¢¥¯¥é¥¹ÊÑ¿ô̾¤Î̿̾¤Ë¤Ä¤¤¤Æ¤Îµ¬Ìó¡£

(1) ¶¦ÄÌ»ö¹à
»ÈÍѲÄǽʸ»ú¤ÏȾ³Ñ±Ñ¿ôʸ»ú¤È¥¢¥ó¥À¡¼¥¹¥³¥¢¡¼¤À¤±¤Ç¤¹¡£
»ÈÍѲÄǽʸ»ú¡§


(2) ¥í¡¼¥«¥ëÊÑ¿ô̾
Ⱦ³Ñ±Ñ»ú¤Î¾®Ê¸»ú¤ÈȾ³Ñ¿ô»ú¤Î¤ß¤Ç¥¢¥ó¥À¡¼¥¹¥³¥¢¡¼¶èÀÚ¤ê¤È¤·¤Þ¤¹¡£

Note
¤³¤ì¤Ï¥×¥í¥°¥é¥à¤òÂè»°¼Ô¤¬¸«¤¿¤È¤­¤Ë¥í¡¼¥«¥ëÊÑ¿ô¤«¥¯¥é¥¹ÊÑ¿ô¤«¤ò
°ìÌܤÇȽÃǤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£

Îã

NG¡§

OK¡§


(3) °ú¿ô̾
Ⱦ³Ñ±Ñ»ú¤Î¾®Ê¸»ú¤ÈȾ³Ñ¿ô»ú¤Î¤ß¤Ç¥¢¥ó¥À¡¼¥¹¥³¥¢¡¼¶èÀÚ¤ê¤È¤·¤Þ¤¹¡£

Note
¤³¤ì¤Ï¥×¥í¥°¥é¥à¤òÂè»°¼Ô¤¬¸«¤¿¤È¤­¤Ë¥í¡¼¥«¥ëÊÑ¿ô¤«¥¯¥é¥¹ÊÑ¿ô¤«¤ò
°ìÌܤÇȽÃǤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£

Îã

NG¡§

    public ActionForward execute( ActionMapping       actionMapping,
                                  ActionForm          actionForm,
                                  HttpServletRequest  req,
                                  HttpServletResponse res )
        throws IOException, ServletException
    {


OK¡§

    public ActionForward execute( ActionMapping       action_mapping,
                                  ActionForm          action_form,
                                  HttpServletRequest  req,
                                  HttpServletResponse res )
        throws IOException, ServletException
    {


(4) ¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¤Þ¤¹¡£

Îã

NG¡§

public class admMstAccountAction extends WafActionSupport
{
    public ActionForward execute( ActionMapping       mapping,
                                  ActionForm          form,
                                  HttpServletRequest  req,
                                  HttpServletResponse res )
        throws IOException, ServletException
    {


OK¡§

public class AdmMstAccountAction extends WafActionSupport
{
    public ActionForward execute( ActionMapping       mapping,
                                  ActionForm          form,
                                  HttpServletRequest  req,
                                  HttpServletResponse res )
        throws IOException, ServletException
    {


(5) ¥á¥½¥Ã¥É̾
Ⱦ³Ñ±Ñ»ú¤Î¾®Ê¸»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¤Þ¤¹¡£

Îã

NG¡§

    public void DoStoreAction( HttpServletRequest  req,
                               HttpServletResponse res,
                               AdmMstAccountForm   form )
    {


OK¡§

    public void doStoreAction( HttpServletRequest  req,
                               HttpServletResponse res,
                               AdmMstAccountForm   form )
    {


(6) ¥¯¥é¥¹ÊÑ¿ô̾
Ⱦ³Ñ±Ñ»ú¤Î¾®Ê¸»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¤Þ¤¹¡£

Warning
Æüì¤Ê¾ì¹ç¤Ï¡¢¤³¤ÎÈϰϤǤϤʤ¤¡£

Îã

NG¡§


OK¡§




import¤ÎÀë¸À



import¤ÎÀ©¸Â¤Ï"*"¤Ç½¸Ì󤻤º¤Ë¸Ä¡¹¤ËÀë¸À¤¹¤ë¤³¤È¡£


Îã

NG¡§

    import javax.ejb.EJBLocalHome;
    import javax.naming.*;
    import javax.servlet.*;


OK¡§

    import javax.ejb.EJBLocalHome;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;




if¡¢while¡¢for¤Îµ¬Â§



¼Â¹Ô¤¹¤ë¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬1¹Ô¤Ç¤¢¤Ã¤Æ¤âɬ¤º{}¤òµ­½Ò¤¹¤ë¤³¤È¡£


Îã

NG¡§

    if ( !result.next() ) return false;


OK¡§

    if ( !result.next() ) { return false; }



JDBC»ÈÍÑ»þ¤Îµ¬Â§



¥¯¥é¥¹Ì¾¡¢¥á¥½¥Ã¥É̾¡¢¥¯¥é¥¹ÊÑ¿ô¡¢¥í¡¼¥«¥ëÊÑ¿ô¡¢°ú¿ô¤Î̿̾¤Ë¤Ä¤¤¤Æ¤Îµ¬Ìó¡£

(1) ResultSet¤Ë¤Æ·ë²Ì¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¥«¥é¥à¡¦¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¼èÆÀ¤»¤º¤Ë¡¢¥«¥é¥à̾¤Ç¼èÆÀ¤¹¤ë¡£

Îã

NG¡§

    result.getTimestamp(i++), 
    result.getTimestamp(i++), 
    result.getTimestamp(i++), 
    result.getInt(i++), 
    result.getString(i++), 


OK¡§

    result.getTimestamp("appendDate"), 
    result.getTimestamp("modifyDate"), 
    result.getTimestamp("deleteDate"), 
    result.getInt("deleteKubun"), 
    result.getString("account"), 


(2) ResultSet¡¢PreparedStatement¡¢Connection¤Î¥¯¥í¡¼¥º¤Î½èÍý
ɬ¤º finally ¤Ç¹Ô¤¦¤³¤È¡£

Note
¤³¤ì¤ÏException¤¬È¯À¸¤·¤¿¤È¤­Åù¡¢É¬¤º¥¯¥í¡¼¥º½èÍý¤¬¼Â¹Ô¤¹¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£

Îã

NG¡§


OK¡§




JavaDoc¤Îµ¬Â§



ɬ¤º¥¯¥é¥¹¡¢¥á¥½¥Ã¥É¡¢¥¯¥é¥¹ÊÑ¿ô¤Ë¤ÏJavaDoc¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£

(1) ¥¯¥é¥¹
JavaDoc¤ÎÀâÌÀʸ¤Ï¡Ö<p>¥¿¥¤¥È¥ë¡§¡Á</p>¡×¡¢¡Ö<p>ÀâÌÀ¡§¡Á</p>¡×¤È¸À¤¦¹½À®¤Çµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£


(2) ¥á¥½¥Ã¥É
JavaDoc¤ÎÀâÌÀʸ¤Ï¡Ö<p>¥¿¥¤¥È¥ë¡§¡Á</p>¡×¡¢¡Ö<p>ÀâÌÀ¡§¡Á</p>¡×¤È¸À¤¦¹½À®¤Çµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£
¤½¤ì¤È¡¢¤³¤³¤Ç¤âɬ¤º¡Ö@author¡×¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£



(3) ¥¯¥é¥¹ÊÑ¿ô
¡Ö/**¡×¤È¡Ö*/¡×¤Ç°Ï¤ó¤Çµ­½Ò¤·¤Þ¤¹¡£




EJB¥¯¥é¥¹Ì¾¤Î̿̾µ¬Â§



EJB¥¯¥é¥¹Ì¾¤Î̿̾¤Ë¤Ä¤¤¤Æ¤Îµ¬Ìó¡£

(1) ¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë̾¡£
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËJAR¤òÉÕ¤±¤ë¡£

Îã
AdministratorJAR



(2) ¥¨¥ó¥Æ¥£¥Æ¥£¡¦¥Ó¡¼¥ó¤Ç¤Î display-name¤Î»ØÄê
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËEB¤òÉÕ¤±¤ë¡£

Îã
AdmMstQuestionEB



(3) ¥¨¥ó¥Æ¥£¥Æ¥£¡¦¥Ó¡¼¥ó¤Ç¤Î ejb-name¤Î»ØÄê
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËEJB¤òÉÕ¤±¤ë¡£

Îã
AdmMstQuestionEJB



(4) ¥¨¥ó¥Æ¥£¥Æ¥£¡¦¥Ó¡¼¥ó¤Ç¤Î local-home¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËLocalHome¤òÉÕ¤±¤ë¡£

Îã
AdmMstQuestionLocalHome



(5) ¥¨¥ó¥Æ¥£¥Æ¥£¡¦¥Ó¡¼¥ó¤Ç¤Î local¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËLocal¤òÉÕ¤±¤ë¡£

Îã
AdmMstQuestionLocal



(6) ¥¨¥ó¥Æ¥£¥Æ¥£¡¦¥Ó¡¼¥ó¤Ç¤Î ejb-class¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËBean¤òÉÕ¤±¤ë¡£

Îã
AdmMstQuestionBean



(7) ¥»¥Ã¥·¥ç¥ó¡¦¥Ó¡¼¥ó¤Ç¤Î display-name¤Î»ØÄê
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËSB¤òÉÕ¤±¤ë¡£

Îã
ShoppingControllerSB



(8) ¥»¥Ã¥·¥ç¥ó¡¦¥Ó¡¼¥ó¤Ç¤Î ejb-name¤Î»ØÄê
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËEJB¤òÉÕ¤±¤ë¡£

Îã
ShoppingControllerEJB



(9) ¥»¥Ã¥·¥ç¥ó¡¦¥Ó¡¼¥ó¤Ç¤Î local-home¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËLocalHome¤òÉÕ¤±¤ë¡£

Îã
ShoppingControllerLocalHome



(10) ¥»¥Ã¥·¥ç¥ó¡¦¥Ó¡¼¥ó¤Ç¤Î local¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËLocal¤òÉÕ¤±¤ë¡£

Îã
ShoppingControllerLocal



(11) ¥»¥Ã¥·¥ç¥ó¡¦¥Ó¡¼¥ó¤Ç¤Î ejb-class¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËBean¤òÉÕ¤±¤ë¡£

Îã
ShoppingControllerBean



(12) WEB¥µ¡¼¥Ó¥¹¤Ç¤Î ejb-name¤Î»ØÄê
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËEndpointBean¤òÉÕ¤±¤ë¡£

Îã
AirlinePOEndpointBean



(13) WEB¥µ¡¼¥Ó¥¹¤Ç¤Î service-endpoint¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËIntf¤òÉÕ¤±¤ë¡£

Îã
AirlinePOIntf



(14) WEB¥µ¡¼¥Ó¥¹¤Ç¤Î ejb-class¤Î¥¯¥é¥¹Ì¾
Ⱦ³Ñ±Ñ»ú¤ÎÂçʸ»ú»Ï¤Þ¤ê¤È¤·¡¢È¾³Ñ±Ñ¿ôʸ»ú¤Î¤ß¤ÇȾ³Ñ±Ñ»ú¤ÎÂçʸ»ú¶èÀÚ¤ê¤È¤·¡¢ºÇ¸å¤ËEndpointBean¤òÉÕ¤±¤ë¡£

Îã
AirlinePOEndpointBean




¥×¥ê¥ó¥¿½ÐÎÏÍѲèÌÌ Í§Ã£¤ËÅÁ¤¨¤ë


Åê¹Æ¤µ¤ì¤¿ÆâÍƤÎÃøºî¸¢¤Ï¥³¥á¥ó¥È¤ÎÅê¹Æ¼Ô¤Ëµ¢Â°¤·¤Þ¤¹¡£
¥æ¡¼¥¶Ì¾:

¥Ñ¥¹¥ï¡¼¥É:


¥Ñ¥¹¥ï¡¼¥Éʶ¼º

¿·µ¬ÅÐÏ¿

¹âÅ٤ʸ¡º÷
¤³¤Î¥µ¥¤¥È¤Ï OpenFootStep ¤Ç¥¢¥¯¥»¥¹²òÀÏÃæ¤Ç¤¹