how to retrieve the X-form instance in jsp after submission.

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

how to retrieve the X-form instance in jsp after submission.

garima.singh
Hi All !!

I am trying to submit the xform instance to a jsp , which i have deployed on tomcat.
The < submission > tag is as follows :

<xforms:submission id="xxx" method="post"
action="http://localhost:8080/jsp-examples/cal/dummy.jsp"/>

where dummy.jsp is the jsp where instance has to be submitted.

On click of submit button, dummy.jsp is displayed, on internal web browser of orbeon , but, can some one let me know, how will i retrieve the submitted xform instance in the jsp.??

Thanks in advance!!
Regards,
Garima



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to retrieve the X-form instance in jsp after submission.

Alessandro  Vernet
Administrator
Hi Garmina,

Using dom4j, you can retrieve the submitted XML instance with:

<%@ page import="org.dom4j.io.SAXReader"%>
<%@ page import="org.dom4j.Document"%>

SAXReader xmlReader = new SAXReader();
Document document = xmlReader.read(request.getInputStream());

Then you can use the dom4j API to extract the information you are
interested in from "document".

Alex

On 7/6/06, [hidden email]
<[hidden email]> wrote:

> Hi All !!
>
> I am trying to submit the xform instance to a jsp , which i have deployed on tomcat.
> The < submission > tag is as follows :
>
> <xforms:submission id="xxx" method="post"
> action="http://localhost:8080/jsp-examples/cal/dummy.jsp"/>
>
> where dummy.jsp is the jsp where instance has to be submitted.
>
> On click of submit button, dummy.jsp is displayed, on internal web browser of orbeon , but, can some one let me know, how will i retrieve the submitted xform instance in the jsp.??
>
> Thanks in advance!!
> Regards,
> Garima
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: how to retrieve the X-form instance in jsp after submission.

garima.singh
Hi Alex ,

Thanks for the response . Can you please let me know, what all dom4j jars will i need to download and also the steps for installing DOM4j.I was trying to locate the same at http://www.dom4j.org/
but not getting the appropriate link..

Please suggest..
Regards,
garima



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to retrieve the X-form instance in jsp after submission.

Erik Bruchez
Administrator
Garima,

dom4j is already included with OPS. If you JSP is the same WAR (webapp)
as the rest of OPS, you can directly use dom4j and there is nothing to
download or install.

If your JSP is in a different webapp, just copy over the OPS dom4j JAR
(dom4j-1_6_1.jar) to your other webapp's WEB-INF/lib.

-Erik

[hidden email] wrote:
> Hi Alex ,
>
> Thanks for the response . Can you please let me know, what all dom4j jars will i need to download and also the steps for installing DOM4j.I was trying to locate the same at http://www.dom4j.org/
> but not getting the appropriate link..
>
> Please suggest..
> Regards,
> garima

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: how to retrieve the X-form instance in jsp after submission.

garima.singh
Hi All!!
I am trying to retrieve the submitted xml document in  a jsp.This jsp,  i have deployed on tomcat server . I have placed dom4j-1_4_orbeon.jar in the WEB-INF/lib folder present inside webapps\jsp-examples.I have pasted the following code segment in my jsp,


<%@page import="org.dom4j.io.SAXReader"%>
<%@page import="org.dom4j.Document"%>
SAXReader xmlReader=new SAXReader();
Document document=xmlReader.read(request.getInputStream());

<% out.print("Document in out print----------->"+document);%>

but, when i try to run the application,
i get an error in the jsp . cannot find symbol
symbol  : variable document

Do i need to do some classpath settings?

Pls suggest..
Thanks in advance !!
Regards,
Garima Singh



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to retrieve the X-form instance in jsp after submission.

Erik Bruchez
Administrator
Garima,

In JSP, all your scriptlets must be enclosed within <% and %>. This
includes your xmlReader and document variables.

-Erik

[hidden email] wrote:

