• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Droplet Properties

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing a droplet to be used from within a jhtml page. How do I read a property from the droplet.properties file into an array.
e.g. In the droplet.properties file I have a property:-
catId=10,12,33,45,50
In the droplet.java how do I set these up in a String array when the droplet is instanciated.
I think this is done with the get'er and set'er of this property, but ....
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keith you question raised my curiosity. I did a quick search on Google. Are Droplets a Mac specific thing ?.
 
keith tyson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I didn't explain very well.
Droplets are used in jhtml to call in other jhtml source from another jhtml file or to call a bean (which returns whatever the java class returns).
e.g. < droplet src="/doc/otherstuff.jhtml">
< param name="xyz" value="123">
< /droplet>
or
< droplet bean="/atg/dynamo/droplet/Switch">
< param name="value" value="bean:TranslationDroplet.xyz">
< oparam name="321">
some code...
< /oparam>
< oparam name="123">
other code...
< /oparam>
< /droplet>
We are using this all through Dynamo and iSell (Informix Product).
The java class "/atg/dynamo/droplet/Switch.java" is called from within the jhtml page and receives a parameter "value" with the given value.
However, there is also a corresponding Switch.properties file.
In this file you can have a property e.g. myProperty and give it a value.
e.g. in Switch.properties
myProperty=10
Then in the Switch.java
String myProperty
// setter for myProperty
public void setMyProperty(String newMyProperty)
{
myProperty = newMyProperty;
}
// getter for myProperty
public String getMyProperty()
{
return myProperty;
}
So when this class is instanciated bythe call by the droplet command within the jhtml page, the Switch class will look at it's corresponding .properties file automatically and the myProperty attribute will be set to 10.
My problem is that I wish to set myProperty in the .properties file to be:-
myProperty=10,12,33,45,50
then have a String array in the .java to automatically store these values when instanciated.
(edited by Cindy to add spaces in HTML tags so that they would display instead of executing)
[This message has been edited by Cindy Glass (edited September 28, 2001).]
 
keith tyson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The droplet example is not showing I think coz of the angled brackets, so will use round instead. It read:-
e.g. (droplet src="/doc/otherstuff.jhtml")
(param name="xyz" value="123")
(/droplet)
or
(droplet bean="/atg/dynamo/droplet/Switch")
(param name="value" value="bean:TranslationDroplet.xyz")
(oparam name="321")
some code...
(/oparam)
(oparam name="123")
other code...
(/oparam)
(/droplet)
 
keith tyson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparantely you need take the whole list as one and then split it using the StringTokenizer.
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep !!. I had a example ready for quite awhile but could not get onto JR.



Good luck

[This message has been edited by Johannes de Jong (edited September 28, 2001).]
 
money grubbing section goes here:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic