Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ problem-Dynamic attribute

 
Harshana Dias
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • 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: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic