java 字符菜单_java该怎么写左侧菜单树

action中调取代码如下:

public String listValueStandard(){

System.out.println("listValueStandard");

List types=basicNormService.getAllValueStandard();

List trees = new ArrayList();

for(int i=0;i

TreeJson json = new TreeJson();

json.setId(types.get(i).getValueStandardId()+"");

System.out.println("pid"+types.get(i).getParentId());

if(types.get(i).getParentId()==null){

json.setPid(null);

}else{

json.setPid(types.get(i).getParentId()+"");

}

json.setText(types.get(i).getName());

trees.add(json);

}

List jsons = ListToTree.formatTree(trees);

JSONArray jsonarray=JSONArray.fromObject(types);

listValueStandard=jsonarray.toString();

return "tovaluestandard";

}

这样写无法调取成功,下面是所调用树的

实体类:

public class ValueStandard implements java.io.Serializable {

// Fields

private Integer valueStandardId;

private Integer parentId;

private String name;

private String note;

private String sequence;

// Constructors

/** default constructor */

public ValueStandard() {

}

/** minimal constructor */

public ValueStandard(Integer parentId) {

this.parentId = parentId;

}

/** full constructor */

public ValueStandard(Integer parentId, String name, String note,

String sequence) {

this.parentId = parentId;

this.name = name;

this.note = note;

this.sequence = sequence;

}

// Property accessors

public Integer getValueStandardId() {

return this.valueStandardId;

}

public void setValueStandardId(Integer valueStandardId) {

this.valueStandardId = valueStandardId;

}

public Integer getParentId() {

return this.parentId;

}

public void setParentId(Integer parentId) {

this.parentId = parentId;

}

public String getName() {

return this.name;

}

public void setName(String name) {

this.name = name;

}

public String getNote() {

return this.note;

}

public void setNote(String note) {

this.note = note;

}

public String getSequence() {

return this.sequence;

}

public void setSequence(String sequence) {

this.sequence = sequence;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值