Intanto ciao a tutti!
Premettoo che sono una new entry per quanto riguarda la tecnologia jsp ma adesso ho necessità di imparare a utilizzarla.
Ho installato sul mio mac versione 10.5.6 il tomcat 6.0.18 e il server sembra girare senza problemi...ho provato poi a realizzare una jsp di prova che usa un java bean utilizzando eclipse ganymede...
il codice della pagina jsp è il seguente:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Questa e' la mia prima jsp</title>
</head>
<body>
<jsp:useBean id="utente" scope="session" class="MioBean" />
<%out.print("1"); %>
</body>
</html>
mentre quello del bean (di nome MioBean.java) è questo:
public class MioBean {
private String nome;
public MioBean() {
nome="ciao";
}
public void setNome(String nome) {
this.nome=nome;
}
public String getNome() {
return nome;
}
}
Quando per mando in esecuzione mi da il seguente errore:
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:
An error occurred at line: 10 in the jsp file: /prova.jsp
MioBean cannot be resolved to a type
7: <title>Questa e' la mia prima jsp</title>
8: </head>
9: <body>
10: <jsp:useBean id="utente" scope="session" class="MioBean" />
11: <%out.print("1"); %>
12: </body>
13: </html>
An error occurred at line: 10 in the jsp file: /prova.jsp
MioBean cannot be resolved to a type
7: <title>Questa e' la mia prima jsp</title>
8: </head>
9: <body>
10: <jsp:useBean id="utente" scope="session" class="MioBean" />
11: <%out.print("1"); %>
12: </body>
13: </html>
An error occurred at line: 10 in the jsp file: /prova.jsp
MioBean cannot be resolved to a type
7: <title>Questa e' la mia prima jsp</title>
8: </head>
9: <body>
10: <jsp:useBean id="utente" scope="session" class="MioBean" />
11: <%out.print("1"); %>
12: </body>
13: </html>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:317)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:295)
org.apache.jasper.compiler.Compiler.compile(Compil er.java:282)
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Inoltre ho notato che durante lo startup del server si avvia correttamente solo in modalità root e mi da il seguente risultato:
macbookAlessio:~ root# /Library/Tomcat/bin/startup.sh
Using CATALINA_BASE: /Library/Tomcat
Using CATALINA_HOME: /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME: /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
mentre in modalità utente normale mi dice:
macbookAlessio:~ alessio$ /Library/Tomcat/bin/startup.sh
Using CATALINA_BASE: /Library/Tomcat
Using CATALINA_HOME: /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME: /Library/Java/Home
touch: /Library/Tomcat/logs/catalina.out: Permission denied
/Library/Tomcat/bin/catalina.sh: line 292: /Library/Tomcat/logs/catalina.out: Permission denied
qual'è secondo voi il problema?? grazie anticipatamente..