Bean scope in spring 2013

View previous topic View next topic Go down

Bean scope in spring 2013

Post by Admin on Sun Sep 15, 2013 4:05 am

2013 2013 2013 <div dir="ltr" style="text-align: left;" trbidi="on"> When we declare a bean in spring, there is a feature to define the scope of that bean in the configuration file. In spring, there are 5 different types of scopes as shown below:<br><br> <table style="font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width:1px;border-color: #666666;border-collapse: collapse;"><tr> <th style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;">Scope</th> <th style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;">Explanation</th></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">singleton</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per Spring IoC container</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">prototype</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a new bean instance each time when requested</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">request</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per HTTP request</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">session</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per HTTP session</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">globalsession</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per global HTTP session</td></tr></table></div><br> 2013 2013 2013 <br><div dir="ltr" style="text-align: left;" trbidi="on"> When we declare a bean in spring, there is a feature to define the scope of that bean in the configuration file. In spring, there are 5 different types of scopes as shown below:<br><br> <table style="font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width:1px;border-color: #666666;border-collapse: collapse;"><tr> <th style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;">Scope</th> <th style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;">Explanation</th></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">singleton</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per Spring IoC container</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">prototype</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a new bean instance each time when requested</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">request</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per HTTP request</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">session</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per HTTP session</td></tr><tr> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">globalsession</td> <td style="border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;">Return a single bean instance per global HTTP session</td></tr></table></div><br>2013 2013 2013 <br> <a href="http://www.matrixar.com/" title="Matrix ">المصفوفة : أجمل الخلفيات والصور</a>

Admin
Admin

Posts : 64122
Join date : 2013-02-22

View user profile http://prowebsites1.forumaroc.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum