0

i have two Jsp's pages.
on main.jsp have some list of schools. from there i can go home page of any school. home.jsp represents a school home page.
in home.jsp have some links like message, vision, addmission etc.
when i click on any of these link then i get some information in a table area in a home page of that school (which is Home.jsp).
it show information when i click on these links otherwise table area in home.jsp show blank.

when i go from main.jsp to home.jsp, table area of home.jsp show blank. if i fill this table area by static data in Home.jsp. after that when
i click to message link, then message will show after static data.

my problem is when i go from main.jsp to home.jsp, table area of home.jsp show blank.
how i fill this table area by condtion so that when i move from main.jsp to Home.jsp, it can show some data.

here some data of Jsp's.

main.jsp

<html>
<body> <table width="200" border="1" >
<tr>
<td width="200" height="182" valign="top"><table width="200"
border="1">
<tr>
<th valign="top" height="34" bgcolor="#FFCC66"><div
align="left"><a href="Home.jsp?school=adrash"><FONT COLOR="#990000"
size="4"><span class="style5"> Adrash School </span>
</FONT></a></div></th>
</tr>
<tr>
<th valign="top" height="34" bgcolor="#FFCC66"><div
align="left"><a href="Home.jsp?school=dps"><FONT COLOR="#990000"
size="4"> Delhi Public School </FONT></a></div></th>
</tr>
</table>
</body>
</html>

Home.jsp

<html>
<body>
<td>
<table width="200" border="1" >
<tr>
<th valign="top" height="34" bgcolor="#FFCC66"><div
align="left"><a href="Home.jsp?value=message&&school=<%=school%>"
<FONT COLOR="#990000" size="4">Message</div></th>
message related information
</tr>
<tr>
<th valign="top" height="34" bgcolor="#FFCC66"><div
align="left"><a
href="Home.jsp?value=visionary&&school=<%=school%>"<FONT
COLOR="#990000" size="4">Visionary </FONT></a></div></th>
vision related information
</tr>
<tr>
<th valign="top" height="34" bgcolor="#FFCC66"><span
class="style2"><div align="left"><a
href="Home.jsp?value=addmission&&school=<%=school%>"<FONT
COLOR="#990000" size="4">Addmission </FONT></a></div></span></th>
addmission related information
</tr>
</table></td>
<td width="730" valign="top">
<table width="730" height="700" border="0">
<tr>
<td valign="top">
<%
String value=request.getParameter("value");

if((school.equals("adrash"))||(school.equals("dps")))
{
if(value!=null && (value.equals("message")))
{
%>
<p></p>
<font size="+1">Message</font>
<%
}}
%>

<%
if((school.equals("adrash"))||(school.equals("dps")))
{
if(value!=null && (value.equals("visionary")))
{
%>
<p></p>
<font size="+1">visionary</font>
<%
}}
%>
<%
if((school.equals("adrash"))||(school.equals("dps")))
{
if(value!=null && (value.equals("addmission")))
{
%>
<p></p>
<font size="+1">addmission</font>
<%
}}
%>
</td>
</tr></table>
</body>
</html>

please help.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by tyson.crouch
-1

G'day,

As i understand it, you have a total of 3 pages;
1. main.jsp
2. home.jsp
3. Home.jsp

When you click on a link from main.jsp and are re-directed to home.jsp you wish to have a table containing data for that school upon the loading of the page.

What you might like to try is when the page loads, before your HTML tags have a section which runs a MySQL query to select all the data from a database table for that particular school.


Regards,
TC

P.S. Are you backing your JSP pages with actual java.class files?? if so, your query running should be rather easy to manage as all you will need to do is run a function to retrieve the data and pass it back to your .jsp page for output.

0

i have two pages.
- main.jsp
- home.jsp

main.jsp have a link for home.jsp.
home.jsp is a home page for any school.
home.jsp have some link like message, vision, addmission etc.
when i click to any link corresponding data are show in a table in home.jsp.

main.jsp have a link for home.jsp. when i click to this link then home.jsp appear. this table show blank how i fill this table by condition. i do not want it show blank.because it show information only when i click to any link of home.jsp.

G'day,

As i understand it, you have a total of 3 pages;
1. main.jsp
2. home.jsp
3. Home.jsp

When you click on a link from main.jsp and are re-directed to home.jsp you wish to have a table containing data for that school upon the loading of the page.

What you might like to try is when the page loads, before your HTML tags have a section which runs a MySQL query to select all the data from a database table for that particular school.


Regards,
TC

P.S. Are you backing your JSP pages with actual java.class files?? if so, your query running should be rather easy to manage as all you will need to do is run a function to retrieve the data and pass it back to your .jsp page for output.

-1

well what you need to do in order to populate the table upon loading the home.jsp is run a query to your database in the initial loading of the page rather than waiting for a link to be clicked.

For example, if you wish to show the admission details within the table upon loading the page, simply run the function you have created for the link when the page loads.

If you could post your code for home.jsp, it would be much easier to explain.


Are you running straight JSP or are you backing it with Java??

Regards,
TC

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.