error submitting xform to jsp

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

error submitting xform to jsp

Miguel Angel Tinte Garcia
Hi everybody,

My problem is that I am trying communicate two jsp's: one of them makes
the post and another receives the data and shows it in the browser but
it doesn't work.  

The flow of the execution could be something like this:

user --> input data --> index.jsp --> submit data instance --> test.jsp
--> output data

This is the model and instance of the the index.jsp:

        <xforms:model id="data-model">
                <xforms:instance id="data-instance">
                        <data>
                                <user>name</user>
                                <password>password</password>
                        </data>
                </xforms:instance>
                <xforms:submission id="login"
                                   method="urlencoded-post"
                                   action="xforms-jsp/test.jsp"
                    ref="instance('data-instance')"/>
        </xforms:model>


And this is the submit of index.jsp:

<xforms:input ref="/data/user">
        <xforms:label>User: </xforms:label>
</xforms:input>  
<xforms:secret ref="/data/password">
        <xforms:label>Password: </xforms:label>
</xforms:secret>  
<xforms:submit submission="login">
        <xforms:label>Enviar</xforms:label>
</xforms:submit>


And this is how I try to take the data in test.jsp:
                <%
                String username = "";
                String password = "";
                String error = "";
                if ("POST".equals(request.getMethod())) {
                        username = request.getParameter("user");
                        password = request.getParameter("password");
                %>

What am I doing wrong?? Thanks in advance

Best regards

--
Miguel Ángel Tinte García        
Libre Software Engineering Lab (GSyC)  | Universidad Rey Juan Carlos
[hidden email]        
http://libresoft.urjc.es/   



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: error submitting xform to jsp

Alessandro Vernet
Administrator
Miguel,

On Feb 23, 2009, at 1:53 AM, Miguel Angel Tinte Garcia wrote:

> My problem is that I am trying communicate two jsp's: one of them  
> makes
> the post and another receives the data and shows it in the browser but
> it doesn't work.

I tried this and the submission with method="urlencoded-post" is  
working fine. You can see an example that runs in the XForms sandbox  
here:

http://pastie.org/398284

You can actually see it in action with the (old) version of the  
sandbox we have deployed:

http://www.orbeon.com/ops/xforms-sandbox/run?url=http://pastie.org/ 
398284.txt

Have you checked if the request parameters are getting transmitted to  
the test.jsp?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws