• 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

HFSJ problem-Dynamic attribute

 
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I am refering the HFSJ 1.5 book page number 542.

Earlier it was,

<select name='color' size='1'>
<option value='light'> light </option>
<option value='amber'> amber </option>
<option value='brown'> brown </option>
<option value='dark'> dark </option>
</select>

But then they have replace the above index.jsp with the following custom tag with use of dynamic attirbute to create the above select tag,

<formTags:select name='color' size='1' optionList='${applicationScope.colorList}' />

I think colorList is the List which store above light,amber,brown,dark values. But it newer decalre any where. Later in page 557 they have given the tag handler class but its not declare there and even we cant declare it there also know since its a java class it gives error when you just declare a list outside a method and add values to it. I think its also not possible to declare it in the Servlet which handle the form submit becuse its too late. So where should it be declared?

Any one reading the book this part noticed it?

Thank You.

 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll find the same tutorial here, from the author of the book. The author says that the attribute is set in the goToForm.do servlet (although it uses sessionScope instead of applicationScope). You can try to put it in the application scope instead.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic