Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Bean cannot be resolved to a type
Bean cannot be resolved to a type [message #211635] Thu, 03 April 2008 01:51 Go to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

After doing some learning about the Data Tools Platform stuff, I'm back
trying to write a tutorial for JSP and servlets. I have a perplexing
problem. I know there is some mystery surrounding packages with respect
to JSPs. Yet, in my project, there shouldn't be much ambiguity.

Despite seeing my bean's class file on the path
WebContent/classes/<package-path>/GreetingBean.class, Eclipse gives me
the error, "GreetingBean cannot be resolved to a type" in my JSP trying
to use it. The two lines with errors are marked below, but you can see
the very screen shot including Project Explorer at the URL following it.


<%! GreetingBean greeting = new GreetingBean(); %> *******
<h1 class="heading"> Get Greeting and Color </h1>

<form action="GreetingAndColor" method="post" enctype="text/plain">
<table>
<tr><td class="query-prompt"> Greeting: </td>
<td>
<input type="text"
name="greeting"
size="60"
value="<%= greeting.getGreeting() %>" /> *****
</td>
</tr>

http://www.windofkeltia.com/j2ee/tut-images/greetingbean.jpg

I'd appreciate any pointers, cat-calls or wolf-whistling that can help
me at this point. I've cleaned the project several times, but I can't
seem to get past this problem.

Many thanks,

Russ Bateman
Re: Bean cannot be resolved to a type [message #211677 is a reply to message #211635] Thu, 03 April 2008 10:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi,

it seems you are missing the package imports. Add this to your JSPs:

<%@page import="my.package.*, my.package.GreetingBean"%>

Best regards

Wolfgang

Windofkeltia schrieb:
> After doing some learning about the Data Tools Platform stuff, I'm back
> trying to write a tutorial for JSP and servlets. I have a perplexing
> problem. I know there is some mystery surrounding packages with respect
> to JSPs. Yet, in my project, there shouldn't be much ambiguity.
>
> Despite seeing my bean's class file on the path
> WebContent/classes/<package-path>/GreetingBean.class, Eclipse gives me
> the error, "GreetingBean cannot be resolved to a type" in my JSP trying
> to use it. The two lines with errors are marked below, but you can see
> the very screen shot including Project Explorer at the URL following it.
>
>
> <%! GreetingBean greeting = new GreetingBean(); %> *******
> <h1 class="heading"> Get Greeting and Color </h1>
>
Re: Bean cannot be resolved to a type [message #211685 is a reply to message #211677] Thu, 03 April 2008 12:58 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Wolfgang Knauf wrote:
> Hi,
>
> it seems you are missing the package imports. Add this to your JSPs:
>
> <%@page import="my.package.*, my.package.GreetingBean"%>
>
> Best regards
>
> Wolfgang
>
> Windofkeltia schrieb:
>> After doing some learning about the Data Tools Platform stuff, I'm
>> back trying to write a tutorial for JSP and servlets. I have a
>> perplexing problem. I know there is some mystery surrounding packages
>> with respect to JSPs. Yet, in my project, there shouldn't be much
>> ambiguity.
>>
>> Despite seeing my bean's class file on the path
>> WebContent/classes/<package-path>/GreetingBean.class, Eclipse gives me
>> the error, "GreetingBean cannot be resolved to a type" in my JSP
>> trying to use it. The two lines with errors are marked below, but you
>> can see the very screen shot including Project Explorer at the URL
>> following it.
>>
>>
>> <%! GreetingBean greeting = new GreetingBean(); %> *******
>> <h1 class="heading"> Get Greeting and Color </h1>

Thanks, Wolfgang. None of the books I had consulted listed the <%@page
tag for JSP and one in particular bemoaned the fact that you couldn't
specify a package. Maybe this is a recent thing in JSP and my books are
old. None of my friends who do JSP knew the answer either.

Profuse thanks,

Russ
Previous Topic:impossible to remove tomcat from classpath for test
Next Topic:projects missing from J2EE module dependencies
Goto Forum:
  


Current Time: Thu Sep 26 08:50:25 GMT 2024

Powered by FUDForum. Page generated in 0.04048 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top