Me ajudem por FAVOR!

4 respostas
8

Eu criei um layout em html, criei tambem 3 metodos (menu a esquerda, o topo onde fica o logo com alguns botões, e o radapé), quero saber como posso chamar meu metodo (que esta em .java) dentro da meu layout html???[color=red][/color][size=18][/size]

segue um exemplo do metodo:

public class CriarLayouts {

String path = "Imagens/";

public String cabecalho() {
	String table =	"<table width='99%' border='0' align='center' cellpadding='0' cellspacing='0'>";
    table += "<tr>"; 
    table += "&lt;td width='1%' height='19' &gt;<img src='"+path+"BarraCimaLogoPontaEsq.jpg' width='18' height='19'>&lt;/td&gt;";
	table += "&lt;td width='97%' bgcolor='#667BB4'&gt; &lt;/td&gt;";
	table += "&lt;td width='2%'&gt;<img src='"+path+"BarraCimaLogoPontaDir.jpg' width='18' height='19'>&lt;/td&gt;&lt;/tr&gt;";
	        
	table += "&lt;/table&gt;";
	table += "&lt;table width='98%' height='175' border='0' align='center' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'&gt;";
	table += "&lt;tr&gt;"; 
	table += "&lt;td height='175'&gt;"; 
	table += "&lt;table width='100%' height='218' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'&gt;";
	table += "&lt;tr&gt;"; 
	table += "&lt;td width='100%'&gt;&lt;/td&gt;";
	table += "&lt;/tr&gt;";
	table += "&lt;tr&gt;"; 
	table += "&lt;td width='100%' height='166'&gt;"; 
	table += "&lt;table width='100%' height='166' border='0' cellpadding='0' cellspacing='0'&gt;";
	table += "&lt;tr&gt;"; 
	table += "&lt;td width='12%' height='166'&gt; &lt;div align='center'&gt;<img border='0' src='"+path+"LogoCmagnani.jpg' width='82' height='88'>&lt;/div&gt;&lt;/td&gt;";
	table += "&lt;td&gt;&lt;/td&gt;";
	table += "&lt;/tr&gt;";
	table += "&lt;/table&gt;&lt;/td&gt;";
	table += "&lt;/tr&gt;";
	table += "&lt;tr&gt;"; 
	table += "&lt;td width='100%' height='52'&gt; &lt;table width='100%' height='52' border='0' cellpadding='0' cellspacing='0'&gt;";
	table += "&lt;tr valign='bottom'&gt;"; 
	table += "&lt;td width='45' background='"+path+"LogoPart1.jpg'&gt; &lt;div align='center'&gt;&lt;/div&gt;&lt;/td&gt;";
	table += "&lt;td width='660' background='"+path+"LogoPart1-2.jpg'&gt;<a href='#'> </a>"; 
	table += "&lt;table width='88%' height='0' border='0' align='left'&gt;";
	table += "&lt;tr valign='bottom'&gt;"; 
	table += "&lt;td width='23' height='32'&gt;<a href='#'><img src='"+path+"BT1.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='23'&gt;<a href='#'><img src='"+path+"BT2.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='23'&gt;<a href='#'><img src='"+path+"BT3.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='23'&gt;<a href='#'><img src='"+path+"BT4.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='23'&gt;<a href='#'><img src='"+path+"BT5.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='23'&gt;<a href='#'><img src='"+path+"BT6.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
	table += "&lt;td width='228'&gt;<a href='#'><img src='"+path+"BT7.jpg' alt='Texto do Botão' width='23' height='25' border='0'></a>&lt;/td&gt;";
  	table += "&lt;/tr&gt;";
  	table += "&lt;/table&gt;";
  	table += "<font color='#EFEFEF'> </font>&lt;/td&gt;";
  	table += "&lt;td width='206' background='"+path+"LogoPart2.jpg' &gt;&lt;/td&gt;";
  	table += "&lt;/tr&gt;";
  	table += "&lt;/table&gt;&lt;/td&gt;";
  	table += "&lt;/tr&gt;";
  	table += "&lt;/table&gt;";
  	table += "&lt;/td&gt;";
  	table += "&lt;/tr&gt;";
  	return table += "&lt;/table&gt;";
   }

}

4 Respostas

8

???

Luca

Olá

  1. Mensagens com título indefinido (Urgente, Socorro, Me ajudem, etc.) geralmente ninguém lê;

  2. Código não identado (fora das tags Code) também quase ninguém lê.

Portanto, não acredito que este tópico vá ter respostas que o atendam.

[]s
Luca

_fs

Bem vindo!

Algumas dicas adicionais:

  1. Quando for postar QUALQUER código, mesmo que seja um pedacinho minúsculo, coloque-o entre as tags [ code]seucodigo[ /code]. Assim, além de ficar endentado, o fórum não vai fazer o parse das tags HTML.
  2. Para mudar o título do tópico, clique em ‘editar’ e seja feliz.

E respondendo o que eu ACHO que foi sua dúvida, você precisa estudar Servlets, mas não aconselho isto. Primeiro estude o básico do Java.

Dica: quando precisar concatenar Strings, use a classe StringBuffer. O porquê você encontra aqui:
http://www.guj.com.br/java.artigo.103.1.guj

leomc

pra finalizar, depois que vc estudar jsp/servlets veja como criar taglib com o jsp 2.0

Criado 9 de março de 2005
Ultima resposta 10 de mar. de 2005
Respostas 4
Participantes 4