P
parkarumesh
Hi All,
Our application has a dynamic left navigation tree where entities of
the tree a fetched from database, appropriate HTML structure is formed
for each node and is the string is then rendered on the JSP as JSP
response.
To elaborate, I am providing the following code snippet
In my leftnav.jsp
<%
LeftNavTree leftNavTree = new LeftNavTree();
%>
<%= leftNavTree.outputTree()%>
I have the function outputTree in LeftNavTree.java which builds the
tree structure and returns a string of the HTML structure which is
rendered on the browser.
A sample string is
<table>
<tr>
<td>
<a href="....">Entit1</a>
</td>
</tr>
</table>
This is just a sample for one node, the string which is getting
rendered is huge as number of entities are many and also there is
nesting amongst the nodes.
I have checked for the code on server-side, it takes merely 4-5
seconds. I have inserted the following code in the above mentioned JSP
<% long startTime = System.currentTimeMillis(); %>
<%= leftNavTree.outputTree()%>
<% long endTime = System.currentTimeMillis();
System.out.println("@@@@JSP Render Tree Time: "+ (endTime - startTime)
+" ms");
%>
But to render the complete on browser it takes more than 1 minute.
Why is that JSP is taking so long time to just render the HTML string?
Is it because browert(IE 6.0) is taking time to render this huge
string? Is it that DOM structure takes so much time to get rendered?
What is the reason behind such a behavior and what are the workarounds
for the same?
Any help is highly appreciated as my project schedule has hit a lot
due the performance issue.
Thanks in advance
Our application has a dynamic left navigation tree where entities of
the tree a fetched from database, appropriate HTML structure is formed
for each node and is the string is then rendered on the JSP as JSP
response.
To elaborate, I am providing the following code snippet
In my leftnav.jsp
<%
LeftNavTree leftNavTree = new LeftNavTree();
%>
<%= leftNavTree.outputTree()%>
I have the function outputTree in LeftNavTree.java which builds the
tree structure and returns a string of the HTML structure which is
rendered on the browser.
A sample string is
<table>
<tr>
<td>
<a href="....">Entit1</a>
</td>
</tr>
</table>
This is just a sample for one node, the string which is getting
rendered is huge as number of entities are many and also there is
nesting amongst the nodes.
I have checked for the code on server-side, it takes merely 4-5
seconds. I have inserted the following code in the above mentioned JSP
<% long startTime = System.currentTimeMillis(); %>
<%= leftNavTree.outputTree()%>
<% long endTime = System.currentTimeMillis();
System.out.println("@@@@JSP Render Tree Time: "+ (endTime - startTime)
+" ms");
%>
But to render the complete on browser it takes more than 1 minute.
Why is that JSP is taking so long time to just render the HTML string?
Is it because browert(IE 6.0) is taking time to render this huge
string? Is it that DOM structure takes so much time to get rendered?
What is the reason behind such a behavior and what are the workarounds
for the same?
Any help is highly appreciated as my project schedule has hit a lot
due the performance issue.
Thanks in advance