[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Passing xml into a JSP page

Subject: Re: Passing xml into a JSP page
From: "Steve Muench" <smuench@xxxxxxxxxxxxx>
Date: Thu, 27 Jan 2000 17:22:04 -0800
jsp xmldom
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.