That's what I was afraid of. :( Don't worry...Writing a service is only a few lines of java code - and you have a fully working example (actually make that two fully working examples) to look at on how to do it:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/chart/ChartService.java?view=markup Just replace the section looking like: IChartProvider provider = (IChartProvider) component; Chart chart = provider.getChart(); JPEGEncoder13.encode(chart, 1.0f, _response); To something more like : OutputStream os = _response.getOutputStream(); os.write(myDevObject.getDevImage()); A more comprehensive example of writing the image data directly can be found here: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-contrib/src/java/org/apache/tapestry/contrib/services/impl/RoundedCornerService.java?view=markup On 5/6/07, li li <[EMAIL PROTECTED]> wrote:
The column image is fetch from database,not only in locale. :( Need I have to write java code to do this? I mean that need I have to use "ExternalAsset" class to do it? If I could config the image in html or page dynamic? *离人网 * ------------------------------ From: *"Jesse Kuhnert" <[EMAIL PROTECTED]>* Reply-To: *"Tapestry users" <users@tapestry.apache.org>* To: *"Tapestry users" <users@tapestry.apache.org>* Subject: *Re: How to display html in Table component?* Date: *Sun, 6 May 2007 00:07:15 -0400* >Is the value of devImage really a url ? If that is the case then you >can >give it an instance of IAsset by doing something like this in your >page/component: > >public IAsset getDeveloperAsset(Developer dev) >{ > return new ExternalAsset(dev.getDevImage(), this.getLocation()); >} > >Not exactly the prettiest feeling way to do it but .... > >Of course....if it's really just a local context-relative url you >could also >always get away with: > ><img src="/test/images/test.jpg" /> > >On 5/5/07, li li <[EMAIL PROTECTED]> wrote: >> >>Thank you! But image HTML code seem don't work: >> >><td> >><span jwcid="@Image" >>image="ognl:components.tableRows.tableRow.developer.devImage"/> >></td> >> >>The value of "developer.devImage" is >>"http://localhost:7001/test/images/test.jpg". >>It throws exception:"No type converter for type >>org.apache.tapestry.IAsset >>is available." >> >>lirenwang >> >> >> >From: "Jesse Kuhnert" <[EMAIL PROTECTED]> >> >Reply-To: "Tapestry users" <users@tapestry.apache.org> >> >To: "Tapestry users" <users@tapestry.apache.org> >> >Subject: Re: How to display html in Table component? >> >Date: Sat, 5 May 2007 23:29:27 -0400 >> > >> >Oh.....Maybe you just want a particular row (or table cell ) to >> >appear red >> >or similar...Then look at the example at the very bottom of this >> >page: >> > >> > >> http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/table.html >> >> > >> >With that I could make something red via: >> > >> ><tr jwcid="[EMAIL PROTECTED]:TableRows" >> >class="ognl:beans.evenOdd.next"> >> > <td align="left"> >> > <span style="color:red"><span jwcid="@Insert" >> >value="ognl:components.tableRows.tableRow.threadTitle /></span> >> > </td> >> > <td align="right"> >> > <span jwcid="@Insert" >> >value="ognl:components.tableRows.tableRow.getScoreDisplay(0)" /> >> > </td> >> > <td align="right"> >> > <span jwcid="@Insert" >> >value="ognl:components.tableRows.tableRow.getScoreDisplay(1)" /> >> > </td> >> > <td align="right"> >> > <span jwcid="@Insert" >> >value="ognl:components.tableRows.tableRow.getScoreDisplay(2)" /> >> > </td> >> > </tr> >> > >> >OR....even easier would be saying: >> > >> ><style> >> > tr td.boldColor { color:red; } >> ></style> >> > >> ><tr jwcid="[EMAIL PROTECTED]:TableRows" >> >class="ognl:beans.evenOdd.next"> >> > <td align="left" class="boldColor"> >> > <span jwcid="@Insert" >> >value="ognl:components.tableRows.tableRow.threadTitle /> >> > </td> >> ></tr> >> > >> > >> >On 5/5/07, li li <[EMAIL PROTECTED]> wrote: >> >> >> >>Hi Jesse: >> >> >> >> If I use Table component,how to do it? My code is: >> >> >> >><table align="center" jwcid="@contrib:Table" >> >>source="ognl:modaltest" >> >>pageSize="4" columns="id,threadTitle,!developer.id:Author: >> >>developer.devName,!literal:developer.devImage" raw="true" /> >> >> >> >>It seems that the raw parameter don't work? >> >> >> >> >> >> >> >>*lirenwang* >> >> >> >>------------------------------ >> >>From: *"Jesse Kuhnert" <[EMAIL PROTECTED]>* >> >>Reply-To: *"Tapestry users" <users@tapestry.apache.org>* >> >>To: *"Tapestry users" <users@tapestry.apache.org>* >> >>Subject: *Re: How to display html in Table component?* >> >>Date: *Sat, 5 May 2007 23:17:48 -0400* >> >> >> >http://tapestry.apache.org/tapestry4.1/components/general/insert.html >> >> > >> >> >Set the "raw" parameter to true , as in: >> >> > >> >> ><span jwcid="@Insert" value="ognl:yourProperty.getMyHtml()" >> >> >raw="true" /> >> >> > >> >> >On 5/5/07, li li <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >>hi everyone: >> >> >> >> >> >> Could Contrib:Table component display HTML code? I want to >> >> >>display some >> >> >>HTML code in Tapestry4's Table component.How to do it? For >> >> >>example,I want >> >> >>to display a red font in table,but when table rendered,it >>will >> >> >>escape these >> >> >>HTML code to plain text. So I couldn't display some html in >> >>Table. >> >> >>How to do >> >> >>it? thks! >> >> >> >> >> >>------------------------------ >> >> >>免费 下 载 MSN Explorer >> >> >> >><http://g.msn.com/8HMACNCN/2743??PS=47575 >> >--------------------------------------------------------------------- >> >> >> >> >> >>To >> >> >>unsubscribe, e-mail: [EMAIL PROTECTED] >>For >> >> >>additional >> >> >>commands, e-mail: [EMAIL PROTECTED] >> >> > >> >> > >> >> > >> >> > >> >> >-- >> >> >Jesse Kuhnert >> >> >Tapestry/Dojo team member/developer >> >> > >> >> >Open source based consulting work centered around >> >> >dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com >> >> >> >> >> >>------------------------------ >> >>免费下载 MSN Explorer >> >><http://g.msn.com/8HMACNCN/2743??PS=47575 >> >--------------------------------------------------------------------- >> >> >>To >> >>unsubscribe, e-mail: [EMAIL PROTECTED] For >> >>additional >> >>commands, e-mail: [EMAIL PROTECTED] >> >> >> > >> > >> > >> >-- >> >Jesse Kuhnert >> >Tapestry/Dojo team member/developer >> > >> >Open source based consulting work centered around >> >dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com >> >>_________________________________________________________________ >> 与联机的朋友进行交流,请使用 MSN Messenger: >>http://messenger.msn.com/cn >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > >-- >Jesse Kuhnert >Tapestry/Dojo team member/developer > >Open source based consulting work centered around >dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com ------------------------------ 使用 MSN Messenger <http://g.msn.com/8HMBCNCN/2734??PS=47575> 与联机的朋友进行交流 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com