getConstants.jsp 846 B

12345678910111213141516171819202122232425
  1. <%@ page contentType="text/html; charset=UTF-8" language="java"%>
  2. <%@ page
  3. import ="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  4. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  5. com.sysmodel.datamodel.xmlmodel.able.*,
  6. java.util.*"
  7. %>
  8. <%
  9. SysModel sysmodel = ModelFactory.getSysmodel();
  10. ArrayList constants = null;
  11. String type= request.getParameter("type") == null ? "" : request.getParameter("type");
  12. if(type.equals("")){
  13. constants = sysmodel.getMdpConstants();
  14. } else {
  15. constants = sysmodel.getMdpConstantByType(type);
  16. }
  17. out.print("<root>");
  18. for (int i = 0; i < constants.size(); i++) {
  19. MdpConstant MdpConstant = (MdpConstant) constants.get(i);
  20. out.print("<classid>"+MdpConstant.getCodeName()+"</classid>");
  21. out.print("<description>"+MdpConstant.getDescription()+"</description>");
  22. }
  23. out.print("</root>");
  24. %>