Site Search :
Standard Enterprise XML Methodology Pattern Setting Tunning Other
Article Contributors
GuestBook
Javapattern Maven
XSourceGen Dev
JetSpeed Test
JLook Image
jLook Family Site


JSP Model 1 vs JSP Model 2 Architecture overview
 
Webtier java technology¸¦ ÀÌ¿ëÇÏ¿© ±¸¼ºÇÒ ¼ö ÀÖ´Â jsp model architectureÀÇ ±¸Á¶¿Í Àå´ÜÁ¡À» ¾ÆÁÖ °£·«ÇÏ°Ô »ìÆ캸µµ·Ï ÇÑ´Ù. ( 2003/03/05 ) 698
Written by ienvyou - ÃÖÁö¿õ
1 of 1
 

È¿°úÀûÀÎ µðÀÚÀÎÀº Â÷ÈÄ ¾ÖÇø®ÄÉÀ̼ǿ¡ ´ëÇÑ À¯Áöº¸¼ö ¹× È®ÀåÀÇ Ãø¸é¿¡ À־ ºñ¿ëÀ» 
°áÁ¤ÇÏ´Â Å« ¿ä¼Ò·Î¼­ ÀÛ¿ëÇÒ ¼ö ÀÖ´Â ºÎºÐÀÌ´Ù. 
¿©±â¼­´Â JSP Model 1 Architecture¿Í JSP Model 2 Architecture¿¡ ´ëÇÏ¿© »ìÆ캸µµ·Ï ÇÏÀÚ.



¢º JSP Model 1 Architecure
  
°¡Àå ÀüÇüÀûÀ¸·Î ±¸¼ºÇÒ ¼ö ÀÖ´Â À¥È¯°æÀº request¿¡ ÀÇÇÑ Ã³¸®¸¦ JSPÆäÀÌÁö·Î¼­ ÀÌ¿ëÇϸç,
requestÀÇ µ¥ÀÌÅ͸¦ ÃßÃâÇÏ¿© JavaBeans¸¦ ÀÌ¿ëÇÑ ±âÁ¸ datasourceÀÇ ÀÌ¿ë ¹× EISȯ°æ¿¡ Á¢¼ÓÇÏ¿©
ÀÏÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ÇüŸ¦ ÃëÇÏ°í ÀÖ´Â °æ¿ì°¡ ´ëºÎºÐÀ̾ú´Âµ¥ ±×¸²À¸·Î µµ½ÄÈ­ÇÏ¿© º¸¸é 
¾Æ·¡¿Í °°´Ù.



À§ÀÇ ÇüŸ¦ °¡¸£ÄÑ JSP Model 1 Architecture¶ó°í Çϴµ¥ ÀÌ °æ¿ì client¿¡¼­ µé¾î¿À´Â
requestºÎºÐ¿¡ ´ëÇÑ Ã³¸®¿Í beans¿¡¼­ ó¸®µÈ °á°ú response°¡ JSPÆäÀÌÁö¿¡ ÀÇÇÏ¿© ¸ðµÎ
󸮵Ǵ °ÍÀ» º¼ ¼ö ÀÖ´Ù. ¶ÇÇÑ ¸ðµç µ¥ÀÌÅÍ ¾×¼¼½º ¶Ç´Â 󸮰¡ beans¿¡¼­ 󸮵ǰí
ÀÖÀ¸¹Ç·Î contents¿Í ·ÎÁ÷ÀÇ ºÐ¸®¶ó´Â ÀåÁ¡À» Àß »ì¸®°í ÀÖ´Ù. ÇÏÁö¸¸ À§ÀÇ ±¸Á¶´Â °£´ÜÇÑ 
¾ÖÇø®ÄÉÀ̼ǿ¡ ÀûÇÕÇÑ ±¸Á¶Áö Á¡Á¡ º¹Àâ, ´ëÇüÈ­µÇ°í ÀÖ´Â Ãß¼¼¿¡´Â ÀûÇÕÇÏÁö ¸øÇÑ 
±¸Á¶¸¦ °¡Áö°í ÀÖ´Ù. ÇÁ·ÎÁ§Æ® ±¸Ãà¿¡ ÇÊ¿äÇÑ JSPÆäÀÌÁö ¹× scriptletÀÌ ¸¹¾ÆÁö¸é ¸¹¾ÆÁú¼ö·Ï 
¾î¶² Á¤ÇüÈ­µÈ Ʋ¿¡ ÀÖÁö ¾ÊÀº ÀÌ»ó Beans¿Í JSPÆäÀÌÁö´Â ¾ÆÁÖ º¹ÀâÇÏ°Ô µÚ¼¯ÀÌ´Â °á°ú¸¦
ÃÊ·¡ÇÏ°Ô µÉ °ÍÀÌ ºÐ¸íÇÏ´Ù. ¶ÇÇÑ MVC ÆÐÅÏ¿¡ ¶ÇÇÑ ºÎÇÕµÇÁö ¾Ê´Â ÇüŸ¦ ÃëÇÏ°í ÀÖ´Ù. 

