tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Beans without packages in JSP files
Date Tue, 05 Dec 2006 22:39:22 GMT
Yoav Shapira wrote:
> Hi,
>
> On 12/5/06, Filip Hanik - Dev Lists <devlists@hanik.com> wrote:
>> I'm not talking about
>> import A;
>>
>> I'm talking about simply using A in the JSP
>>
>> <%=A.test()%> without using an import,
>>
>> This doesn't work, cause our JSP page gets packaged as
>> org.apache.jsp.<directory> and our code adds that before it tries to
>> resolve A
>
> I apologize, I guess I wasn't clear ;)
>
> First of all, this is not new stuff at all.  It's been in our FAQ
> (http://tomcat.apache.org/faq/classnotfound.html) for at least a
> couple of years.  What made you bring it up now?
Just ran into an issue where this was the case, made me look into the 
code to see how A got resolved,
basically, it tries to load org.apache.jsp.<directory>.A.
if A was not identified by a import statement and sits in a package.
This is an app that runs om Tomcat 3, where it is working just dandy :)

I hadn't realized that it had changed on the javac level to not work on 
this, thanks for pointing it out.
>
> In your example, what does "simply using A in the JSP" mean?  What
> does it look like in the compiled servlet that the JSP is turned into?
> You have to resolve it to *some* package.  Are you saying the current
> code assigns a default org.apache.jsp package *before* doing this
> resolving?  I doubt that's the case, or everyone's beans that are not
> in org.apache.jsp would break...
Nope, just if it doesn't belong in a package already. Then it will guess 
that the prefix should be the package that the JSP is in.

I'm over it, scratch everything I said, this conversation never happened.
Filip


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message