태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

package com.kame.struts2.architecture.valuestack;

import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;

public class ValueStackTest {
 public static void main(String[] args) {
  Person person = new Person();
  Animal animal = new Animal();
 
  ConfigurationManager configurationManager = new ConfigurationManager();
        configurationManager.addContainerProvider(new XWorkConfigurationProvider());
        Configuration config = configurationManager.getConfiguration();
        Container container = config.getContainer();

  // 스택을 만들어서 animal과 person을 push한다.
  ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();

  stack.push(animal);
  stack.push(person);

  stack.setValue("name", "Johnson"); // person.setName("Johnson");
  stack.setValue("salary", 5000000); // person.setSalary(5000000);
  stack.setValue("species", "pug"); // animal.setSpecies("pug");

  System.out.println(person);
  System.out.println(animal);

  System.out.println(stack.findValue("name")); // person.getName();
  System.out.println(stack.findValue("species")); // animal.getSpecies();
  System.out.println(stack.findValue("salary")); // person.getSalary();
 }
}

top
    이전 댓글 더보기
  1. Burberry Outlet 2012.12.05 14:56 신고 댓글주소 | 수정/삭제 | 댓글

    100000 protest at Egypt's presidential palace. Thank you so much dear! I’m happy to hear that you’re inspired and on your way- I wish you nothing but the best!!

  2. Polo Oultet 2012.12.05 15:58 신고 댓글주소 | 수정/삭제 | 댓글

    Yahoo buys video chat startup OnTheAir. Thanks for your reply! I will definitely stick around and hopefully I can learn better writing habits.

  3. moncler outlet 2012.12.05 16:08 신고 댓글주소 | 수정/삭제 | 댓글

    <p>I am quite satisfied with this sit <a href="http://www.icheaplouboutinsuk.co.uk/"><strong>lounoutins uk</strong></a>, I write some things are more or less I have some help.Read the post of the landlord, my mood was actually a long time can not heal says <a href="http://www.icheaplouboutinsuk.co.uk/"><strong>cheap louboutins</strong></a>: Great Music, elephant Xi shaped,.I now finally understand what I lack is the landlord that the pursuit of truth and the landlord that the ideal of hard practice arising from the heavy sense <a href="http://www.icheaplouboutinsuk.co.uk/"><strong>lounoutins sale</strong></a>. The face of the posts of the landlord, I was shocked, almost unable to move , I kind of split the paper wish to the generous hast brought me can not help but turn the landlord posts <a href="http://www.icheaplouboutinsuk.co.uk/"><strong>lounoutins sale</strong></a>, people have lingering wear beams <a href="http://www.icheaplouboutinsuk.co.uk/"><strong>cheap louboutins uk</strong></a>, three days without a break feel. </p>
    <p>wsformzsl20121105</p>

  4. authentic designer handbag 2012.12.09 15:16 신고 댓글주소 | 수정/삭제 | 댓글

    hey!Do you know if 2012 http://www.xgendiu.com will come.Never waste the opportunities that come up, because the same opportunity will not come twice. let us have a elegant life! I want to share with who love the life.

  5. north face outlet 2012.12.10 15:39 신고 댓글주소 | 수정/삭제 | 댓글

    I want to share with who love the life.

  6. casque beats pas cher 2012.12.15 09:36 신고 댓글주소 | 수정/삭제 | 댓글

    impressions de la vérité, aGn que je puisse les communiquer aux miens, et qu'ils soient heureux!

  7. ecouteur beats 2012.12.15 09:36 신고 댓글주소 | 수정/삭제 | 댓글

    Il y avait tout dans cette admirable prière : le doute et ses sources, ses origines

  8. doudoune canada goose 2012.12.15 09:36 신고 댓글주소 | 수정/삭제 | 댓글

    morales, ses troubles, puis ses remèdes, les conditions du retour vers la vérité par

  9. Burberry Outlet 2013.01.04 10:53 신고 댓글주소 | 수정/삭제 | 댓글

    Whoa! This blog looks exactly like my old one. It’s on a totally different subject but it has pretty much the same layout and design. Excellent choice of colors.

  10. Polo Outlet 2013.01.04 10:58 신고 댓글주소 | 수정/삭제 | 댓글

    It’s actually a great and helpful piece of info. I’m satisfied that you shared this helpful information with us. Please stay us up to date like this. Thank you for sharing.

  11. Christian Louboutin Outlet 2013.01.04 10:59 신고 댓글주소 | 수정/삭제 | 댓글

    Wonderful post, you have pointed out some great details , I besides believe this s a extremely great internet site.

  12. Sac Lancel Adjani 2013.01.12 18:35 신고 댓글주소 | 수정/삭제 | 댓글

    souffert le martyre pour être aimé des malheureux (1 ). Mais il n'est pas le seul, et il faut continuer à raconter ces combats, à enregistrer ces aveux et ces contradictions. Qui n'a vu, par exemple, avec dégot et tristesse, un vieillard autrefois justement honoré pour avoir jeté dans notre http://www.saclancela.com/

  13. cheap north face jackets 2013.01.14 11:08 신고 댓글주소 | 수정/삭제 | 댓글

    The heaviness of the metal used and if the choice is a gold bracelet will determine if you can afford it or not.

  14. Christian Louboutin Outlet 2013.01.17 17:09 신고 댓글주소 | 수정/삭제 | 댓글

    State of the Commonwealth. Hi dear, had a great time chatting with you at email! this is a great blog! hope all goes well with the move!

  15. Burberry Outlet 2013.01.17 17:33 신고 댓글주소 | 수정/삭제 | 댓글

    Players, coaches high on Kelly. Thank you so much dear! I’m happy to hear that you’re inspired and on your way- I wish you nothing but the best!!

  16. Polo Oultet 2013.01.17 17:49 신고 댓글주소 | 수정/삭제 | 댓글

    Kids' Vaccine Slate Is Backed by Panel. Thanks for your reply! I will definitely stick around and hopefully I can learn better writing habits.

  17. hEI 2013.01.24 16:04 신고 댓글주소 | 수정/삭제 | 댓글

    http://www.usbflashdrive64gb.com/ cheap usb flash drives
    http://www.drdrebeatsearbuds.info/ dr dre beats earbuds
    http://www.quicken2013site.com/ quicken 2013
    http://www.beatswirelessheadphones.info/ beats wireless headphones
    http://www.drdrebeatsheadphones.info/ dr dre beats headphones
    http://www.quicken2013software.com/ quicken 2013 software
    http://www.drdreearphones.info/ cheap dr dre earphones
    http://www.quickenpremier2013download.com/ quicken premier download
    http://www.beatsaudioearbuds.info/ http://www.beatsaudioearbuds.info/
    http://www.turbotax2012deluxe.com/ http://www.turbotax2012deluxe.com/
    http://www.beatsbydrdrepro.info/ beats by dr dre pro
    http://www.quickendownload.net/ quicken download
    http://www.beatsbydrdreheadphonescheap.info/ cheap beats by dr dre headphones


  18. 2013.02.07 19:29 댓글주소 | 수정/삭제 | 댓글

    비밀댓글입니다

  19. coco peat 2013.02.15 20:23 신고 댓글주소 | 수정/삭제 | 댓글

    Great Your contribution the same work Thanks to sharing

  20. 精力剤の専門店【激安・精力店】 2013.02.23 12:39 신고 댓글주소 | 수정/삭제 | 댓글

    精力剤の専門店【激安・精力店】
    精力剤を購入なら精力剤の専門店「精力店」へ!ed不全、早漏、遺漏、性欲減退などの悩みを解決!
    レビトラ20mg*30錠 http://www.seiryokuten.com/rebitora-01.html
    レビトラ20mg*4錠 http://www.seiryokuten.com/rebitora-02.html
    シアリス20mg*30錠 http://www.seiryokuten.com/shiarisu-01.html

Write a comment





티스토리 툴바