• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

tags:panel not working in a particular situation

 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I am trying to use the panel tag. The code below works fine, there is no problem.



When i am trying to use the same tags, when populating the table from the given data using with iterator as shown below



when i try to run the above I am getting this errror


/DataPage.jsp (line: 20, column: 84) Scripting elements ( <%!, <jsp:declaration, <%=, <jsp:expression, <%, <jsp:scriptlet ) are disallowed here.



how to overcome that..
Please someone help me out.

Thanks and Regards.
Adeeb
 
Sheriff
Posts: 67596
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
The use of scriptlets has been discredited for over 10 years now with the introduction of JSP 2 in 2002. They should not be used in any modern JSP pages.

Moreover, tags created with the JSP 2 mechanisms cannot be used in conjunction with outdated scriptlets. That may be what you are encountering.

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Bear.


So is there any other way to iterate other than using jsp scrplets?? can i get and example.




Thanks
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a List containing the database table data with three columns and unknown number of rows, so wright now i was using scriplets to display it..
The other way i tried with tag is like this

<c:forEach var="ulist" items="${data}">
${ulist[0]}
${ulist[1]}
${ulist[2]}
</c:forEach>


is that correct??? i am getting error "Syntax error, insert "Finally" to complete TryStatement"
 
Bear Bibeault
Sheriff
Posts: 67596
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
That syntax error seems unrelated to your JSTL. May we see the entire JSP file with proper indentation and code tags?
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally I got it till here.



1. I can view only one row, means its not itterating.
2. When i try to use var i.e like $(ulist), i get null values. Then what for i have to take a variable when i am able to access the list directly with "data".

I think i am doing some silly mistake, its better to post the total code.



 
Bear Bibeault
Sheriff
Posts: 67596
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
Do you really not indent your code?
 
reply
    Bookmark Topic Watch Topic
  • New Topic