[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: Passing xml into a JSP page
Subject: RE: Passing xml into a JSP page From: "Paul Beer" <paul.beer@xxxxxxxxxxxx> Date: Fri, 28 Jan 2000 09:54:36 -0500 |
I am getting a variable initialization error when I try to do this .... I dont think I understood your code suggestion well enough... could someone please look at this code and tell me why I get the error posted below ? <%@ page import="org.apache.xalan.xslt.XSLTProcessor"%> <%@ page import="org.apache.xalan.xslt.XSLTResultTarget"%> <%@ page import="org.apache.xalan.xslt.XSLTInputSource"%> <%@ page import="org.apache.xalan.xslt.XSLTProcessorFactory" %> <%@ page import="org.xml.sax.SAXException"%> <% String New_val = request.getParameter("packet"); java.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream(bais.getBytes()); org.xml.sax.InputSource is = new org.xml.sax.InputSource(bais); XSLTInputSource inputXML = new XSLTInputSource(New_val); XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); processor.process(new XSLTInputSource(inputXML),new XSLTInputSource("wddx.xsl"),new XSLTResultTarget(out)); %> 500 Internal Server Error Java Server Page Translation Error Error during compilation : D:\Java\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_xml\_convert.java:8 2: Variable bais may not have been initialized. java.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream(bais.getBytes()); ^ D:\Java\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_xml\_convert.java:8 2: Method getBytes() not found in class java.io.ByteArrayInputStream. java.io.ByteArrayInputStream bais = new java.io.ByteArrayInputStream(bais.getBytes()); ^ 2 errors _____________________________________ Paul Beer Backsoft Corporation paul.beer@xxxxxxxxxxxx http://www.backsoft.com (888) 222-6047 Phone 'e-business solutions' -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Steve Muench Sent: Thursday, January 27, 2000 8:22 PM To: xsl-list@xxxxxxxxxxxxxxxx Cc: JSP-INTEREST@JAVA. SUN. COM Subject: Re: Passing xml into a JSP page Paul, Passing a string to new InputSource() expects the string to represent an URL. What you want to do is: <% String New_val = request.getParameter("packet"); ByteArrayInputStream bais = new ByteArrayInputStream(bais.getBytes()); InputSource is = new InputSource(bais); : %> This will feed the XML document in a string as an InputStream _________________________________________________________ Steve Muench, Consulting Product Manager & XML Evangelist Business Components for Java Development Team ----- Original Message ----- From: "Paul Beer" <paul.beer@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxx> Cc: "JSP-INTEREST@JAVA. SUN. COM" <JSP-INTEREST@xxxxxxxxxxxx> Sent: Thursday, January 27, 2000 3:08 PM Subject: Passing xml into a JSP page | I am trying to pass an xml packet to a JSP page via http form posting. The | code below worked when I referenced a txt files on my local hard drive, but | fail when I try passing a string as input ..... can anyone help w/this ? Is | there some other way to re-define the xml object ? the eror is obviously | telling me the compiler is looking for a file instead of a string value... I | dont see any examples like this in the lotus xsl documentation though .... | | <%@ page import="org.apache.xalan.xslt.XSLTProcessor"%> | <%@ page import="org.apache.xalan.xslt.XSLTResultTarget"%> | <%@ page import="org.apache.xalan.xslt.XSLTInputSource"%> | <%@ page import="org.apache.xalan.xslt.XSLTProcessorFactory" %> | <%@ page import="org.xml.sax.SAXException"%> | <%String New_val = request.getParameter("packet");%> | <% | XSLTInputSource inputXML = new XSLTInputSource(New_val); | XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); | processor.process(new XSLTInputSource(inputXML),new | XSLTInputSource("wddx.xsl"),new XSLTResultTarget(out)); | %> | | | | | thanks, | paul | | | here is the error : | | Error during JSP page processing | File "file:/D:/Java/JavaWebServer2.0/110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000530789709708The Cold Fusion Web Database | Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000530789709708The Cold Fusion Web Database | Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.95000000001110000000004Tabloid | DreamsHoltRobert OlenButler190416.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.95000000001110000000004Tabloid | DreamsHoltRobert OlenButler190416.95000000001200878166165Best Of | ...DougAllen000.0000000000" not found. | at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1443) | at | org.apache.xalan.xslt.XSLTEngineImpl.getSourceTreeFromInput(XSLTEngineImpl.j | ava:799) | at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, | Compiled Code) | at pagecompile.jsp._xml._convert._jspService(_convert.java:87) | at | com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(HttpJspBase. | java:87) | at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet | .java:469) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspSer | vlet.java:259) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(JspServlet.ja | va:97) | at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) | at com.sun.server.ServletState.callService(ServletState.java:226) | at com.sun.server.ServletManager.callServletService(ServletManager.java, | Compiled Code) | at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java, | Compiled Code) | at | com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java, | Compiled Code) | at com.sun.server.http.stages.Runner.process(Runner.java, Compiled Code) | at com.sun.server.ProcessingSupport.process(ProcessingSupport.java, | Compiled Code) | at com.sun.server.Service.process(Service.java, Compiled Code) | at | com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java | , Compiled Code) | at | com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java | , Compiled Code) | at com.sun.server.HandlerThread.run(HandlerThread.java:162) | --------- | File "file:/D:/Java/JavaWebServer2.0/110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000530789709708The Cold Fusion Web Database | Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.9500000000110899664784Moby | DickBuccaneer BooksHermanMelville250085.9500000000220345391802The | Hitchhiker's Guide to the GalaxyBallantine | BooksDouglasAdams17559.9500000000320517545357The Restaurant at the End of | the UniverseHarmony BooksDouglasAdams20209.9500000000420345391829Life, the | Universe and EverythingBallantine | BooksDouglasAdams219310.9500000000530789709708The Cold Fusion Web Database | Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.95000000001110000000004Tabloid | DreamsHoltRobert OlenButler190416.9500000000110899664784Moby DickBuccaneer | BooksHermanMelville250085.9500000000220345391802The Hitchhiker's Guide to | the GalaxyBallantine BooksDouglasAdams17559.9500000000320517545357The | Restaurant at the End of the UniverseHarmony | BooksDouglasAdams20209.9500000000420345391829Life, the Universe and | EverythingBallantine BooksDouglasAdams219310.9500000000530789709708The Cold | Fusion Web Database Construction KitQue Education & | TrainingBenForta7871259.9500000000630789702517Special Edition Using Windows | NT Server 4Que Education & | TrainingRogerJennings991549.9500000000730000000000Using ASP For Unknown | ReasonsMicrosoft PressBillGates45500029.9500000000810000000001The Armies Of | The NightPenguinNormanMailer350215.9500000000910000000002The Dead | FatherHarperCollinsDonaldBarthelme1501220.95000000001010000000003Sabbath's | TheaterVintagePhilipRoth4003212.95000000001110000000004Tabloid | DreamsHoltRobert OlenButler190416.95000000001200878166165Best Of | ...DougAllen000.0000000000" not found. | at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1255) | at | org.apache.xerces.framework.XMLParser.startReadingFromDocument(XMLParser.jav | a:2344) | at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:351) | at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1137) | at org.apache.xalan.xpath.dtm.DTMLiaison.parse(DTMLiaison.java:198) | at | org.apache.xalan.xslt.XSLTEngineImpl.getSourceTreeFromInput(XSLTEngineImpl.j | ava:785) | at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, | Compiled Code) | at pagecompile.jsp._xml._convert._jspService(_convert.java:87) | at | com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(HttpJspBase. | java:87) | at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet | .java:469) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspSer | vlet.java:259) | at | com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(JspServlet.ja | va:97) | at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) | at com.sun.server.ServletState.callService(ServletState.java:226) | at com.sun.server.ServletManager.callServletService(ServletManager.java, | Compiled Code) | at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java, | Compiled Code) | at | com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java, | Compiled Code) | at com.sun.server.http.stages.Runner.process(Runner.java, Compiled Code) | at com.sun.server.ProcessingSupport.process(ProcessingSupport.java, | Compiled Code) | at com.sun.server.Service.process(Service.java, Compiled Code) | at | com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java | , Compiled Code) | at | com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java | , Compiled Code) | at com.sun.server.HandlerThread.run(HandlerThread.java:162) | | | | | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Passing xml into a JSP page, Steve Muench | Thread | Re: Passing xml into a JSP page, Dave Carlson |
RE: Documented XSLT implentation in, Julian Reschke | Date | Instructor-led XSLT/XPath Training , G. Ken Holman |
Month |