ÀÌ ¹®Á¦´Â ¿À·ÎÁö request¿¡ ÀÇÇÑ Ã³¸®¸¦ JSP ÆäÀÌÁö¿¡ ÀÇÇÏ¿© ó¸®Çϱ⠶§¹®¿¡ ³ªÅ¸³ª´Â 
¹®Á¦ÀÏ ¼ö Àִµ¥ À̸¦ ÇØ°áÇϱâ À§ÇÑ Servlet°ú JSP¾çÂÊÀ» »ç¿ëÇÏ´Â Model 2 ArchitectureÀÇ 
»ç¿ëÀÌ ³ªÅ¸³ª°Ô µÈ´Ù.

¢º JSP Model 2 Architecture

Model 2ÀÇ ±¸Á¶µµ´Â ¾Æ·¡¿Í °°´Ù.



À§ÀÇ ±¸Á¶°¡ Model1°ú ¾î¶² Â÷ÀÌÁ¡À» º¸ÀÌ´Â °ÍÀϱî? Model1¿¡¼­ÀÇ JSPÆäÀÌÁö´Â MVCÀÇ
ÇüÅ·Π³õ°í º¸¾ÒÀ» ¶§, viewÀÇ Ãø¸é°ú controllerÀÇ Ãø¸é ¸ðµÎ¸¦ ´ã´çÇÏ°í ÀÖ´Â ÇüŸ¦
ÃëÇÏ°í ÀÖ´Ù. 

À̸¦ servletÀ» clientÀÇ request¸¦ ó¸®ÇÒ ¼ö ÀÖ´Â ¿µ¿ªÀ¸·Î µÎ°í JSP¿Í Servlet ¾çÂÊ ¸ðµÎ¸¦
»ç¿ëÇÏ¿© µ¿ÀûÀÎ À¥À» Á¦°øÇÔ¿¡ ÀÖ¾î °¢°¢ÀÇ ±â¼úÀÌ ÃëÇÒ ¼ö ÀÖ´Â ÀåÁ¡À» ÇÕ¼ºÇØ ³õÀº 
ÇüÅ·Πº¸¾Æµµ µÉ °ÍÀÌ´Ù. Áï JSP´Â presentationÀ» »ý¼ºÇس»´Â ºÎºÐÀ¸·Î »ç¿ëÇÏ°í, 
ServletÀº ÇÁ·Î¼¼½º¸¸À» ÁýÁßÀûÀ¸·Î ¼öÇàÇÒ ¼ö ÀÖ´Â ÇüŸ¦ Á¦°øÇÏ°Ô µÈ´Ù.

¿©±â¼­ servletÀº controller·Î¼­ ÇൿÀ» ÇÏ°Ô µÇ¸ç »ç¿ëÀÚÀÇ action¿¡ µû¶ó JSP¿¡¼­ »ç¿ëµÇ´Â 
¾î¶°ÇÑ °´Ã¼³ª  business logic¿¡ ´ëÇÑ class ¹× beans¸¦ instantiateÇÏ´Â ¿ªÇÒÀ» ´ã´çÇÏ°í
forward½ÃÅ°°Ô µÈ´Ù. ÀÌ´Â ÇÁ·ÎÁ§Æ® °³¹ß¿¡ À־ µðÀÚÀÌ³Ê¿Í °³¹ßÀÚÀÇ Ã¥ÀÓ°ú ±ÇÇÑÀ» 
Á» ´õ ¸íÈ®ÇÏ°Ô ÇÒ ¼ö ÀÖ´Â ±¸Á¶À̸ç, ´õ ³ª¾Æ°¡ ¾ÆÁÖ º¹ÀâÇÑ ¾ÖÇø®ÄÉÀ̼ÇÀ» ÀÛ¼ºÇßÀ» 
°æ¿ì controllerºÎºÐÀ» Á¤ÇüÈ­µÈ frameworkÀ¸·Î ±¸¼ºÇÏ°Ô µÈ´Ù¸é ºü¸¥ ½Ã°£¾È¿¡ ¸ñÀûÀ» 
´Þ¼ºÇÒ ¼ö ÀÖ´Â È¿°úÀûÀÎ ±¸Á¶·Î º¯È­½Ãų ¼ö ÀÖ´Â ÀåÁ¡À» °¡Áö°Ô µÈ´Ù. 
ÇöÀç ÁøÇàÁßÀÎ ÀÚ¹Ù ÇÁ·ÎÁ§Æ®ÀÇ °æ¿ì³ª ±âÁ¸¿¡ Sun Microsystems¿¡¼­ ³»³õ¾Ò´ø J2EE BlueprintÀÇ 
web-tier architectureÀÇ °æ¿ì ÀÌ¿Í °°Àº ±¸Á¶·Î ±¸¼ºµÇ¾î ÀÖÀ½À» º¼ ¼ö ÀÖ´Ù. 

Written by Carouser : 2002-09-28
 
1
References
 
Copyright ¨Ï 2003 www.javapattern.info & www.jlook.com, an jLOOK co.,LTD