You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/01/25 08:10:16 UTC

DO NOT REPLY [Bug 26409] New: - Document what to do if an Action doesn't need to be forwarded anywhere in the end?

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26409

Document what to do if an Action doesn't need to be forwarded anywhere in the end?

           Summary: Document what to do if an Action doesn't need to be
                    forwarded anywhere in the end?
           Product: Struts
           Version: 1.1 Final
          Platform: Other
               URL: http://jakarta.apache.org/struts/userGuide/building_cont
                    roller.html#config
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Documentation
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: hauser@acm.org


Some actions like the ones displaying an image coming out of a database or
downloading a file do not need to end with a next action or page (I guess the
browser works on them in a thread separate from the main web-page body processing).

The above documentation reference (see URL field) and
http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionMapping.html
don't seem to have a recommendation for this.

This is however a problem because Action.execute() always needs to return an
ActionForward object. As per Bug 26408, this causes an IllegalStateException in
your log which is kind of a false alarm if seriously work on your logs.

Sample core part of the execute() method for illustration:
		response.setContentType(img.getContentType());
		OutputStream out = response.getOutputStream();
		InputStream is = img.getImgStream();

		int c;
		int i = 0;
		while ((c = is.read()) != -1) {
			out.write(c);
			i++;
		}
                return actionMapping.findForward(????);

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