1 package org.apache.jsp; 2 3 import javax.servlet.*; 4 import javax.servlet.http.*; 5 import javax.servlet.jsp.*; 6 import org.apache.jasper.runtime.*; 7 8 public class getPublicationXml_jsp extends HttpJspBase { 9 10 11 private static java.util.Vector _jspx_includes; 12 13 public java.util.List getIncludes() { 14 return _jspx_includes; 15 } 16 17 public void _jspService(HttpServletRequest request, HttpServletResponse response) 18 throws java.io.IOException , ServletException { 19 20 JspFactory _jspxFactory = null; 21 javax.servlet.jsp.PageContext pageContext = null; 22 HttpSession session = null; 23 ServletContext application = null; 24 ServletConfig config = null; 25 JspWriter out = null; 26 Object page = this; 27 JspWriter _jspx_out = null; 28 29 30 try { 31 _jspxFactory = JspFactory.getDefaultFactory(); 32 response.setContentType("text/html;charset=ISO-8859-1"); 33 pageContext = _jspxFactory.getPageContext(this, request, response, 34 null, true, 8192, true); 35 application = pageContext.getServletContext(); 36 config = pageContext.getServletConfig(); 37 session = pageContext.getSession(); 38 out = pageContext.getOut(); 39 _jspx_out = out; 40 41 42 response.setContentType("text/xml"); 44 String sPublicationId = request.getParameter("id"); 45 int iVersion = Integer.parseInt(request.getParameter("version")); 46 47 String sXml = ""; 48 49 if( request.getSession().getAttribute("currentXml")==null ) { 50 51 org.nextime.ion.framework.business.Publication oPublication = null; 52 try { 53 org.nextime.ion.framework.mapping.Mapping.begin(); 54 oPublication = org.nextime.ion.framework.business.Publication.getInstance(sPublicationId); 55 } catch( Exception e ) { 56 e.printStackTrace(); 58 } finally { 59 org.nextime.ion.framework.mapping.Mapping.rollback(); 61 } 62 63 sXml = oPublication.getVersion(iVersion).getDataAsString(); 66 67 } else { 68 69 sXml = request.getSession().getAttribute("currentXml")+""; 70 request.getSession().removeAttribute("currentXml"); 71 } 72 73 sXml = sXml.substring( sXml.indexOf("<publication") ); 74 75 sXml = sXml.replaceAll("ion:lang","xml:lang"); 77 78 sXml = sXml.replaceAll("€",""); 80 81 System.out.println(sXml); 82 83 out.write("\r\n\r\n"); 84 out.write("\r\n"); 85 out.print(sXml); 86 } catch (Throwable t) { 87 out = _jspx_out; 88 if (out != null && out.getBufferSize() != 0) 89 out.clearBuffer(); 90 if (pageContext != null) pageContext.handlePageException(t); 91 } finally { 92 if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext); 93 } 94 } 95 } 96 | Popular Tags |