struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Jones <>
Subject Question about File downlods and letting users save a downloaded file. I am losing the original file name.
Date Mon, 01 Mar 2004 09:42:22 GMT
My Problem is with the URL presented when i get prompted to save a file.
I am retreiving files/resources from a database and want to let the users
browse them at will.
The code below works except when i get prompted to  Save or Open the file.
The name of the file is the name of my Action Mapping. in this case

How can i place the file name i saved in the database in the browser.

The Action below it an example from the mailing list.

public final class AttachmentsAction extends eCABaseAction

     * @param mapping The ActionMapping used to select this instance
     * @param actionForm The optional ActionForm bean for this request (if
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     * @exception SessionTimeoutException if the session times out, user
must relog
    public ActionForward execute (ActionMapping mapping,
                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response)
                                 throws  Exception, IOException,
ServletException, SessionTimeoutException
	    Log log = LogFactory.getLog(AttachmentsAction.class);
        log.debug("At Template");

        securityAccess cmap=(securityAccess)mapping;
        int id = 0;
        try {
            id = Integer.parseInt(request.getParameter("id"));
        } catch (NumberFormatException ex) {
            throw new NoValidWebData("error.NoWebData.issueNumber.Missing");

        IeCAService serviceImpl = this.geteCAService();
        Attachment attch = serviceImpl.getAttachment(new Integer(id));



        ServletOutputStream ostream = response.getOutputStream();

        return new ActionForward(null);


<action    path="/AttachmentGet"
        <set-property property="accessLevel" value="ASU" />

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message