java ee - J2EE EJB3 webservice for image generation -


i need advice best solution on how make web service returns generated image. instance client gives yard id , service depending on business data generates image of yard (that's example).
using ejb3 , jpa accomplish this. there's no problem reading data datasource , exposing ejb web service. worried 2 things - using awt in ejb , file i/o in ejb.

  1. awt in ejb?

    i've created bufferedimage , using java.awt.graphics2d draw image - lines, circles etc.. not drawing screen, bufferedimage willing pass client.
    question - idea that? if not best solution?
    said "the program violates enterprise javabeans specification using awt/swing." bad idea use awt in situation?
    said "an enterprise bean must not use awt functionality attempt output information display, or input information keyboard." mean awt used in different situations (like i"m not displaying on screen)?

  2. file i/o in ejb?

    i can't use i/o external files, files ar located in ejb jar file? possible read data stored in deployment jar file? instance have small pattern files want read , use drawing (decorating rectangle background etc.).
    appropriate put them in jar file , use them reading?

thanks in advance!

the program violates enterprise javabeans specification using awt/swing

this when using awt/swing interacting keyboard/mouse. creating buffered image. not see problems this.

btw, planning pass on buffered image client? wouldn't real image, jpg or png better?

file i/o in ejb?

file io in ejb is considered bad. situation, since reading patterns, these resource bundles. can use class.getresourceasstream or clasloader.getresourceasstream read configuration files (which in jar, instance)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -