• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on EL and Custom Tags

 
Mike Pandey
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my Comp broker from last few dayz hence did not get a chance to check these out on Tomcat.... So Communicating from a cyber cafe..
Please help clarify by the time my PC comes up

The first doubt on EL is the way the [] operator is processed.
Assume I have a PageScoped attribute named XYZData set and it has properties name, size, priceList..etc The priceList property is a List.

so does a expression like ${XYZData[priceList[0]]} first try to evaluate priceList as an attribute in any scope? or it evaluates XYZData and then gathers that priceList is a property.

Accdng to my knowledge, ${XYZData.priceList[0]} would work fine.



The second doubt is on the CustomTags body-content.
I read SimpleTags from HF and found that the JspFragment passed in setJspBody() of SimpleTaghandler cannot conatin scripting expressions.

So does that mean we cannot use <body-content>JSP</body-content> for TagHandler written extending SimpleTagHandler.

I have not read ClassicTag Handlers so not so sure abt the same.

Can anyone pls clarify?

Thanks.
 
Tamer Badr
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using nested brackets in EL does work fine [HFSJ (Chapter 8, page 376)]
 
Mike Pandey
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not think you got my quetsion on EL correctly.

Meanwhile, I found from Net that for SimpleTaghandlers we cannot have body-content set as JSP.

Thanks.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EL will think that XYZData of the expression ${XYZData[priceList[0]]} is a collection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic