|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
javabean + jsp file + tomcat
Hello.
I'm using Tomcat 4.0.6 I'm new to javabean and trying to use it. My jsp file looks like this <%@include file="configuration.jsp"%> <html> <head> </head> <body> <jsp:useBean id="searcher" class="Find" /> <jsp:setProperty name="searcher" property="indexName" value="indexLocation"/> <li> The indexName is: <jsp:getProperty name="searcher" property="indexName"/> </body> </html> ____________________________________________________ this is configuration.jsp <% String indexLocation = "C:/eclipse-SDK-2.0-win32/eclipse/workspace/Test/index"; %> ____________________________________________________ this is Find.java import java.util.*; import java.io.*; import org.apache.lucene.analysis.*; import org.apache.lucene.document.*; import org.apache.lucene.index.*; import org.apache.lucene.search.*; import org.apache.lucene.queryParser.*; import org.apache.lucene.demo.*; import org.apache.lucene.demo.html.Entities; import java.io.Serializable; public class Find implements Serializable { String indexName; Find(){} public void setIndexName(String name) { indexName = name; } public String getIndexName() { return indexName; } } ____________________________________________________ I get this error message type Exception report message Internal Server Error description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated. An error occurred at line: 44 in the jsp file: /SearchResult.jsp Generated servlet error: C:\jakarta-tomcat-4.0.6\work\Standalone\localhost\jbtest\SearchResult$jsp.java:121: Class org.apache.jsp.Find not found. Find searcher = null; ^ An error occurred at line: 44 in the jsp file: /SearchResult.jsp Generated servlet error: C:\jakarta-tomcat-4.0.6\work\Standalone\localhost\jbtest\SearchResult$jsp.java:124: Class org.apache.jsp.Find not found. searcher= (Find) ^ An error occurred at line: 44 in the jsp file: /SearchResult.jsp Generated servlet error: C:\jakarta-tomcat-4.0.6\work\Standalone\localhost\jbtest\SearchResult$jsp.java:129: Class org.apache.jsp.Find not found. searcher = (Find) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Find"); ^ An error occurred at line: 49 in the jsp file: /SearchResult.jsp Generated servlet error: C:\jakarta-tomcat-4.0.6\work\Standalone\localhost\jbtest\SearchResult$jsp.java:155: Class org.apache.jsp.Find not found. out.print(JspRuntimeLibrary.toString((((Find)pageContext.findAttribute("searcher")).getIndexName()))); ^ 4 errors, 1 warning I have tried to solve this problem but are not getting anywhere. the different file are located in: C:\jakarta-tomcat-4.0.6\webapps\jbtest\SearchResult.jsp C:\jakarta-tomcat-4.0.6\webapps\jbtest\Configuration.jsp C:\jakarta-tomcat-4.0.6\webapps\jbtest\WEB-INF\classes\Find.class C:\jakarta-tomcat-4.0.6\webapps\jbtest\WEB-INF\lib\lucene-1.2.jar |
|
#2
|
|||
|
|||
|
And if I add this line
<%@ page import = "Find" %> in the jsp file i get this error Class java.beans.Beans can not access a member of class Find with modifiers "" I have also tried to put the Find.java in a package but that didn't help either |
|
#3
|
|||
|
|||
|
Post the whole error message that contains this:
Class java.beans.Beans can not access a member of class Find with modifiers "" Also post the code for the class Find |
|
#4
|
|||
|
|||
|
try this:
put your Find in a package, e.g. tool. and use <jsp:useBean id="searcher" class="tools.Find" /> looks like your container doesn't like the default-package, and assumes org.apache.jsp as package. i had a similar problem with a servlet. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > javabean + jsp file + tomcat |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|