M
Maxi
Where should I place my java file and JSP page in tomcat? I have installed
Tomcat here C:\jakarta-tomcat-4.1.24\.
Can anyone help me out. I have spend 2 days but I can get this simple (jsp &
beans) example to work. I am getting this error
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:49: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] JavaBean catalystInfo = null;
[javac] ^
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:51: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] catalystInfo = (JavaBean)
pageContext.getAttribute("catalystInfo", PageContext.SESSION_SCOPE);
[javac] ^
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:54: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] catalystInfo = (JavaBean)
java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JavaBean");
[javac] ^
[javac] 3 errors
-----------JavaBean.java---------------
import java.beans.*;
public class JavaBean extends Object implements java.io.Serializable {
private static String visionText;
public JavaBean() {
visionText = "Hello, World! Beans really work!";
}
public String getVisionText() {
return visionText;
}
public void setVisionText(String visionText) {
this.visionText = visionText;
}
}
--------------hej.jsp-----------------
<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>
<jsp:useBean id="catalystInfo" scope="session" class="JavaBean">
</jsp:useBean>
<p>Vision Text</p>
<form method="post" action="vision3.jsp">
<textarea name="visionText" cols="80" rows="25">
<jsp:setProperty name="catalystInfo" property="*" />
</textarea>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
Tomcat here C:\jakarta-tomcat-4.1.24\.
Can anyone help me out. I have spend 2 days but I can get this simple (jsp &
beans) example to work. I am getting this error
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:49: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] JavaBean catalystInfo = null;
[javac] ^
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:51: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] catalystInfo = (JavaBean)
pageContext.getAttribute("catalystInfo", PageContext.SESSION_SCOPE);
[javac] ^
[javac]
C:\jakarta-tomcat-4.1.24\work\Standalone\localhost\examples\jsp\hej_jsp.java
:54: cannot resolve symbol
[javac] symbol : class JavaBean
[javac] location: class org.apache.jsp.hej_jsp
[javac] catalystInfo = (JavaBean)
java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JavaBean");
[javac] ^
[javac] 3 errors
-----------JavaBean.java---------------
import java.beans.*;
public class JavaBean extends Object implements java.io.Serializable {
private static String visionText;
public JavaBean() {
visionText = "Hello, World! Beans really work!";
}
public String getVisionText() {
return visionText;
}
public void setVisionText(String visionText) {
this.visionText = visionText;
}
}
--------------hej.jsp-----------------
<%@page contentType="text/html"%>
<html>
<head><title>JSP Page</title></head>
<body>
<jsp:useBean id="catalystInfo" scope="session" class="JavaBean">
</jsp:useBean>
<p>Vision Text</p>
<form method="post" action="vision3.jsp">
<textarea name="visionText" cols="80" rows="25">
<jsp:setProperty name="catalystInfo" property="*" />
</textarea>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>