Ajuda, com Struts e CSS

6 respostas
C

Gente ta acontecendo algo muito loco, que eu não consigo resolver.

é o seguinte, tenho minha clientes.jsp ela abre normalmente com a config do CSS legal, ai quando eu dou um pesquisar que ela vai para o struts ela volta com o resultado da pesquisa so que toda desconfigurada como se não achasse o CSS, mas é a mesma JSP que abriu na primeira vez…

Alguem já passou por isso??

6 Respostas

ramonchiara

Posta os códigos aí senão não dá para ver o pq acontece isso…

C
STRUTS CONFIG
<action name="clientesForm" path="/cadastro/clientes" scope="request"   type="dex.cadastros.clientes.action.EmpresaAction"   validate="false">
			<forward name="cadastro"  path="/pages/cadastros/empresas/cadastro_empresas.jsp"   />
			<forward name="pesquisar" path="/pages/cadastros/empresas/pesquisar_empresas.jsp"  />			
		</action>

JSP

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head>
<base href="<%=getServletContext().getInitParameter("contextPath")%>">
<!-- PARA NÃO FAZER CACHE E POSSIBILITAR A ATUALIZAÇÃO DO CONTEÚDO -->
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Pragma" content="no-cache">
<META http-equiv="Expires" content="0">
<title>JSa&uacute;de</title>

<link href="config/master.css" rel="stylesheet" type="text/css">
<link href="../../config/master.css" rel="stylesheet" type="text/css">

<link type="text/css" href="../../template.css" rel="stylesheet" />
<link type="text/css" href="../../style/estilo.css" rel="stylesheet" />
<link type="text/css" href="../../style/segmento.css" rel="stylesheet" />
<link type="text/css" href="../template.css" rel="stylesheet" />
<link type="text/css" href="../style/estilo.css" rel="stylesheet" />
<link type="text/css" href="/style/estilo.css" rel="stylesheet" />
<link type="text/css" href="/style/segmento.css" rel="stylesheet" />


<script type="text/javascript" src="../../javascript/pesquisar_clientes.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title></title>
</head>

<body bgcolor="#FFFFFF">
<html:form action="/cadastro/clientes.do" focus="codigo">

<table align="center" width="547" border="0" cellspacing="0"
	cellpadding="0">
	<tr>
		<td width="543">
		<table class="baQuad1" width="543" border="0" cellspacing="1"
			cellpadding="0">
			<tr>
				<td colspan="4" align="left" class="baTit">&nbsp; Pesquisa de Clientes</td>
			</tr>
			<tr>
			<tr>
			<td>&nbsp;</td>
			</tr>
			<td class="baFont">&nbsp;Codigo :</td>
				<td >
					<input type="text" name="codigo" id="codigo" class="baInputs" size="10" maxlength="10" />
				</td>
				<td class="baFont" align="left">&nbsp;Cliente :</td>
				<td>
					<input type="text" name="cliente" id="cliente" class="baInputs" size="40" maxlength="60" />
				</td>
				
			</tr>
			<tr>
				<td >&nbsp;</td>
				<td></td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td height="20%" colspan="4" align="center">
				<input type="button" name="Botao2" class="BUTTON" value="Pesquisar" onClick="pesquisarClientes(this.form);">
				<input type="hidden" name="fluxo">
				</label></td>
			</tr>
		</table>
		</td>
	</tr>
		<logic:present name="arrayProdutosMovimentacao">
					<bean:size id="tamanhoArrayProdutos" name="arrayProdutosMovimentacao" />
					<TR>
					  <TD width="610">
						<TABLE width="100%" border="0" cellpadding="0" cellspacing="0" class="baTit">
						  <TR>
							<TD valign="middle" class="baTit">
							  <DIV align="center"> <FONT color="#FFFFFF" size="2"> <STRONG>Resultado da Busca</STRONG> </FONT> </DIV></TD>
						  </TR>
						</TABLE>
					  </TD>
				  	</TR>
					<TR>
					  <TD class="baTit" width="610">
						  <logic:greaterThan name="tamanhoArrayProdutos" value="0" >
							  <table width="100%"  border="00" cellpadding="3" cellspacing="1" class="baTit">
								<tr align="center" class="baTit">
								  <td width="10%"><strong>C&oacute;digo</strong></td>
								  <td width="90%"><strong>Cliente</strong></td>							  
								</tr>
								<% String cor[] = { "#94CFEF", "#BDDFEF" }; %>
								<% int j = 0; %>
								  <logic:iterate name="arrayProdutosMovimentacao" id="produto" >
									<tr align="center" class="baTit">
										<% j = (j == 1 ? 0 : 1); %>
										<td bgcolor="<%= cor[j] %>" >
											<FONT color="#003366" size="1">
												<bean:write name="produto" property="codigoCliente"/>
											</FONT>
										</td>
										<td bgcolor="<%= cor[j] %>">
											<FONT color="#003366" size="1">
												<bean:write name="produto" property="nomeCliente"/>
											</FONT>
										</td>
																		  
									</tr>
								</logic:iterate>
							  </table>
						  </logic:greaterThan>

						<logic:equal name="tamanhoArrayProdutos" value="0">
							<table width="100%" border="00" cellspacing="1" cellpadding="3" class="baTit">
								<tr bgcolor="#BDDFEF" align="center" > 
								  <td height="40" colspan="9" align="center">
										<br> 
										<FONT color="#003366" size="1">
											<STRONG> NÃO EXISTEM PRODUTOS NO ESTOQUE PARA OS CRITÉRIOS DE PESQUISA INFORMADOS </STRONG>
										</FONT>
										<br>
										<br>
								  </td>
								</tr>
						  </table>						
						</logic:equal>

					</TD>
				  </TR>
				  </logic:present>
</table>

<br />
<br></br>
<br></br>
<br></br>
<br></br>
</html:form>
</body>
</html:html>
ramonchiara

o seu controller está mudando de pasta (na url)???
pq se estiver, sua base estará mudando junto: <base href="<%=getServletContext().getInitParameter(“contextPath”)%>">
Verifica isso…

ramonchiara

Outro coisa me chamou a atenção:

esses …/…/…/…/…/./././././…/./… :slight_smile:
são arquivos diferentes mesmo ou isso é pog??? :slight_smile:
não tem taglib para isso???

C

Cara, deu certo coloquei o href="<%=getServletContext().getInitParameter(“contextPath”)%>">,
era isso mesmo!!!

Para a outra resposta os ././././ era testes, pois como estava mudando o path eu tava apontando para varios lugares…

VALEU A todos pela ajuda!!

ramonchiara

só para constar, acho que você pode usar getServletContext().getContextPath() ao invés de usar getInitParameter()…

Criado 10 de julho de 2008
Ultima resposta 11 de jul. de 2008
Respostas 6
Participantes 2