> Hi All!!
> I am trying to retrieve the submitted xml document in  a jsp.This jsp,  i have deployed on tomcat server . I have placed dom4j-1_4_orbeon.jar in the WEB-INF/lib folder present inside webapps\jsp-examples.I have pasted the following code segment in my jsp,
>
>
> <%@page import="org.dom4j.io.SAXReader"%>
> <%@page import="org.dom4j.Document"%>
> SAXReader xmlReader=new SAXReader();
> Document document=xmlReader.read(request.getInputStream());
>
> <% out.print("Document in out print----------->"+document);%>
>
> but, when i try to run the application,
> i get an error in the jsp . cannot find symbol
> symbol  : variable document
>
> Do i need to do some classpath settings?
>
> Pls suggest..
> Thanks in advance !!
> Regards,
> Garima Singh
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: how to retrieve the X-form instance in jsp after submission.

garima.singh
oops....that was indeed a silly mistake !!
Thanks Eric , for the response....!
my problem , at present is that when i try to run the application , i get an error in the jsp like:

Content is not allowed in prolog
i noticed that i did not add the header

<?xml version=\"1.0\" encoding=\"UTF-8\"?>

but when i added the same, the xml is not getting validated.I get an error like:
The processing instruction [xX][mM][lL] is not allowed.I searched the error in google and i guess, it could be because of some blank lines before the prolog....but i am not sure !!

The xml is as follows:


<!--
    Copyright (C) 2004 Orbeon, Inc.
 
    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.
 
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.
 
    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
-->
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:s="http://www.w3.org/2002/xforms/controls"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xforms:instance>
        <?xml version=\"1.0\" encoding=\"UTF-8\"?>
        <masterdatarequest>
            <requestidentification>
            <externalsystemid>200200005</externalsystemid>
            <referenceno>2345</referenceno>
            <sessionid>20045678</sessionid>
            </requestidentification>
            <requestdetails>
            <txncode>M</txncode>
            <requestsenddatetime>20051107194536</requestsenddatetime>
            <userlanguagecode>EN</userlanguagecode>
            <masterId>100</masterId>
            <returnResponse>D</returnResponse>
            <strUrl>"http://localhost:8080/FinnoneMasterRequest"</strUrl>
            <date/>
            <time/>  
            </requestdetails>
         </masterdatarequest>
    </xforms:instance>
    <xforms:bind nodeset="/form/masterId" constraint="number(.) >= 0"/>
    <xforms:bind nodeset="/form/date" type="xs:date"/>
    <xforms:bind nodeset="/form/time" type="xs:time"/>
   
    <xforms:submission id="xxx" method="post"
                 action="http://10.0.54.55:8080/jsp-examples/xml/1.jsp"/>
   

</xforms:model>

Thanks in advance!!
Regards,
Garima




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to retrieve the X-form instance in jsp after submission.

Erik Bruchez
Administrator
Garima,

You have this lines:

<xforms:instance>
   <?xml version=\"1.0\" encoding=\"UTF-8\"?>
   ...

This is an XML declaration. Since you put it in the middle of the
document, it is interpreted as an XML processing instructions. Those
cannot have names starting with "xml", hence the error.

So get rid of that XML declaration in the middle of the file, and put a
correct XML declaration at the top of your XML document instead:

   <?xml version="1.0" encoding="UTF-8"?>

Also note that there are no backslashes before the quotes (i.e. write
'"', not '\"').

-Erik

[hidden email] wrote:

> oops....that was indeed a silly mistake !!
> Thanks Eric , for the response....!
> my problem , at present is that when i try to run the application , i get an error in the jsp like:
>
> Content is not allowed in prolog
> i noticed that i did not add the header
>
> <?xml version=\"1.0\" encoding=\"UTF-8\"?>
>
> but when i added the same, the xml is not getting validated.I get an error like:
> The processing instruction [xX][mM][lL] is not allowed.I searched the error in google and i guess, it could be because of some blank lines before the prolog....but i am not sure !!
>
> The xml is as follows:
>
>
> <!--
>     Copyright (C) 2004 Orbeon, Inc.
>  
>     This program is free software; you can redistribute it and/or modify it under the terms of the
>     GNU Lesser General Public License as published by the Free Software Foundation; either version
>     2.1 of the License, or (at your option) any later version.
>  
>     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
>     without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>     See the GNU Lesser General Public License for more details.
>  
>     The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
> -->
> <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms"
>     xmlns:s="http://www.w3.org/2002/xforms/controls"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xforms:instance>
>         <?xml version=\"1.0\" encoding=\"UTF-8\"?>
>         <masterdatarequest>
>             <requestidentification>
>             <externalsystemid>200200005</externalsystemid>
>             <referenceno>2345</referenceno>
>             <sessionid>20045678</sessionid>
>             </requestidentification>
>             <requestdetails>
>             <txncode>M</txncode>
>             <requestsenddatetime>20051107194536</requestsenddatetime>
>             <userlanguagecode>EN</userlanguagecode>
>             <masterId>100</masterId>
>             <returnResponse>D</returnResponse>
>             <strUrl>"http://localhost:8080/FinnoneMasterRequest"</strUrl>
>             <date/>
>             <time/>  
>             </requestdetails>
>          </masterdatarequest>
>     </xforms:instance>
>     <xforms:bind nodeset="/form/masterId" constraint="number(.) >= 0"/>
>     <xforms:bind nodeset="/form/date" type="xs:date"/>
>     <xforms:bind nodeset="/form/time" type="xs:time"/>
>    
>     <xforms:submission id="xxx" method="post"
>                  action="http://10.0.54.55:8080/jsp-examples/xml/1.jsp"/>
>    
>
> </xforms:model>
>
> Thanks in advance!!
> Regards,
> Garima
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: how to retrieve the X-form instance in jsp after submission.

