struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Qin <p...@shareowner.com>
Subject RE: URLConnection and struts
Date Tue, 29 Apr 2003 22:12:46 GMT
I wish my problem is relating to the error/exception. But I don't see
error/exception at all. The page generated is stored in the InputStream. The
question is how do I dump the result to the browser instead of the
InputStream?

-----Original Message-----
From: Durham David Cntr 805 CSS/SCBE [mailto:David.Durham1@scott.af.mil] 
Sent: April 29, 2003 4:59 PM
To: Struts Users Mailing List
Subject: RE: URLConnection and struts

I had a problem similar to this.  I had something like:

    <action path="/SomeAction"
            type="actions.SomeAction"
            name="someForm"
            scope="request">

            <forward name="failure" path="/pages/someForm.jsp"/>
            <forward name="success" path="/pages/viewSomeData.jsp"/>

    </action>

someForm was failing validation and there was no input specified, so I got a
blank page.  I solved the problem by adding  validate="false"  to the
<action>.

I'm not sure that this matches your problem, but it seemed similar enough to
warrant a post.


Dave




> -----Original Message-----
> From: Phillip Qin [mailto:pqin@shareowner.com]
> Sent: Tuesday, April 29, 2003 3:23 PM
> To: 'struts-user@jakarta.apache.org'
> Subject: URLConnection and struts
> 
> 
> I am trying to use URLConnection to POST data to a remote site.
> 
> Browser: onlinestore/order.jsp Submit button -> waitform.jsp
> 
> waiform.jsp: <meta http-equiv="refresh" content="1; 
> url=placeOrder.do">
> 
> placeOrderAction:
> URL url = new URL("http://localhost/onlinetore/post.do") ;
> URLConnection = url.openConnection() ;
> get OutputStream;
> write data
> get InputStream......
> return null ;
> 
> postAction:
> get request parameters, order data......
> response.sendRedirect("congratulation.do?status=whatever&time=
> whenever") ;
> return null ;
> 
> congratulationAction:
> get request parameters, status and time
> email user
> write log
> return forward success -> congratulation.jsp
> 
> I was expecting to see the congratulation page. But I only 
> get a blank page.
> However, by reading from InputStream, I find the page that 
> was generated by
> the congratulationAction.
> 
> Am I doing anything wrong with struts Action?
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message