Hi Anthony, You can define a template to be used for rendering a NodeData. These are the steps: 1. Define a new Magnolia template using your JSP. You can set "visible" to false. 2. Add a new NodeData "nodeDataTemplate" to a control in the paragraph's dialog definition with the name of the new template. Best try it with an image control
Ralf -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 31. Mai 2007 03:13 An: [email protected] Betreff: Re: [magnolia-user] genarated image paragraph thx david but im not wanting to scaling an image- im just wanting to make an image on the fly each time the page is loaded. anyway, the problem i found with using the path like: /templates/site/paragraphs/tools/genimage.jsp is that the server trys to look for: /docroot/templates/site/paragraphs/tools/genimage.jsp and thats 404 dude- not found action. under the jsp 1.2 spec you can inline other .jsp requests in this way because they are different requests. just i cant seem to get it to point to the jsp in magnolia, i dont want to go to the hassle of making a servlet and start beeming session objects all over the place just for one image. i looked at the dialog stuff and that seems to be more for making perminant assets (not dynamic on page loading ones)? i dont want to keep a copy of the image- its random you see. seems more complex then i thought it would be :) aNt David Smith wrote: > You can't inline a graphics object in a html page (at least not that > I've ever seen). The image has to be called on a separate request -- > all you can do with the genimage.jsp is provide the path to the image > for download. > > Now if you provided the url like this: > > <img > src="/templates/site/paragraphs/tools/genimage.jsp?imgPath=/context/path/to/ my/image&width=640&height=480" > /> > > Then you might have something as the genimage.jsp would be able to > find the image using the imgPath request parameter and scale or > whatever it using the width and height request parameters. > > --David > > > anthony rogers wrote: > >> >> more info- >> >> i tryed doing this: >> >> <jsp:text><![CDATA[<img src="]]></jsp:text><c:import >> url="/templates/site/paragraphs/tools/genimage.jsp" >> /><jsp:text><![CDATA[" />]]></jsp:text> >> >> but i get an error of because my genimage.jsp calls: >> response.setContentType("image/png"); >> OutputStream os = response.getOutputStream(); >> >> // output the image as png >> ImageIO.write(buffer, "png", os); >> os.close(); >> >> so to create the image; magnolia's import is very happy about that: >> Caused by: java.lang.IllegalStateException: Unexpected internal >> error during <import>: Target servlet called getWriter(), then >> getOutputStream() >> >> downer :( >> >> aNt >> >> anthony rogers wrote: >> >>> hello everyone :) >>> >>> hope this is a simple one; i been playing with the new magnlia 3.x >>> (r) and was wondering is anyone can tell me how i can put a buffered >>> image (im making in jsp) into my templates image tag? so i can todo >>> something like this: >>> >>> <img src="genimage.jsp" /> (maybe a node in the dialog points to the >>> jsp and i somehow pull it out into my page (dialogIncludes style)). >>> >>> the above image tag points to another jsp that has the code that >>> makes the image. thing is i cant seem to get that to work in >>> magnolia because the way things work with the cool repositories and >>> nodes. so how do i get a jsp or the template to point to my image >>> code?- just a case of wiring things up differently i think... >>> >>> any pointers would be rockin. >>> >>> ta >>> >>> aNt >>> >>> >>> >>> ---------------------------------------------------------------- >>> for list details see >>> http://documentation.magnolia.info/docs/en/editor/stayupdated.html >>> ---------------------------------------------------------------- >>> >> >> >> ---------------------------------------------------------------- >> for list details see >> http://documentation.magnolia.info/docs/en/editor/stayupdated.html >> ---------------------------------------------------------------- > > > > ---------------------------------------------------------------- > for list details see > http://documentation.magnolia.info/docs/en/editor/stayupdated.html > ---------------------------------------------------------------- > ---------------------------------------------------------------- for list details see http://documentation.magnolia.info/docs/en/editor/stayupdated.html ---------------------------------------------------------------- ---------------------------------------------------------------- for list details see http://documentation.magnolia.info/docs/en/editor/stayupdated.html ----------------------------------------------------------------