garima.singh
Thanks Erik, for a quick response!! The '[xX][mM][lL] processing instruction is not allowed' ,error was resolved when i placed the correct XML declaration

<?xml version="1.0" encoding="utf-8"?>

at top of the xml document.
but when i try to run the application, i get an exception like :

javax.servlet.ServletException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.

with root cause:

org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.

Can u please suggest the probable reason for the same ??

Thanks in advance!!
Regards,
Garima Singh




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

error msg:Content is not allowed in prolog

garima.singh
Hi All !!

This is in continuation to my previous problem regarding retrieving the X-form instance in jsp after submission .Sorry ,  I missed to copy the stacktrace in my earlier post....When i try to run my xml application in OPS, I get an exception :
javax.servlet.ServletException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.

with root cause :
org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
        org.dom4j.io.SAXReader.read(SAXReader.java:355)
        org.dom4j.io.SAXReader.read(SAXReader.java:261)
        org.apache.jsp.xml._1_jsp._jspService(_1_jsp.java:78)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I have posted this problem in DOM4j user list also, and got a suggestion that it could be an issue related to underlying Sax parser being used in Orbeon ....

Can anyone suggest something in this regard ?

Thanks in advance !!
Regards,
Garima




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: error msg:Content is not allowed in prolog

Adrian Baker-2
So it seems that this line

    Document document=xmlReader.read(request.getInputStream());

is throwing a parse error.

Trying seeing what request.getInputStream() contains, either with a debugger or System.outs.

Adrian

[hidden email] wrote:
Hi All !!

This is in continuation to my previous problem regarding retrieving the X-form instance in jsp after submission .Sorry ,  I missed to copy the stacktrace in my earlier post....When i try to run my xml application in OPS, I get an exception :
javax.servlet.ServletException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.

with root cause :
org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
	org.dom4j.io.SAXReader.read(SAXReader.java:355)
	org.dom4j.io.SAXReader.read(SAXReader.java:261)
	org.apache.jsp.xml._1_jsp._jspService(_1_jsp.java:78)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I have posted this problem in DOM4j user list also, and got a suggestion that it could be an issue related to underlying Sax parser being used in Orbeon ....

Can anyone suggest something in this regard ?

Thanks in advance !!
Regards,
Garima


  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: error msg:Content is not allowed in prolog

garima.singh
In reply to this post by garima.singh
Hi Adrian !!

Thanks for the so quick response !
yes, indeed the error is because of this line.
Document document=xmlReader.read(request.getInputStream());

Following is the code segment from my jsp:

<%@page import="org.dom4j.io.SAXReader"%>
<%@page import="org.dom4j.Document"%>
<%SAXReader xmlReader=new SAXReader();
Document document=xmlReader.read(request.getInputStream());%>


<%out.print("INPUTSTREAM----->"+request.getInputStream());%>
displays the following input stream on jsp:

org.apache.coyote.tomcat5.CoyoteInputStream@11d3226

Can you please suggest further .... i don't have much of idea regarding dom4j and SAX parser...

Thanks in advance!!
Regards,
Garima








--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: error msg:Content is not allowed in prolog

