Problemas com TomCat

6 respostas
ArthurTurtle

Boa tarde a todos.
Começei com java a pouco tempo, e agora estou fazendo uma aplicação simples para a net com um sistem de tabelas, o meu problema é, eu utilizo JavaScript para fazer alguns recursos dos campos, quando eu rodo pelo alquivo html fica uma beleza tudo certinho, mais quando publico pelo TomCat não roda o JavaScript, ja pesquisei na net e não achei nada… alguem poderia diser o que eu faço pra ele funcionar?

Desde ja agradeço

6 Respostas

Adelar

Verifique se o caminho do JavaScript que o HTML aponta está correto quando colocados no servidor, provavelmente está errado.

[]'s

maykoone

Também verifique onde vc colocou os arquivos js, dependendo do local as páginas HTML não irão acessar os arquivos, se vc colocar por exemplo no WEB-INF não irá acessar. Recomendo que vocẽ utilize o firebug do firefox ou similar em outro navegador e ver qual a mensagem ao acessar o arquivo.

ArthurTurtle

Adelar:
Verifique se o caminho do JavaScript que o HTML aponta está correto quando colocados no servidor, provavelmente está errado.

[]'s

Então isso que eu acho q esta errado… o problema é… onde eu devo colocar os aqruivos JavaScript para serem executados?.. essa é minha duvida…

Vlw

ArthurTurtle
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel=?stylesheet? type=?text/css? href=?estilo.css? />
<meta charset="utf-8">
	<link rel="stylesheet" href="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle//themes/base/jquery.ui.all.css">
	<script type="text/javascript" src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/jquery-1.4.4.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.core.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.widget.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.tabs.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.datepicker.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/external/jquery.bgiframe-2.1.2.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.mouse.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.button.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.draggable.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.position.js"></script>
	<script type="text/javascript" src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.resizable.js"></script>
	<script type="text/javascript"  src="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/ui/jquery.ui.dialog.js"></script>
	<link rel="stylesheet" href="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/demos.css">
	<link rel="stylesheet" href="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/themes/base/jquery.ui.all.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script>
	$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );
	
		$( "#dialog-message" ).dialog({
			modal: true,
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
		});
	});
	</script>
		<script>
	$(function() {
		$( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
		$( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
	});
	</script>
	<style>
	.ui-tabs-vertical { width: 55em; }
	.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
	.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
	.ui-tabs-vertical .ui-tabs-nav li a { display:block; }
	.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
	.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
	</style>
<title>Inicial</title>
</head>
<body>
	<h2>Steno</h2><img src="/home/stenovoice/workspace/Teste/WebContent/logo.png">coloquei o do stenovoice pq não tinha outro<br/>
</head>
<body>
	<div class="demo">
	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">Cadastro</a></li>
			<li><a href="#tabs-2">Consulta</a></li>
			<li><a href="#tabs-3">Relatorios</a></li>
			<li><a href="#tabs-4">Sistema</a></li>
		</ul>
		<div id="tabs-1">
			<h2>Cadastro</h2>
			<h2>Oque deseja cadastrar?</h2>
			<form action="CadastroExecutores.html" >
			<input type="submit" src="ListaContatos.jsp" value="Executores">
			</form>
			<form action="CadastroEmpresas.html">
			<input type="submit" src="Testes.html" value="Empresa">
			</form>
			<form action="CadastroProgramas.html">
			<input type="submit" src="Testes.html" value="Programa">
			</form>
			<form action="CadastroRevisor.html">
			<input type="submit" src="Testes.html" value="Revisor">
			</form>
		</div>
		<div id="tabs-2">
			<h2>Consulta</h2>
			<h2>O que deseja consultar?</h2>
			<form action="ListaContatos.html" >
			<input type="submit" src="" value="Lista de Empregados">
			</form>
			<form action="ListaEmpresas.html">
			<input type="submit" src="Testes.html" value="Lista de Empresas">
			</form>
			<form action="ListaProgramas.html">
			<input type="submit" src="Testes.html" value="Lista de Programas">
			</form>
		</div>
		<div id="tabs-3">
			<h2>Relatório</h2>
			<p>Qual o tipo de relatorio?</p>
			<form action="">
			<input type="button" value="Relatorio de Fechamento" onclick="alert('Ops, esta pagina esta em contrução')">
			</form>
			<FORM>
			<INPUT TYPE="button" Value="Relatorio Individual" onClick="alert('Ops, esta pagina ainda não esta pronta')")>
			</FORM>
		</div>
		<div id="tabs-4">
			<h2>Sistema</h2>
			<form action="">
				Mudar cor de fundo:<br/>
				<INPUT TYPE="button" VALUE="aliceblue" ONCLICK="document.
				bgColor='aliceblue'">
				<INPUT TYPE="button" VALUE="black" ONCLICK="document.
				bgColor='black'"><br/>
				<INPUT TYPE="button" VALUE="blueviolet" ONCLICK="document.
				bgColor='blueviolet'">
				<INPUT TYPE="button" VALUE="silver" ONCLICK="document.
				bgColor='silver'"><br/>
				<INPUT TYPE="button" VALUE="blue" ONCLICK="document.
				bgColor='blue'">
				<INPUT TYPE="button" VALUE="white" ONCLICK="document.
				bgColor='white'"><br/>
				<INPUT TYPE="button" VALUE="red" ONCLICK="document.bgColor='red'">	
			</form>
	</div>
</body>
</html>

Bom galera esse eh meu codigo... como eu disse eu sou meio novo nesse mundo de programação e tudo mais... por isso voces podem achar meu codigo meio feio e tals... o meu problema eh q o JavaScript não ta rodando....

vlww

gilmaslima

Não use o caminho absoluto, se vc trocar de servidor vai ter q mudar o código:

// não faça isso
<link rel="stylesheet" href="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle//themes/base/jquery.ui.all.css">   
    <script type="text/javascript">

crie uma pasta para os seus arquivos .js, e imagens e na sua aplicação acesse assim

<link rel="stylesheet" href="css/jquery.ui.all.css">   
    <script type="text/javascript">
Robinson_Soares

ja instalei:

  • jdk do java
  • Eclipse

Baixei um zip para instalar o TomCat no XP.
porem ao rodar o startup (ja criei a varivavel CATALINA_HOME), dá a seguinte msg:

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

alguem poderia me dar uma dica?

abçs

Robinson

Criado 16 de março de 2011
Ultima resposta 24 de mar. de 2011
Respostas 6
Participantes 5