Re: Graphics-Object
Hi, that sounds good; but how is the action-mapping in the struts-config.xml (I have no ActionForm) action path=/createImage type=webTemplate.ImageAction /action doesn't work Michael |+--- || Craig R.| || McClanahan | || craigmcc@apa| || che.org | || | || 13.06.01 | || 20:01| || Please | || respond to | || struts-user | || | |+--- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Michael Schommer/PDD/DEV/LU/FERNBACH) | | Subject: Re: Graphics-Object| ---| Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable On Wed, 13 Jun 2001, Michael Schommer wrote: Hi, I want to hang the Graphics-Object for example on the HttpSession and= read it from the JSP by the html:img- or other tag. Will it work and how? The fundamental concept is that an Action can, in fact, create the response itself, if it wants to, and then return null from the perform() method to indicate to Struts that no forwarding needs to be done. Within the action, you would call response.getOutputStream() and= write the bytes of your image (after doing any necessary conversion and= setting the correct content type). In a JSP page that references the dynamically created image, you would = say something like: html:img page=3D/createImage.do/ and this will create a hyperlink to the URL that will dynamically creat= e the image when the page is displayed. Like all img tags in HTML, the= image is loaded from a separate request (most browsers will initiate multiple requests in parallel if you've got multiple images, so be sure= your session data is thread safe) as the calling page is being displaye= d. Alternatively, you might consider creating a separate servlet whose purpose is to create the dynamic image. Code very similar to what you'= d put in the action would be used to create the image. Gru=DF Michael Craig McClanahan =
Re: Graphics-Object
On Mon, 18 Jun 2001, Michael Schommer wrote: Hi, that sounds good; but how is the action-mapping in the struts-config.xml (I have no ActionForm) action path=/createImage type=webTemplate.ImageAction /action doesn't work This looks fine, as long as your action class is webTemplate.ImageAction. What does the incoming request look like? What does your ImageAction class try to do? What actually happens? Without a bunch more specific details, it's difficult to be helpful. Michael Craig
Graphics-Object
Hi, I have an Action-Class, which generates a Graphics-Object and want to display it as image by a JSP, without saving it as file. Is there any idea? Gruß Michael -- Java - write once, run anywhere
Re: Graphics-Object
how about using advanced imaging apis ? suhas - Original Message - From: Kommineni, Sateesh (IndSys) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 12:25 PM Subject: RE: Graphics-Object Hi.. With thehelp of JPEGEncoder and BufferedImage Classes you can do that...I never used struts frmaework,so i don't know much abt the Action_class and all the other classes... Regards Sateesh -- From: Michael Schommer[SMTP:[EMAIL PROTECTED]] Reply To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 4:53 PM To: [EMAIL PROTECTED] Subject: Graphics-Object Hi, I have an Action-Class, which generates a Graphics-Object and want to display it as image by a JSP, without saving it as file. Is there any idea? Gruß Michael -- Java - write once, run anywhere
Re: Graphics-Object
Hi, I want to hang the Graphics-Object for example on the HttpSession and read it from the JSP by the html:img- or other tag. Will it work and how? Gruß Michael -- Java - write once, run anywhere |+- || suhas| || [EMAIL PROTECTED]| || ltech.com | || | || 13.06.00 17:52 | || Please respond to | || struts-user; Please| || respond to suhas | || | |+- ---| | | | To: [EMAIL PROTECTED] | | cc: (bcc: Michael Schommer/PDD/DEV/LU/FERNBACH) | | Subject: Re: Graphics-Object| ---| how about using advanced imaging apis ? suhas - Original Message - From: Kommineni, Sateesh (IndSys) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 12:25 PM Subject: RE: Graphics-Object Hi.. With thehelp of JPEGEncoder and BufferedImage Classes you can do that...I never used struts frmaework,so i don't know much abt the Action_class and all the other classes... Regards Sateesh -- From: Michael Schommer[SMTP:[EMAIL PROTECTED]] Reply To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 4:53 PM To: [EMAIL PROTECTED] Subject: Graphics-Object Hi, I have an Action-Class, which generates a Graphics-Object and want to display it as image by a JSP, without saving it as file. Is there any idea? Gruß Michael -- Java - write once, run anywhere
Re: Graphics-Object
On Wed, 13 Jun 2001, Michael Schommer wrote: Hi, I want to hang the Graphics-Object for example on the HttpSession and read it from the JSP by the html:img- or other tag. Will it work and how? The fundamental concept is that an Action can, in fact, create the response itself, if it wants to, and then return null from the perform() method to indicate to Struts that no forwarding needs to be done. Within the action, you would call response.getOutputStream() and write the bytes of your image (after doing any necessary conversion and setting the correct content type). In a JSP page that references the dynamically created image, you would say something like: html:img page=/createImage.do/ and this will create a hyperlink to the URL that will dynamically create the image when the page is displayed. Like all img tags in HTML, the image is loaded from a separate request (most browsers will initiate multiple requests in parallel if you've got multiple images, so be sure your session data is thread safe) as the calling page is being displayed. Alternatively, you might consider creating a separate servlet whose purpose is to create the dynamic image. Code very similar to what you'd put in the action would be used to create the image. Gruß Michael Craig McClanahan