Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dots in attribute names

 
Graeme Byers
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dots in attribute names
===============
"Attribute names should follow the same conventions as package names." Sun API

The way I'm coding gives no output for attribute names containing dots.
How should I code the JSP ?
Do any other special characters cause problems ?

Thank you for any help.
Servlet :

JSP :

Displays :


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As dots are an operator, obviously using them in a scoped variable name is discouraged. You can only use the short-hand notation (using the dots) when the scoped variable name is a valid identifier -- obviously one with dots or any other special character doesn't qualify.

You'll have to use the long form: ${requestScope['my.silly.scoped.variable.name']}
 
Graeme Byers
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bear.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My pleasure.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!