Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Web Component Certification (OCEJWCD)
EL question
reubin haz
Ranch Hand
Posts: 287
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I saw a question is given:
http://domain/scwcd/tmp.jsp?name=blah
it uses ${param.name} to get value of name which is blah,
but how to write EL to get variable name 'name' itself?
thanks
SCJA, SCJP5.0, SCBCD, SCWCD
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"param" is a Map. You could use forEach to browse through all parameters
[My Blog]
All roads lead to JavaRanch
Gowher Naik
Ranch Hand
Posts: 643
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<table border=1> <c:forEach var="p" items="${param}" varStatus="c"> <tr> <td>${c.count}</td><td><b>${p}</b></td> </tr> </c:forEach> </table>
Check code above now consider that url is
http://localhost:8080/mapping/result.jsp?name=gowher&address=mumbai
output will be-:
1address=mumbai
2name=gowher
reubin haz
Ranch Hand
Posts: 287
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks gowher for the example.
I just noticed that the pair printed is the reverse order of appearing in the URL, address first, and name second.
Is it the way that always does?
SCJA, SCJP5.0, SCBCD, SCWCD
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'd like to add that you can separate key and value that way (because variable called p is a Map.Entry):
<c:forEach var="p" items="${param}" varStatus="c"> ${c.count} ${p.key}=${p.value}<br> </c:forEach>
[My Blog]
All roads lead to JavaRanch
Renu Radhika
Ranch Hand
Posts: 243
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I checked this with
tomcat
5.5 and tomcat 6.0 5.5 prints attributename=value whereas when I ran the same in 6.0 its giving me only the object id.has anyone noticed this?
Renu Radhika
Ranch Hand
Posts: 243
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
can anyone please explain me the change in behaviour
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Passed SCWCD yesterday.
SCWCD relevance
SCWCD or SCBCD ?
Passed SCWCD with 95% !!!
SCWCD Certification Update News
More...