velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph.R...@dlr.de
Subject Re: button factory
Date Wed, 27 Nov 2002 10:46:55 GMT
t b dinesh wrote:
> What is this button factory servlet?
> Where can I find it?
> 
> 
>>       *#<IMG SRC="${req.contextPath}/button_factory?#*
>>          *#textColor=FFFFFF&bgColor=${accentcolor}#*
>>          *#&text=${utils.escapeForURL($buttontext)}">#*
> 
> 
>>P.S. I see that you are using a button factory, is this based on my code? Cheers!
>>      As I've stated somewhere in some list the past (turbine, velocity,other?),
>>      it is intended to be published, can someone take a lead on this to get it
>>      into jakarta or sourceforge? I could also do this if someone points me in
>>      the right direction (jakarta account?).
>>

See the attachment.

In the webapp and web.xml I mapped the servlet to a simple name
     <servlet>
         <servlet-name>button</servlet-name>
         <servlet-class>de.dlr.dfd.muiswww.servlets.ButtonFactory</servlet-class>
     </servlet>

And use it out of velocity, e.g.:
...
#set( $button = "/button?fontSize=16&width=110&height=26&insetH=0&insetV=0&fgColor=0xFFFFFF&buttonColor=0x333333&borderColor=0x404040"
)

...
         <img src="$button&text=Home" alt="Home" border="0"></a>


Please give feedback if you think this should go into Jakarta or sourceforge...


You can try it out live at:
   http://piglet.esrin.esa.it:8080/eoweb/servlets/button?text=Hello%20World!
PLEASE NO LIVE LINKS TO THIS SITE. I HAVE PROVIDED THE SOURCE IN THE
ATTACHMENT SO YOU CAN INSTALL IT ON YOUR SITE.

If you use something prior to JDK 1.4, you will need to start the servlet
container (Tomcat) with a proper DISPLAY environment set, for example:
    setenv DISPLAY localhost:1
with a virtual X frame buffer (xvfb in the XFree X11r6 delivery), to be able
to use the headless Swing clases.

-- 
:) Christoph Reck

Mime
View raw message