Forums Register Login

Expression Language

+Pie Number of slices to send: Send
Hello

I have a following piece of code in my Servlet class


And here is my jsp



Why the above mentioned jsp runs successfully, and not this one?



Similarly,

works

but doesn't. Why?
+Pie Number of slices to send: Send
Because it will try to find the value of an attribute (page context first, then request, then session, then servlet context) called Akon, and use that value as the index / key.
That's why the first example works the other way around - the map doesn't have a key "Genre", but there is an attribute called "Genre" with a value that is a valid key.
+Pie Number of slices to send: Send
That means, the variable in double quotes represents map key, and those without double quotes represents attribute. Am i right?
+Pie Number of slices to send: Send
Yes. The main thing to remember - with the bracket notation, anything not in quotes is either a numeric literal (e.g. [0]), boolean literal (e.g. [true]), null or the name of an attribute.
+Pie Number of slices to send: Send
Thanks a lot Rob
+Pie Number of slices to send: Send
You're welcome.
rubbery bacon. rubbery tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 762 times.
Similar Threads
More Music - Any ideas?
Servlet/JSP problems
Problem with IE9
Problem with creating db - what's wrong?
Cannot pass checkbox array to Java bean
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:19:02.