Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with JSP and HTML frames

Status
Not open for further replies.

boske3

Programmer
Mar 11, 2006
20
RS
Hello!
I have one problem.I want to make JSP page with html
frame in it.I want one page with two horizontal frame
and in upper frame when someone submit something to
display in lower page.I want to make all of this pages
in JSP exstension and to call it up.jsp and down.jsp.
I try something but it doesn`t work.
can anyone have any idea or solution of this problem?
 
Well i finally find solution for my problem
I have 3 files like this:

**********************
index.jsp
**********************
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<!-- This tags I delete
<body>
-->
<frameset rows="50%,50%">
<frame src="header.jsp"/>
Some text
<frame src="footer.jsp"/>
</frameset>
<!-- This tags I delete
</body>
-->

</html>

*****************
header.jsp
*****************
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP gore</title>
</head>
<h1>JSP header</h1>
</html>

***************
footer.jsp
***************
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<h1>JSP footer</h1>
</html>

Problem was that i wasn`t able to see those frames in my browser.
Solution was to delete <body></body> tags in all jsp files.
I don`t now why is that but now it works and i can see my files browser.
Does anyone know why those tags can`t be in jsp frame files.?
 
It makes sense to remove them from your index.jsp file. BODY tags are not allowed if FRAMESET tags are used.

As far as your header and footer JSPs go, I'm not too surprised that they work without specifying where the BODY tags go (HTML can be forgiving), but it's not good form to leave them out and I cannot fathom why they would fail to show when you leave them in. I can only imagine that there was some other contributing factor.

Leaving them out of index.jsp, what happens when you put them (the body tags) back into the other two JSPs?

Dave

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...east is east and west is west and if you take cranberries and stew them like applesauce
they taste much more like prunes than rhubarb does
[infinity]
 
When i put body tags in other to jsp files i can't see any of those to files in frames. I had to move those body tags and now works excellent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top