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?
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><linkrel=?stylesheet?type=?text/css?href=?estilo.css?/><metacharset="utf-8"><linkrel="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"><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><scripttype="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><linkrel="stylesheet"href="http://189.20.246.66:8080/home/stenovoice/workspace/Servers/Tomcat v6.0 Server at localhost-config/development-bundle/demos.css"><linkrel="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"><metahttp-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-navli{clear:left;width:100%;border-bottom-width:1px!important;border-right-width:0!important;margin:0-1px.2em0;}.ui-tabs-vertical.ui-tabs-navlia{display:block;}.ui-tabs-vertical.ui-tabs-navli.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><imgsrc="/home/stenovoice/workspace/Teste/WebContent/logo.png">coloquei o do stenovoice pq não tinha outro<br/></head><body><divclass="demo"><divid="tabs"><ul><li><ahref="#tabs-1">Cadastro</a></li><li><ahref="#tabs-2">Consulta</a></li><li><ahref="#tabs-3">Relatorios</a></li><li><ahref="#tabs-4">Sistema</a></li></ul><divid="tabs-1"><h2>Cadastro</h2><h2>Oque deseja cadastrar?</h2><formaction="CadastroExecutores.html"><inputtype="submit"src="ListaContatos.jsp"value="Executores"></form><formaction="CadastroEmpresas.html"><inputtype="submit"src="Testes.html"value="Empresa"></form><formaction="CadastroProgramas.html"><inputtype="submit"src="Testes.html"value="Programa"></form><formaction="CadastroRevisor.html"><inputtype="submit"src="Testes.html"value="Revisor"></form></div><divid="tabs-2"><h2>Consulta</h2><h2>O que deseja consultar?</h2><formaction="ListaContatos.html"><inputtype="submit"src=""value="Lista de Empregados"></form><formaction="ListaEmpresas.html"><inputtype="submit"src="Testes.html"value="Lista de Empresas"></form><formaction="ListaProgramas.html"><inputtype="submit"src="Testes.html"value="Lista de Programas"></form></div><divid="tabs-3"><h2>Relatório</h2><p>Qual o tipo de relatorio?</p><formaction=""><inputtype="button"value="Relatorio de Fechamento"onclick="alert('Ops, esta pagina esta em contrução')"></form><FORM><INPUTTYPE="button"Value="Relatorio Individual"onClick="alert('Ops, esta pagina ainda não esta pronta')")></FORM></div><divid="tabs-4"><h2>Sistema</h2><formaction="">
Mudar cor de fundo:<br/><INPUTTYPE="button"VALUE="aliceblue"ONCLICK="document. bgColor='aliceblue'"><INPUTTYPE="button"VALUE="black"ONCLICK="document. bgColor='black'"><br/><INPUTTYPE="button"VALUE="blueviolet"ONCLICK="document. bgColor='blueviolet'"><INPUTTYPE="button"VALUE="silver"ONCLICK="document. bgColor='silver'"><br/><INPUTTYPE="button"VALUE="blue"ONCLICK="document. bgColor='blue'"><INPUTTYPE="button"VALUE="white"ONCLICK="document. bgColor='white'"><br/><INPUTTYPE="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<linkrel="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"><scripttype="text/javascript">
crie uma pasta para os seus arquivos .js, e imagens e na sua aplicação acesse assim
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