[Java] 1. js Code [java] $ (function () {$. ajax ({type: 'post', url: '$ {ctx}/dictionary/listChannel. do ', data: '', dataType: 'json', success: function (json) {for (var I = 0; I <json. length; I ++) {$ ("# channel_id "). append ("<option value = '" + json [I]. value_Id + "'>" + json [I]. value + "</option>") ;}}, error: function () {alert ('error') ;}}); // when selecting channel information, load version information [java] $ ("# channel_id "). change (function () {var channel_id = $ ("# c Hannel_id "). val (); $ (" # version_id "). empty (); if (""! = Channel_id) {// query version information $. ajax ({type: 'post', url: '$ {ctx}/dictionary/listVersion2.do', data: 'id = '+ channel_id, ype: 'json', success: function (json) {if (null! = Json) {$ ("# version_id "). append ("<option value =''> --- Select --- </option> "); for (var I = 0; I <json. length; I ++) {$ ("# version_id "). append ("<option value = '" + json [I]. value_Id + "'>" + json [I]. value + "</option>") ;}}, error: function () {alert ('no version information under this channel ');}});} else {$ ("# version_id "). append ("<option value =''> --- Select --- </option> ");}});}); [java] 2. Key html page code [java] <td align = "left" height = "18" bgcolor = "# ecf6fa"> <span class = "STYLE8"> Channels identifier: </span> <select id = "channel_id" name = "packageBean. CHANNEL_ID "class =" selectstyle200 "> <option value =" "> --- select --- </option> </select> </td> <td align =" left "height = "18" bgcolor = "# ecf6fa"> <span class = "STYLE8"> Version ID: </span> <select id = "version_id" name = "packageBean. VERSION_ID "class =" selectstyle200 "> <option value =" "> --- select --- </option> </select> </td> [java] 3. Methods in struts2 action package com. ecp. web. dictionary. action; import java. io. printWriter; import java. util. list; import javax. servlet. http. httpServletResponse; import org. apache. struts2.ServletActionContext; import com. alibaba. fastjson. JSON; import com. ecp. web. dictionary. business. dictionaryManager; import com. hzdracomsoft. base. baseAction; import com. hzdracomsoft. common. logUtil; import com. hzdracomsoft. javabean. dictionary;/***** obtain Dictionary table information * @ author ZhuangZi * @ version $ Id: DictionaryAction. java, v 0.1 10:55:53 ZhuangZi Exp $ */public class DictionaryAction extends BaseAction {private static LogUtil log = LogUtil. getInstance (DictionaryAction. class); private DictionaryManager dictionaryManager; private Dictionary dictionary; private List <Dictionary> listDictionary; private String Id;/***** obtain channel information **/public void listChannel () {String json = ""; try {listDictionary = dictionaryManager. handleListChannel (); json = JSON. toJSONString (listDictionary); HttpServletResponse response = ServletActionContext. getResponse (); response. setContentType ("text/html"); response. setCharacterEncoding ("UTF-8"); PrintWriter out; out = response. getWriter (); out. println (json); out. flush (); out. close ();} catch (Exception e) {log. error (e) ;}/ ***** get version information **/public void listVersion2 () {String json = ""; try {listDictionary = dictionaryManager. handleListVersion (Id); json = JSON. toJSONString (listDictionary); HttpServletResponse response = ServletActionContext. getResponse (); response. setContentType ("text/html"); response. setCharacterEncoding ("UTF-8"); PrintWriter out; out = response. getWriter (); out. println (json); out. flush (); out. close ();} catch (Exception e) {log. error (e) ;}}/***** get the downloaded package table information * @ return */public void listPackage () {String json = ""; try {listDictionary = dictionaryManager. handleListPackage (Id); json = JSON. toJSONString (listDictionary); HttpServletResponse response = ServletActionContext. getResponse (); response. setContentType ("text/html"); response. setCharacterEncoding ("UTF-8"); PrintWriter out; out = response. getWriter (); out. println (json); out. flush (); out. close ();} catch (Exception e) {log. error (e) ;}} public Dictionary getDictionary () {return dictionary;} public void setDictionary (Dictionary dictionary) {this. dictionary = dictionary;} public List <Dictionary> getListDictionary () {return listDictionary;} public void setListDictionary (List <Dictionary> listDictionary) {this. listDictionary = listDictionary;} public DictionaryManager getDictionaryManager () {return dictionaryManager;} public void setDictionaryManager (DictionaryManager dictionaryManager) {this. dictionaryManager = dictionaryManager;} public String getId () {return Id;} public void setId (String id) {Id = id ;}}