• Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparing URL parameters with JSTL  RSS feed

 
Rob Wehrstein
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to compare two strings, but I keep getting errors. One string is a URL parameter, and the other string is the return value of a function. Below is my failed attempt:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66260
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the error? And why not just param.foo?
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like it might have some confusion over parsing of quotes. You are using " to both delimit the expression and for the parameter values.

Two suggestions to fix:
- Change one set of " to '
i.e.

- As Bear suggested, use ${param.foo} rather than ${param["foo"]} to remove one set of quotes.
i.e.

 
Rob Wehrstein
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:
- As Bear suggested, use ${param.foo} rather than ${param["foo"]} to remove one set of quotes.
i.e.

Thanks. That worked.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!