• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing Var's using include param

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm passing a variable to an included JSP using jsp:param and in the included JSP if I use EL to fetch the value, ${reportIndex} it doesn't work. But if I use an expression with request.getParameter("reportIndex") it works just fine.

Just looking for a reason as to why this is the case. I'd much prefer to use EL if I could.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EL addresses scoped variables, not parameters.

Use the builtin param variable to address the map of params: ${param.paramName}
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. I'd also investigate the use of tag files rather than includes with params.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect, thanks Bear.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!