This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ problem-Dynamic attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ problem-Dynamic attribute" Watch "HFSJ problem-Dynamic attribute" New topic
Author

HFSJ problem-Dynamic attribute

Harshana Dias
Ranch Hand

Joined: Jun 11, 2007
Posts: 327
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

Joined: Jun 11, 2007
Posts: 327
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFSJ problem-Dynamic attribute
 
Similar Threads
HFSJ struts Example pgm
Servlet Doesn't appear to be working.
unable to access the attribute in any of the container scope
Problem getting the Beer Selection Page screen shot
HFSJ 2nd edition page 75