wood burning stoves*
The moose likes JSP and the fly likes Dynamic Variable Declaration or get values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Dynamic Variable Declaration or get values" Watch "Dynamic Variable Declaration or get values" New topic
Author

Dynamic Variable Declaration or get values

Sankar Nadar
Greenhorn

Joined: Sep 15, 2012
Posts: 3

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


Regards,
$ankar
"Dont Knock d DOOR. Jus Brk IT.."
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

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.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Dynamic Variable Declaration or get values