Do you mean something like this? you can use actions to get data as a stream, for example to use it with the img-tag

/****action****/
public class DiagramGanttAction extends DownloadAction {
protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
           HttpServletRequest request, HttpServletResponse response)
           throws Exception {

       String contentType = "image/png";
       byte[] imagebytes = null; // Get the bytes from somewhere
final GanttDiagram gantt = new GanttDiagram(project.getName(),project);
       imagebytes = gantt.getImagearray();
       return new ByteArrayStreamInfo(contentType, imagebytes);
   }

   protected class ByteArrayStreamInfo implements StreamInfo {
       protected String contentType;
       protected byte[] bytes;
       public ByteArrayStreamInfo(String contentType, byte[] bytes) {
           this.contentType = contentType;
           this.bytes = bytes;
       }
       public String getContentType() {
           return contentType;
       }
       public InputStream getInputStream() throws IOException {
           return new ByteArrayInputStream(bytes);
       }
   }
}

now you can use it in your jsp:

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html"%>
<html:img action="/diagramGantt" alt="hier müßte das Bild kommen" />


struts-config:

   <action
     attribute="diagramGanttForm"
     input="gantt.jsp"
     name="diagramGanttForm"
     path="/diagramGantt"
     scope="request"
     type="kpm.presentation.actions.DiagramGanttAction"
     validate="false" />
</action-mappings>

Lalchandra Rampersaud schrieb:
Hi

Is it possible execute an action which just puts data into the request
object without returning an ActionFoward?

I tried to return null but the page just becomes blank.

Ravi


__________________________________________

Participe en Universidad 2008.
11 al 15 de febrero del 2008.
Palacio de las Convenciones, Ciudad de la Habana, Cuba
http://www.universidad2008.cu

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

Reply via email to