Adrian Baker-2
Dom4j is failing when trying to parse the *contents* of that input stream - you need to find out what it contains.

Just doing calling toString on an input stream won't tell you what's in it, which is why you just get that object reference. Try doing a google for converting an InputStream to a string.

Adrian

[hidden email] wrote:
Hi Adrian !!

Thanks for the so quick response !
yes, indeed the error is because of this line.
Document document=xmlReader.read(request.getInputStream());

Following is the code segment from my jsp:

<%@page import="org.dom4j.io.SAXReader"%>
<%@page import="org.dom4j.Document"%>
<%SAXReader xmlReader=new SAXReader();
Document document=xmlReader.read(request.getInputStream());%>


<%out.print("INPUTSTREAM----->"+request.getInputStream());%>
displays the following input stream on jsp:

org.apache.coyote.tomcat5.CoyoteInputStream@11d3226 

Can you please suggest further .... i don't have much of idea regarding dom4j and SAX parser...

Thanks in advance!!
Regards,
Garima






  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: error msg:Content is not allowed in prolog

garima.singh
In reply to this post by garima.singh
Hi Adrian !!

At the following link,
http://www.middleware.vt.edu/pubs/opensource/dsml/api/edu/vt/middleware/dsml/AbstractDsml.html

i found that :
outputToString method
public java.lang.String outputToString(org.dom4j.Document doc)

contained ,in class AbstractDsml ,in package edu.vt.middleware.ldap.dsml.util,
can be used to convert the supplied document to a string.
but,when i tried to import this package in jsp,
i get an error: package edu.vt.middleware.ldap.dsml.util does not exist

i have deployed my jsp on Tomcat server and
i have placed dom4j-1_4_orbeon.jar in the WEB-INF/lib folder of Tomcat .

Please suggest.
Regards,
Garima




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: error msg:Content is not allowed in prolog

Adrian Baker-2
Is the class with the method you're trying to invoke available on the classpath?

[hidden email] wrote:
Hi Adrian !!

At the following link, 
http://www.middleware.vt.edu/pubs/opensource/dsml/api/edu/vt/middleware/dsml/AbstractDsml.html

i found that :
outputToString method 
public java.lang.String outputToString(org.dom4j.Document doc)

contained ,in class AbstractDsml ,in package edu.vt.middleware.ldap.dsml.util,
can be used to convert the supplied document to a string. 
but,when i tried to import this package in jsp,
i get an error: package edu.vt.middleware.ldap.dsml.util does not exist

i have deployed my jsp on Tomcat server and
i have placed dom4j-1_4_orbeon.jar in the WEB-INF/lib folder of Tomcat .

Please suggest.
Regards,
Garima 


  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: error msg:Content is not allowed in prolog

garima.singh
Adrian ,
I tried a different way to convert the InputStream to String.I added the following code segment to my jsp:

<%InputStream in = request.getInputStream();
int k;
int aBuffSize = 1123123;
String StringFromWS="";
byte buff[] = new byte[aBuffSize];
OutputStream xOutputStream = new ByteArrayOutputStream(aBuffSize);
while ( (k=in.read(buff) ) != -1)
xOutputStream.write(buff,0,k);
StringFromWS = StringFromWS + xOutputStream.toString();
out.println(StringFromWS);%>

and i got some values displayed on jsp.

Here , i see that the values for textfields, which i entered , when i tried to run the xml application ,on OPS are being displayed in jsp, but not as a proper xml . I have kept two textfields in the application.
1.Master id
2.Response Flag
9999999999999999999 is the value which i entered for 'master id' textfield
GARIMA SINGH is the value which i entered for 'Response Flag' textfield
I can see both these values in the jsp , but rest of the content is encoded.

Value displayed on Jsp:

