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 23:01:24 GMT
just because I can't shut up, but everyone should know that by now,

If I wanted this JSP to work

<%=A.test()%>

then I would simply do this

1. place A.class in WEB-INF/classes/ (required for running the compiled 
JSP, runtime class loading)
2. place A.class in WEB-INF/classes/org/apache/jsp/ (required for the 
compilation to work, compile time class loading)

so there is a way to run it, what I was trying to do, was simply 
eliminate step 1.
Filip


Filip Hanik - Dev Lists wrote:
> 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
>
>
>


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


Mime
View raw message