Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Page loading issue in Index page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Page loading issue in Index page" Watch "Page loading issue in Index page" New topic
Author

Page loading issue in Index page

Kannan BLR
Greenhorn

Joined: Mar 01, 2005
Posts: 10
Hi,

In Index.jsp, Iam retrieving the datas from Database & put them to combo box. taking more time to load the page because of retrieving those data from DB. that is problem now.

Code is,
<TD width="120" class="text">
<input type="radio" name="find" value="ip"/>Industry Partner
</TD>
<td width="200">
<select style="width:266px" class="text" name="ipopt">

<option value="">--Select One--</option>
<%

UserMaster um1=new UserMaster();
ArrayList a2=new ArrayList();
a2=um1.getIPCodes();

for(int i=0;i<a2.size();i++)
{
String ipcode=(String)a2.get(i);
Industry ip=new Industry();
ip=ip.getIPName(ipcode);

%>
<OPTION value="<%=ipcode%>">
<%=ip.getIname()%></OPTION>

<%}}%>
</select></td>

what is my question is, Data should fetch from DB when i click radio button else combo box should be showing only ---Select One---.
If it's happened, load performane is good.
Please give the suggestion to me.
Thanks,


Kannan.A<br />kannanmsc@sify.com
K Kiran Kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 109
You can call a javascript using onclick() or onchange() or selected() methods by passing some variable(like getFromDB=y). After calling your JS method, call the same page and check for the variable that you have set. Then you can connect to dbase...
Regards,
Kiran.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Page loading issue in Index page
 
Similar Threads
Servlet getting values from a combo box
JSP Help Regarding the Radio Button
how to get the index and value from option dropdown listbox in jsp page
Returning a result set in an html form
Chained combobox fails to work