Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2004

Tip: Looking for answers? Try searching our database.

Where is the error?

Thread view: 
Piotre Ugrumov - 02 Jan 2004 11:37 GMT
I have tried to create this jsp page. I select from a HTML page a file. From
the page HTML I call the page JSP to show the path of the file. The path is
holden in a database. I have registered the database with ODBC.
When I try to start this page IE returns to me an error.
Here there are the first.htm e the first.jsp, where are the errors?
Thanks.

first.htm
<html><head>
<title>Sondaggio</title>
</head>

<body>

<b><big>Domanda:</big></b>
<form action="first.jsp">
<input name="risposta" type="radio" value="0">prova<br>
<input name="risposta" type="radio" value="1">prova<br>
<input name="risposta" type="radio" value="2">prova<br>
<input name="risposta" type="radio" value="3">prova<br>
<input type="submit" value="vota">
</form>
</font>
</body>
</html>

first.jsp
<%@ page contentType="text/html; charset=" language="java"
import="java.sql.*" errorPage="" %>
<html>
<head>
<title>Sondaggio</title>
</head>
<body>
<font face="verdana" color="#3300ff" size="2">
<%

   Connection conn = null;

   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

   conn = DriverManager.getConnection("jdbc:odbc:file","","");
String final;
String preferenza = new String (request.getParameter("risposta"));
   Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT Path FROM Disponibili WHERE
NomeFile=" + risposta);
rs.next();
final=rs.getString("Path");
out.print(final);
   st.close();
   conn.close();
%>
<br><br>
</font>
</body>
</html
Christophe Vanfleteren - 02 Jan 2004 11:48 GMT
> I have tried to create this jsp page. I select from a HTML page a file.
> From the page HTML I call the page JSP to show the path of the file. The
[quoted text clipped - 53 lines]
> </body>
> </html>
...
String final;
...

final is a keyword, give it another name.

Signature

Kind regards,
Christophe Vanfleteren

Piotre Ugrumov - 03 Jan 2004 08:51 GMT
> > I have tried to create this jsp page. I select from a HTML page a file.
> > From the page HTML I call the page JSP to show the path of the file. The
[quoted text clipped - 60 lines]
>
> --
I have modified the name of the string but now there's another error
message:
type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: Unsupported encoding:

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:94)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:406
)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:151
)
    org.apache.jasper.compiler.JspUtil.getReader(JspUtil.java:1062)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:241)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:146)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:132)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:245)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5
55)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
00)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

How can I resolve this problem?

Thanks
Christophe Vanfleteren - 03 Jan 2004 10:15 GMT
>> > first.jsp
>> > <%@ page contentType="text/html; charset=" language="java"
[quoted text clipped - 46 lines]
>
> org.apache.jasper.JasperException: Unsupported encoding:

<snip stacktrace/>

<%@ page contentType="text/html; charset="

Try setting a real charset, like utf-8 for example.

Signature

Kind regards,
Christophe Vanfleteren



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.