Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constants in Classic Tag

 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this in a post related to Constants returned from Class Tag methods..


public static final int EVAL_BODY_AGAIN = 2
public static final int EVAL_BODY_BUFFERED = 2

both are having value 2 so practically doStartTag can return EVAL_BODY_AGAIN


My Ques.
Are we supposed to know what is the integer value for each of the constants returned = such that if two constants have same value these can be interchanged??? . If so, can someone list all the constant and their mapped integer values over here...

Regards,
Shivani.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think though the integer values of the constants are same, they are used the return value of the different methods.

The doStartTag can return the EVAL_BODY_BUFFERED and the doAfterBody can return the EVAL_BODY_AGAIN. So, no problem of same values. I think the constants have given to descriptive names to identify the purpose. As these are compile time constants, you can use the direct value, instead of these constants.

For the Exam You do not have to know the value of these constants.

Thanks
[ August 24, 2006: Message edited by: Narendra Dhande ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic