• 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

Dynamic Variable Declaration or get values

 
Greenhorn
Posts: 3
Windows Vista Safari Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am New for JSP. I tried some code but it not works.. can you please help me or atleast confirm is that possible or not.




Hope most of them understood my problem.
Actually the issue is i want to get the value "Oldopprice1(10)" instead of "Oldopprice1"..
Is that possible or is there any other way to get that.
Thanks In Advance.

Regards,
Sankar
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are new to JSP you should be made aware that putting Java code into a JSP is an obsolete and discredited practice since 2002 when JSP 2 was introduced. You should be using the JSTL and EL in your pages, not Java scriptlets.

I also recommend that newcomers to JSP read the following articles:
  • The Secret Life of JSPs
  • The Front Man


  • And to answer your question: no you cannot reference scripting variables by creating their names at run-time. This is possible, however, using the more modern EL with scoped variables.
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic