<a:form action="place" theme="simple" >
<input type="hidden" name="lo.mid" value="<%=session.getAttribute("memId") %>"/>
<a:hidden name="lo_name" value="local_huchang"/>
<a:hidden name="lo.name" value="%{#mm.me.nicname}"/>
                     
위치이동 : <a:select name="lo.place" list="{'1지역','2지역','3지역','4지역','5지역','6지역'}" />
<a:submit value="이동"/>
</a:form></p>

컴온삼국지 플젝을 진행하는 동안 스트럿츠2 공부 많이 하게 된다....
첨엔 파일 입출력 어렵사리 성공... 하지만 새로고침시 액션이 계속 수행되면서 문제...
리절트타입을 전의 액션으로 줘서 해결..
하지만.... hidden태그가 안먹히면서 로그출력에 닉네임이 뜨질 않았다.
value가 <a:hidden name="lo.name"><a:property value="#mm.me.nicname"/></a:hidden>
요렇게 받았었는데.... 이게 안되는 거였다..

결국 삽질끝에 마지막으로..... %{#mm.me.nicname} 아직도 %의 의미는 모르겠다....ㅡ.ㅡ;


==================================================>>>>>>>>>>>>>

이터레이터 예제... 그냥 ArrayList객체 자체 안의 내용을 뿌려준다...
<p>이곳에 전쟁상황로그</p>
                        <a:bean name="sam.action.LocalAction" id="ke">
                        <a:hidden value="%{show_log()}" />
                        </a:bean>
                        <a:iterator value="#ke.loglist"><a:property/><br>
                    </a:iterator>
AND

<s:tree /> 태그를 이용해서 트리를 구현하는 예제를 작성합니다.

결과는 다음과 같습니다.



[TreeNode.java: 모델 클래스]

package example.chapter6;

import java.util.ArrayList;
import java.util.List;

public class TreeNode {
    private String id;
    private String name;
    private List children = new ArrayList();
 
    public TreeNode() {}
 
    public TreeNode(String id, String name, TreeNode... children) {
        this.id = id;
        this.name = name;
        this.children = new ArrayList();
        for (TreeNode child : children) {
            this.children.add(child);
        }
    }

    public List getChildren() {return children;}
    public void setChildren(List children) {this.children = children;}
    public String getId() {return id;}
    public void setId(String id) {this.id = id;}
    public String getName() {return name;}
    public void setName(String name) {this.name = name;}
}


[TreeSampleAction.java : 액션 클래스]

package example.chapter6;

import com.opensymphony.xwork2.ActionSupport;

public class TreeSampleAction extends ActionSupport {
    private TreeNode nodeRoot;
 
    public String execute() throws Exception {

        nodeRoot = new TreeNode("00000", "00000",
                                      new TreeNode("10000", "10000",
                                                 new TreeNode("11000", "11000"),
                                                 new TreeNode("12000", "12000")),
     
                                      new TreeNode("20000", "20000",
                                                 new TreeNode("21000", "21000"),
                                                 new TreeNode("22000", "22000"))
                            );
     
         return "success";
    }

    public TreeNode getNodeRoot() {return nodeRoot;}
    public void setNodeRoot(TreeNode nodeRoot) {this.nodeRoot = nodeRoot;}
}


[treeSample.jsp : JSP]

<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
    <title>tree sample</title>
    <s:head theme="ajax" debug="true" />
</head>

<body>
    <s:tree
           theme="ajax"
           rootNode="%{nodeRoot}"
           childCollectionProperty="children"
           nodeIdProperty="id"
           nodeTitleProperty="name"
           templateCssPath="style/tree.css" toggle="fade"  />
</body>
</html>

[struts.xml : 설정파일]
...
  <action name="treeSample" class="example.chapter6.TreeSampleAction">
      <result>/chapter6/treeSample.jsp</result>
  </action>
...

AND


네이버 Ajax+요구공학 카페에 글을 남기고 답변을 받았다.

Ajax를 구성하는 언어는 여러가지가 있습니다만, 기본이 되는 언어는 (X)HTML, JavaScript, DOM, CSS, XML입니다. 반드시는 아닙니다만 나열한 순서로 공부하시면 될 것 같습니다. 서버와 통신을 하려면 XMLHttpRequest가 필요합니다만 이는 오브젝트 하나이므로 배운다고 할 수 없을 정도입니다.
위 언어에 대해 어느정도 습득을 하신 후 prototype과 같은 framework를 공부하시면 되겠습니다.
한 가지 당부 드리고 싶은 것은 기초가 튼튼해야 한다는 것입니다.
AND