5
respostas

Layout da página tá tudo zoado

Deu certo o deploy no Heroku, mas o layout da página ao acessar pelo navegador está daquele jeito zoado, quando fica tudo pra esquerda, sem as imagens e as configurações de css.

5 respostas

Oi Henrique, boa tarde. Manda os códigos dos seu arquivo : pageTemplate.tag

Também tive esse problema e resolvi ajustando os endereços dos links referentes aos arquivos css, o arquivo final ficou assim:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ attribute name="titulo" required="true" %>
<%@ attribute name="bodyClass" required="false" %>
<%@ attribute name="extraScripts" fragment="true" %>

<c:url value="/" var="contextPath" />

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <link rel="icon" href="//cdn.shopify.com/s/files/1/0155/7645/t/177/assets/favicon.ico?11981592617154272979" type="image/ico" />
        <link href="https://plus.googlecom/108540024862647200608" rel="publisher" />
        <title>${titulo } - Casa do Código</title>
        <link href="${contextPath}resources/css/cssbase-min.css" rel="stylesheet" type="text/css" media="all" />
        <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' />
        <link href="${contextPath}resources/css/fonts.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-ie7.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-embedded.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/layout-colors.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/responsive-style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/guia-do-programador-style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/produtos.css" rel="stylesheet" type="text/css" media="all" />
        <link rel="canonical" href="http://www.casadocodigo.com.br/" />
        <link href="${contextPath}resources/css/book-collection.css" rel="stylesheet" type="text/css" media="all" />
    </head>
    <body class="${bodyClass}">
    <%@ include file="/WEB-INF/views/cabecalho.jsp" %>
    <jsp:doBody />
        <jsp:invoke fragment="extraScripts"></jsp:invoke>
    <%@ include file="/WEB-INF/views/rodape.jsp" %>
        </body>
</html>

Também tive um problema de não aparecer o logo e arrumei editando o arquivo cabecalho.jsp:

<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
    prefix="security"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:url value="/" var="contextPath" />

<header id="layout-header">
    <div class="clearfix container">

        <a href="${contextPath}">
            <img id="logo" alt="Logo" src="${contextPath}resources/imagens/cdc-logo.svg"> 
        </a>

Abraço,

Olá, Daniel. Obrigado pela resposta.

Meu pageTemplate.tag está assim:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ attribute name="titulo" required="true" %>
<%@ attribute name="bodyClass" required="false" %>
<%@ attribute name="extraScripts" fragment="true" %>

<c:url value="/" var="contextPath" />

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <link rel="icon" href="//cdn.shopify.com/s/files/1/0155/7645/t/177/assets/favicon.ico?11981592617154272979" type="image/ico" />
        <link href="https://plus.googlecom/108540024862647200608" rel="publisher" />
        <title>${titulo } - Casa do Código</title>
        <link href="${contextPath}resources/css/cssbase-min.css" rel="stylesheet" type="text/css" media="all" />
        <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' />
        <link href="${contextPath}resources/css/fonts.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-ie7.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-embedded.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/layout-colors.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/responsive-style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/guia-do-programador-style.css" rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/produtos.css" rel="stylesheet" type="text/css" media="all" />
        <link rel="canonical" href="http://www.casadocodigo.com.br/" />
        <link href="${contextPath}resources/css/book-collection.css" rel="stylesheet" type="text/css" media="all" />
    </head>
    <body class="${bodyClass}">

    <%@ include file="/WEB-INF/views/cabecalho.jsp" %>

    <jsp:doBody />

    <jsp:invoke fragment="extraScripts"></jsp:invoke>

    <%@ include file="/WEB-INF/views/rodape.jsp" %>

    </body>
</html>

Assim que for possível, eu vou fazer a comparação com o que você postou e fazer os devidos ajustes.

Obrigado!

Acredito que esteja igual. Quais erros aparecem quando você abre o console do navegador (ferramentas do desenvolvedor)?

Cara, eu acabei abandonando este projeto. Comecei outro e estou usando a porta 8080 no Tomcat. Como eu não manjo dessas coisas, fico com medo de tentar subir esse projeto de novo e dar pau no que estou fazendo agora hahaha.

Mas obrigado aí pela ajuda!!

Tranquilo, boa sorte aí!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software