This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes using a java variable in the jsp side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "using a java variable in the jsp side" Watch "using a java variable in the jsp side" New topic
Author

using a java variable in the jsp side

ihsan kocak
Ranch Hand

Joined: Mar 14, 2012
Posts: 31
hi all.i am trying to use a variable(an arraylist) which exists in java file(taskcompletion.java).i declared the variaable on java side like this:

public static List<String> yeniler = new ArrayList<String>(1000);



then i would like to use this variable in jsp page like this:



<dmf:label label="<%=form.yeniler.get(i)%>" />



but it gives an java.lang.IndexOutOfBoundsException size:0



how can i initialize the list before page use it?



Best Regards.
Paul Strachan
Greenhorn

Joined: Oct 24, 2004
Posts: 10
your code creates an ArrayList with an initialCapacity of 1000 and size of 0.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

dmf is not a standard JSP tag library. What is it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ihsan kocak
Ranch Hand

Joined: Mar 14, 2012
Posts: 31
It is a documentum(emc) tag.
Bear Bibeault wrote:dmf is not a standard JSP tag library. What is it?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using a java variable in the jsp side
 
Similar Threads
Is it possible to send arraylist from jsp to javascript(same page)
Extracting values from an ArrayList into String variables
generics what's the difference?
how to pass arraylist from jsp to java bean
Reading from a database with MVC