Bean cannot be resolved to a type [message #211635] |
Thu, 03 April 2008 01:51 |
|
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 |
Eclipse User |
|
|
|
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 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04048 seconds