首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

XML处置bak

2012-09-03 
XML处理bak%int subjectid ParamUtil.getInteger(request, subjectid, -1)int templateId ParamUt

XML处理bak

<%
int subjectid = ParamUtil.getInteger(request, "subjectid", -1);
int templateId = ParamUtil.getInteger(request, "templateId", -1);
if (subjectid == -1) {
??out.println("无效参数!");
??return;
?}
SubjectContent11Manager subjectManager = (SubjectContent11Manager) WebAppContextUtil.getBean(application, "subjectContent11Manager");
SubjectContent11 subjectContent = subjectManager.getSubjectContent11(new Integer(subjectid));
if (subjectContent == null) {
??out.println("无效参数!");
??return;
?}
???Document doc = null;
???InputStream input = null;
???try {
????input = new ByteArrayInputStream(subjectContent.getContent().getBytes("gbk"));
???} catch (UnsupportedEncodingException uee) {
????input = new ByteArrayInputStream(subjectContent.getContent().getBytes());
???}
???SAXBuilder builder = new SAXBuilder();
???try {
????doc = builder.build(input);
???} catch (IOException ioe) {
????doc = null;
???} catch (JDOMException jdome) {
????doc = null;
???}
???if (doc == null) {
????throw new IOException("failed to parse the input stream");
???}
???Element root = doc.getRootElement();
???String InsertedContent = SubjectUtil.showInsertedContent(root);
???String InsertedCss = SubjectUtil.showInsertedCss(root);
%>

热点排行