Fórum Utilizando classes JAVA dentro do JSP #569153
09/04/2009
0

Thiago
Curtir tópico
+ 0Post mais votado
09/04/2009
Thiago

Gostei + 1
09/04/2009
0
Thiago
Curtir tópico
+ 0Post mais votado
09/04/2009
Thiago
Gostei + 1
Mais Posts
09/04/2009
Alice Guimarães
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | <%@ page language="Java" import="ConexaoBD"%> <%@ page import="java.sql.*"%> <%String nome, codigo; codigo = request.getParameter("cod_fornecedor"); ConexaBD con = new ConexaoBD(); String selectFornecedores = "SELECT cod_fornecedor, nome_fantasia FROM cd_fornecedor ORDER BY cod_fornecedor"; ResultSet rs = null; try { rs = stmt.executeQuery(selectFornecedores); } catch ( SQLException sqle ) { String msg = "Erro executando query : " + selectFornecedores + " : " + sqle.getMessage(); throw new Exception(msg); } %> < html > < head > < title >Fornecedores</ title > < meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1" > < link href = "CssLib/estilos.css" rel = "stylesheet" type = "text/css" > < script language = javascript > <!-- function voltar(codigo, nome) { window.close(); window.opener.location = "TESTE.jsp?cod_fornecedor=" + codigo + "&nome=" + nome; } // --> </ script > </ head > < body > < table width = "400" border = "0" > < tr > < td bgcolor = "#DFDFDF" > < div align = "center" >Cód.</ div > </ td > < td colspan = "2" bgcolor = "#DFDFDF" > < div align = "center" >Fornecedores</ div > </ td > </ tr > <% while ( rs.next() ) { String codigo = rs.getString("cod_fornecedor"); String nome = rs.getString("nome_fantasia"); %> < tr > < td width = "50" align = "center" bgcolor = "#EEEEEE" ><%= codigo %></ td > < td bgcolor = "#EEEEEE" ><%= nome %></ td > < td >< a href="javascript:voltar(<%= codigo %>,'<%= nome %>')" > < img border = "0" src = "ImgLib/lupa_p.GIF" /> </ a ></ td > </ tr > <% } %> </ table > </ body > </ html > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error: The import ConexaoBD cannot be resolved An error occurred at line: 4 in the jsp file: /JanelaFornecedores.jsp Generated servlet error: ConexaBD cannot be resolved to a type ... |
Gostei + 0
09/04/2009
Thiago
Gostei + 0
09/04/2009
Alice Guimarães
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <%@page language="Java" import="ConexaoBD" import="java.sql.*"%> <% String nome, codigo; ResultSet rs = null; ConexaBD con = new ConexaoBD(); String selectFornecedores = "SELECT cod_fornecedor, nome_fantasia FROM cd_fornecedor ORDER BY cod_fornecedor"; try { rs = con.pesquisa(selectFornecedores); } catch ( SQLException sqle ) { String msg = "Erro executando query : " + selectFornecedores + " : " + sqle.getMessage(); throw new Exception(msg); } %> < html > < head > < title >Fornecedores</ title > < meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1" > < link href = "CssLib/estilos.css" rel = "stylesheet" type = "text/css" > ... |
Gostei + 0
09/04/2009
Alice Guimarães
Gostei + 0
09/04/2009
Thiago
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)
Inserção de url
Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.