liguofeng29’s blog

個人勉強用ブログだっす。

2015-08-04から1日間の記事一覧

JSP - pageContextオブジェクト

page, request, session, applicationスコープの情報にアクセスできる。 主なメソッド説明 getAttribute(String name) pageスコープのname属性取得 getAttribute(String name, int scope) scope指定のname属性取得 PageContext.PAGE_SCOPE pageContext.REQUE…

JSP - outオブジェクト

JSPページ内のoutput streamを表す。 <%= %>の本質はout.write()である。 out.jsp <%@ page contentType="text/html;charset=Shift_jis" language="java" %> <html> <head> <title>use out object.</title> </head> <body> <%-- i宣言 --%> <%!int i = 0;%> i = <%=i%><br> i = <% out.print(i);%> </body> </html>

自動バインディング

DIの指定を省略した場合、 コンポーネント間の依存関係は、 型および名前によってS2Containerが自動的に解決します。 componentタグのautoBinding属性を指定することで細かく制御することもできます。 autoBinding説明 auto(default) コンストラクタとプロパ…

Dependency Injectionタイプその4 - フィールド・インジェクション

フィールドにDIを行なうのがフィールド・インジェクションです。 フィールドには、Bindingアノテーションを使って指定します。この機能は、2.4から利用できます。 app.dicon < <components> <include path="convention.dicon"/> </include></components>