• 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

Use List from JSTL to Scriptlets

 
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I want to use the list element inside my scriptlet. Below is my code which is not working.


How can i access social var inside scriptlet.

Thanks
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you do that? The JSTL and EL were meant to replace scriptlets 12 years ago. They are not meant to be used together.

If you are using a super-modern version of JSP, you can make general function calls with JSTL and EL. Otherwise you should either refractor the bean to use properties rather than general function calls, or explore defining an EL function, or simple custom tag.

Under no circumstances should you be using scriptlets, and certainly never mixing scriptlets with the JSTL and EL.
 
vivek dhiman
Ranch Hand
Posts: 157
Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I can apply the custom tag, but for the time being i have to do it early and the codebase is not setup yet.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don;t what set up you think you need to do. But whatever it is, that's the way to go rather than trying to write fragile code that will cause problems later. What version of JSP and El are you using? You may just be able to make the method call with the EL.
reply
    Bookmark Topic Watch Topic
  • New Topic