Re: Problem with findForward(null) (Struts 1.1)

2007-10-24 Thread Antonio Petrelli
2007/10/24, Himstedt, Maik (EXTERN: T-Systems on) <
[EMAIL PROTECTED]>:
>
> return findForward(null);
> ...
> Debug shows that the code in the action method is executed, but the
> browser shows an empty page after executing the action. I would expect
> that simple nothing would happen (as the real download functionality/the
> response) isn't implemented yet.


It's perfectly normal! Since you are forwarding to nothing, a response MUST
be sent to the client, and it is a default response (no content, but the
HTTP headers are present).

To be more precise, I'd expect the
> browser to show the search mask and the result still.



Do you mean that you expected that the original page is still present after
that request?
This is true, if the file is not HTML, plain text, and other formats that
are directly interpretable by the browser.
If you put in the response, say, a "zip" file, your browser will ask you to
save/open it (possibly you have to set the "Content-disposition" HTTP header
parameter).

Antonio


Re: Problem with findForward(null) (Struts 1.1)

2007-10-24 Thread Dave Newton
"Himstedt, Maik (EXTERN: T-Systems on)" wrote:
>return findForward(null);

This might work, but IIRC you should just return null if you're handling the 
result yourself.

> Debug shows that the code in the action 
> method is executed, but the browser shows 
> an empty page after executing the action.

You've submitted a form--this is standard browser behavior. If you want to 
submit a form without refreshing the entire page you'd probably want to use 
Ajax.

d.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with findForward(null) (Struts 1.1)

2007-10-24 Thread Himstedt, Maik (EXTERN: T-Systems on)
Hi,

I have an action that is to accomplish three things: searching for
protocols, download a single protocol, deleting a single protocol. When
downloading a protocol no new page etc. has to be accessed because I
handle the response by myself.

So my action contains the following:

if(!protocolForm.getProtocolIdDownload().trim().equals("")) {
// the user clicked to download a protocol
String protocolToDownload = protocolForm.getProtocolIdDownload();
logger.debug("User wants to download protocol with ID: " +
protocolToDownload);
// we have to clear the appropriate field to avoid "cached" fields
protocolForm.setProtocolIdDownload("");
ProtocolFileData fileData =
getProtocolService().downloadProtocol(protocolToDownload);
   
return findForward(null);
}

struts-config.xml contains:

...



...



Debug shows that the code in the action method is executed, but the
browser shows an empty page after executing the action. I would expect
that simple nothing would happen (as the real download functionality/the
response) isn't implemented yet. To be more precise, I'd expect the
browser to show the search mask and the result still. The server logs
don't show anything related. Did I misconfigure anything? Just as a
reminder, I (have to) use Struts 1.1.

Regards,

Maik

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]