%24portlet%24p1.=&%24portlet%24p1.%24node%5EZn3PPZMQrxU%3D=9999999999999999999&%24portlet%24p1.%24node%5ETh8kKvOe86E%3D=GARIMA+SINGH&%24portlet%24a1.%24action%5E=Submit&%24portlet%24p1.%24instance=2yQnr8rDHZNI%2BigfzpH8%2FPzo9PjrFkVE7DBs1B5hGPjaYSdjuaqf%2FW3cforlEkKapqQJAV7y1fDl%0D%0AGzCJi5z9nWYfHU8IDjRZMD9A%2BOYewWnUXeb9iEIObpu%2Fpd3Pe09Kw3PK%2B0wdvogBCwofUL2gMcyF%0D%0AUwIzr5YuzZzvUfFgABoVQYS4VFywFdELE7EKQRW97HvXiyLWFFD3INrLfyw9y4tIS7XClApcC8zA%0D%0AqfqEanpTijNc4QR9QZTEdzrVZKeozUzJEK2yTUleDM3OWq%2FcN2%2BGTmo7IrtjPbDCQe2LNg8%3D&%24portlet%24p1.%24key=%2BTVpl%2FPf49H2FqI5cKzjNlUxg9d2PEMY&%24instance=AFZ0cgSxZ5dmr1sRs20ZqXMn2tAW5%2BefxxTcwZMkBUT9sayZJfCVd1ZYtv2yiCdcz59WNXAND4wP%0D%0AGLmlVNUztt3jLdk%2BCAcHh2DmL2yFOyaF060ds4lHEYdaOLgZLPlOBQ7up8hMYk%2Frh%2BoWU%2FxjjwtU%0D%0A13FdrRtXUrWbC8QlyQCb%2FwrdH0CINBNxZ9Yekn2bDI3WOkfkUdWN8wOXZsO2Xh0raHDJLHu5ql%2Bp%0D%0AFdaIcCsn7%2FLBiutoUNFoJPNCfyjJSr%2FnjJCXi2cEPqMPTfhFTo9sVABP8qJEstOTDmFFLoI%3D&%24key=5cxGbOgjMmfIUSX9SQ7WhM4NmVwOnfJk


Please suggest.
Thanks!!
garima



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: how to retrieve the X-form instance in jsp after submission.

Alessandro  Vernet
Administrator
In reply to this post by garima.singh
Hi Garmina,

And this exception is thrown in dom4j when you are parsing the
submitted XML from your JSP, is that right? Could you quote the first
20 lines of the exception stack trace?

Alex

On 7/10/06, [hidden email]
<[hidden email]> wrote:

> Thanks Erik, for a quick response!! The '[xX][mM][lL] processing instruction is not allowed' ,error was resolved when i placed the correct XML declaration
>
> <?xml version="1.0" encoding="utf-8"?>
>
> at top of the xml document.
> but when i try to run the application, i get an exception like :
>
> javax.servlet.ServletException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
>
> with root cause:
>
> org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
>
> Can u please suggest the probable reason for the same ??
>
> Thanks in advance!!
> Regards,
> Garima Singh
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: how to retrieve the X-form instance in jsp after submission.

garima.singh
Hi !!
Thanks for the response.Yes, i get this exception when i attempt parsing:
ie. on the line
Document document=xmlReader.read(request.getInputStream());

Following i8s the code segment from my jsp:
<%@page import="org.dom4j.io.SAXReader"%>
<%@page import="org.dom4j.Document"%>
<%SAXReader xmlReader=new SAXReader();
Document document=xmlReader.read(request.getInputStream());%>


I get an exception :
javax.servlet.ServletException: Error on line 1 of document : Content is not
allowed in prolog. Nested exception: Content is not allowed in prolog.

with root cause :
org.dom4j.DocumentException: Error on line 1 of document : Content is not
allowed in prolog. Nested exception: Content is not allowed in prolog.

org.dom4j.io.SAXReader.read(SAXReader.java:355)
org.dom4j.io.SAXReader.read(SAXReader.java:261)
org.apache.jsp.xml._1_jsp._jspService(_1_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Also, when i tried ,
out.println on (request.getInputStream), i notice that, values of the textfields which i enter is seen, but not in * proper xml format *.I have posted this problem separately ( yesterday ) with the subject 'Retrieving xml *in proper format* after submission of x-form instance'


Any suggestions please ??

Thanks in advance!!
Regards,
Garima Singh



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: how to retrieve the X-form instance in jsp after submission.

Alessandro  Vernet
Administrator
On 7/12/06, [hidden email]
<[hidden email]> wrote:
> Hi !!
> I have posted this problem separately ( yesterday ) with the subject
> 'Retrieving xml *in proper format* after submission of x-form instance'

OK, then I will follow-up on that thread.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet