Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 30th, 2003, 07:39 AM
tomato tomato is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 tomato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 31st, 2003, 04:20 AM
tomato tomato is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 tomato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old August 1st, 2003, 09:33 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
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

Reply With Quote
  #4  
Old August 5th, 2003, 07:43 AM
tkramer811 tkramer811 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: germany
Posts: 18 tkramer811 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > javabean + jsp file + tomcat


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT