アウトプットができる技術者に

it's a time to take a new step !

Struts2 入門 Localization

  • package_ja.properties は action support の getText("foo") で取得できる
  • pacakge_xx.properties は scope が package
  • global_ja.properties は struts.xml の設定が必要
<constant name="struts.custom.i18n.resources" value="global" />

reference

Git リモートリポジトリとのやり取り

remoteと差があるか確認する
  • git remote show origin でチェック可能
  • 実行結果の最終行「master pushes to master (xxx)」のxxxの部分が
local out of date localが旧い(fetch/pullすべき)
fast-forwardable localが新しい(pushすべき)
git remote show origin

## log
* remote origin
  Fetch URL: https://foo@${url}/foo/testing.git
  Push  URL: https://foo@${url}/foo/testing.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (fast-forwardable)
remote のリポジトリのデータを取得する (作業領域に影響なし)
  • git fetch で実行可能
  • fetchしてきたデータは.git/FETCH_HEADに保存される。なお、このデータはmerge後にも残る
git fetch

# log
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
From https://xxx.com/foo/testing
   96f668a..17c7a88  master     -> origin/master
  • 差分を表示
    • --name-statusオプションをつけると名前と状態のみ svn status に似た表示
      • ただし、confrict がわかない
    • difftool を使うと vim での左右の見開き
git diff FETCH_HEAD
git diff --name-status FETCH_HEAD
git difftool FETCH_HEAD

# fetch 直後の場合、FETCH_HEAD は origin/master でも同じ
  • fetch 結果を merge
git merge FETCH_HEAD

# Log:問題ない場合
Updating 0ab3cb6..96f668a
Fast-forward
 index.html |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

# Log:confrictしてる場合
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html
Automatic merge failed; fix conflicts and then commit the result.
remote のリポジトリデータを取り込み、マージする
  • git pull を使うと 上記のgit fetch / merge の流れを一度で行える
git pull

## log
Updating 3f4bbc6..0ab3cb6
Fast-forward
 index2.html |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 index2.html