Código funciona em html mas em JSP não

4 respostas
tebosoftware

Bom dia pessoal

estou tendo problema no código a seguir pois ele deveria exibir na janela do navegador um table com largura e altura em 100%, em html (com poucos ajustes de texto a ser exibido) funciona corretamente, só que em jsp não.. alguém poderia me ajudar?

index.jsp

<%-- 
    Document   : index
    Created on : 25/03/2009, 19:11:04
    Author     : Shubacca
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Controle Financeiro</title>
    </head>
    <body>
        <table width="100%" height="100%" border="0">
            <tr valign="top">
                <td height="70" colspan="2"><jsp:include page="titulo.jsp"></jsp:include></td>
            </tr>
            <tr colspan="3">
                <td width="150" align="center" valign="middle"><jsp:include page="menu.jsp"></jsp:include></td>
                <td align="right" valign="top"><jsp:include page="principal.jsp"></jsp:include></td>
            </tr>
            <tr>
                <td height="20" colspan="2" valign="bottom"><jsp:include page="rodape.jsp"></jsp:include></td>
            </tr>
        </table>
        
    </body>
</html>

menu.jsp

<%-- 
    Document   : menu
    Created on : 25/03/2009, 19:19:27
    Author     : Shubacca
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<h1>Menu</h1>
Documentos<br>
Gerar Documentos<br>
Sobre

titulo.jsp

<center><font color="#22FFAA" size="14">Controle Financeiro</font></center>

rodape.jsp

<center><font color="silver" size="2">Tebo Software - 2009</font></center>

principal.jsp

<%-- 
    Document   : principal
    Created on : 25/03/2009, 19:40:13
    Author     : Shubacca
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<h1>Principal</h1>

desde já agradeço

4 Respostas

furutani

Qual o erro?

tebosoftware

O problema é que no jsp o table nao fica em 100% na altura

furutani

abra sua página JSP no browser verifique se o código que é enviado para o o browser condiz com o html que vc montou anteriormente.
As vezes algum desses includes está falhando.

tebosoftware

Descobri como fazer para ficar da maneira que eu quero:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="ctrlfinanceiro.css" />
        <title>Controle Financeiro</title>
        <style type="text/css">
            html,body { height: 100%; }
        </style>

    </head>
    <body>
        <table width="100%" height="100%" border="0">
            <tr valign="top">
                <td height="50" colspan="2"><jsp:include page="titulo.jsp"></jsp:include></td>
            </tr>
            <tr colspan="3">
                <td width="150" valign="top"><jsp:include page="menu.jsp"></jsp:include></td>
                <td valign="top">
                    <jsp:include page='<%=(String)request.getAttribute("pagina") %>'></jsp:include>
                </td>
            </tr>
            <tr>
                <td height="50"  colspan="2" valign="bottom"><jsp:include page="rodape.jsp"></jsp:include></td>
            </tr>
        </table>
    </body>
</html>

coloquei o css para colocar o html e o body com altura de 100%

falow

Criado 28 de março de 2009
Ultima resposta 30 de mar. de 2009
Respostas 4
Participantes 2