Hi all,
I have a page that fills a select field with certain xpaths from a List contained in a session object. In extreme cases the List contains around 15,000 xpath entries. This causes the page to load very slowly and takes nearly 4-5 mins. This is a huge bottleneck.
I've attached a sample
JSP that simulates this behaviour. Is there any alternative way to approach this problem. i have heard of AJAX but since the data is present on the client side itself,i'm not sure it's applicable
<HTML>
<%@ page language="java" import="java.util.*"%>
<%List selectList=new ArrayList();
for(int i=0;i<15000;i++){
selectList.add(i,"/root/a["+i+"]");
}
%>
<script language="javascript">
function init(){
var mycars="<%=selectList.toString()%>";
var arr=mycars.split(",");
var a=arr[0];
arr[0]=a.substring(1,a.length);
var c=arr[arr.length-1];
arr[arr.length-1]=c.substring(0,c.length-1);
<%
for(int i = 0; i < selectList.size(); i++) {
%>
var opt = document.createElement('option');
var val ='<%=selectList.get(i)%>';
var text = '<%=selectList.get(i)%>';
lstidentificationfield = document.passiveConfig.xmlIdentificationField;
opt.value = val;
opt.text = text;
lstidentificationfield.options.add(opt);
<%
}
%>
}
</script>
<BODY onXoad="init()">
<form name="passiveConfig">
<select name="xmlIdentificationField" id="xmlIdentificationField" size="1" style='width:500px'>
<option value="0">Select XML Field</option>
</select>
</form>
</BODY>
</HTML>
[ December 22, 2006: Message edited by: gov kur ]