• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Order of dynamic and static attribute

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know if the order of static and dynamic attributes matters or not, when we implement DynamicAttributes interface?

I have tested this feature with this jsp and found that order doesn't matter.



In this JSP subject is a static attribute and size a dynamic one.The second call ( line 05) to myTags is not throwing any error and the JSP is accessed successfully. Is it specific to the container that I am using or a general rule that static and dynamic attribute can appear in any order.

I have gone through the specs also , but couldn't find anything related to the order. Did I miss something?

Thanks
Nitin
 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, the order isn't important. Because, we specify the name of the attributes. Please confirm!

Thanks!
 
Creator of Enthuware JWS+ V6
Posts: 3326
298
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nitin,

I have gone through the specs also , but couldn't find anything related to the order. Did I miss something?


No, you didn't miss anything, there is no specific order defined.

Regards,
Frits
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits for confirming!
 
Nitin Kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frits,

Thanks for your reply. So it means we can put these attributes in any order.

Regards,
Nitin
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure order is relevant?
Because on Hanumant Deshmukh Book, SCWCD EXAM STUDY KIT SECOND EDITION
chapter 17, question 3, page 467 I read this:

The <dynamic-attributes> element is set to true, so JSP statements
can incorporate variables beyond those mentioned in the TLD. If there are
static and dynamic values in a tag, the static values need to come first,



 
Nitin Kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are you sure order is relevant?
Because on Hanumant Deshmukh Book, SCWCD EXAM STUDY KIT SECOND EDITION
chapter 17, question 3, page 467 I read this:



In fact, I tested above JSP, while going through one of the questions of same book ( Chapter 17, Question 3). I was not very convinced with the explanation given and hence tried to test it my self.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3326
298
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Are you sure order is relevant?
Because on Hanumant Deshmukh Book, SCWCD EXAM STUDY KIT SECOND EDITION
chapter 17, question 3, page 467 I read this:
The <dynamic-attributes> element is set to true, so JSP statements
can incorporate variables beyond those mentioned in the TLD. If there are
static and dynamic values in a tag, the static values need to come first,


I have checked the specs about it and I can't find anything confirming that part of the book you are mentioning.

Actually it says the following:

JSP.13.3 Dynamic Attributes
For each attribute specified in the tag invocation that does not have a corresponding
attribute element in the TLD for this tag, a call must be made to set-
DynamicAttribute(), passing in the namespace of the attribute (or null if the
attribute does not have a namespace or prefix), the name of the attribute without
the namespace prefix, and the final value of the attribute.


So for every attribute the container has to check whether it is an attribute explicitly defined (in the TLD) before considering it as a dynamic attribute. I don't see a reason why static attributes have to come first....

Regards,
Frits
 
It's exactly the same and completely different as this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic