jsp页面上如何生成xml
2014-01-31
展开全部
当字符串输出了
out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
out.println("<beans xmlns=\"http://www.springframework.org/schema/beans\" ");
out.println(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
out.println(" xmlns:p=\"http://www.springframework.org/schema/p\" ");
out.println(" xsi:schemaLocation=\"http://www.springframework.org/schema/beans ");
out.println("http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\">");
out.println(" <bean id=\"dept\" class=\"first.Dept\" >");
out.println(" <property name=\"name\" value=\"小猫\" />");
out.println(" <property name=\"age\">");
out.println(" <value>30</value>");
out.println(" </property>");
out.println(" </bean>");
out.println("</beans>");
out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
out.println("<beans xmlns=\"http://www.springframework.org/schema/beans\" ");
out.println(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
out.println(" xmlns:p=\"http://www.springframework.org/schema/p\" ");
out.println(" xsi:schemaLocation=\"http://www.springframework.org/schema/beans ");
out.println("http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\">");
out.println(" <bean id=\"dept\" class=\"first.Dept\" >");
out.println(" <property name=\"name\" value=\"小猫\" />");
out.println(" <property name=\"age\">");
out.println(" <value>30</value>");
out.println(" </property>");
out.println(" </bean>");
out.println("</beans>");
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询