{"version":"1.0","categories":[],"blog_url":"https://daiyamamoto.hatenablog.com/","title":" [\u7ffb\u8a33]Guice User's Guide \u25a032.\tA Counting Example ","blog_title":"\u30ec\u30d9\u30eb\u30a8\u30f3\u30bf\u30fc\u5c71\u672c\u5927\u306e\u30d6\u30ed\u30b0","description":"\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u30b5\u30f3\u30d7\u30ebSay for example that we want to count the number of requests in a session. Define a Counter object which will live on the session:\u4f8b\u3068\u3057\u3066\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u6570\u3092\u6570\u3048\u308b\u6a5f\u80fd\u3092\u6301\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u3092\u6319\u3052\u307e\u3057\u3087\u3046\u3002Session\u306e\u4e2d\u3067\u6709\u52b9\u306aCounter\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002 @SessionScoped public class Counter { int count = 0; /** Increments the count and ret\u2026","type":"rich","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/iad_otomamay/","published":"2007-03-19 00:00:01","height":"190","author_name":"iad_otomamay","provider_name":"Hatena Blog","width":"100%","url":"https://daiyamamoto.hatenablog.com/entry/20070319/p17","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdaiyamamoto.hatenablog.com%2Fentry%2F20070319%2Fp17\" title=\" [\u7ffb\u8a33]Guice User&#39;s Guide \u25a032.\tA Counting Example  - \u30ec\u30d9\u30eb\u30a8\u30f3\u30bf\u30fc\u5c71\u672c\u5927\u306e\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null}