Hi,
No, this wouldn't work, because the package declaration within the class
must match.

You're left looking at indirect options:
- Consider a replacement to Xslt.class (another product maybe)
- Consider contacting the authors of Xslt.class and/or opening a support
ticket if applicable for them to put their class in a package
- Consider writing a replacement yourself
- Consider bytecode manipulation, e.g. BCEL, to see if you can
retroactively put the class in a different package

Ooh, one more idea: try leaving the Xslt class as-is, in its jar, in
WEB-INF/lib, and instead of importing Xslt import org.apache.jasper.Xslt
(and change the tld file's class attribute name to match).

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Worley Brent - bworle [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 16, 2004 2:28 PM
>To: 'Tomcat Users List'
>Subject: RE: Second Try: Can anyone explain this?
>
>Is it possible to extract the class files and give them a
"package-like"
>structure without the keyword package being in the code?
>
>For example, there are 3 .class files in the jar.  Could I create a
>directory called "Xslt", copy those classes within it, and then jar the
>directory and use a import Xslt.*?
>
>I'm fairly new to Java and do not know if this hack would work.
>
>-----Original Message-----
>From: Tim Funk [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 16, 2004 1:24 PM
>To: Tomcat Users List
>Subject: Re: Second Try: Can anyone explain this?
>
>
>Then your out of luck. The java from a JSP page is always placed into a
>package. Becuase of this, you can't have packageless classes.
>
>You alternative is to hack jasper to not use the package statement but
>doing
>
>so will be harder than fixing your code.
>
>
>
>-Tim
>
>Worley Brent - bworle wrote:
>
>>>Someone told you to put JspXslt.class in a package, IIRC.  I think
>>>that's the problem.  Repackage the jar if you have to, for testing
>>>purposes, and change the TLD to refer to the class by whatever
package
>>>you put it in, e.g. com.foo.bar.JspXslt.
>>
>>
>> The problem is the files in Xslt.jar are not our code.  We obtained
that
>> code from somewhere else.  I asked one of the guys around the project
>when
>> development started.  He said that he thought it came from Xalan
(which I
>> learned later it did not, or it came from a very, very old version
that
>I'm
>> unfamiliar with).  Regardless, I have no access to the code to
specify it
>to
>> a package.
>>
>> Brent
>>
>>>-----Original Message-----
>>>From: Worley Brent - bworle [mailto:[EMAIL PROTECTED]
>>>Sent: Wednesday, June 16, 2004 1:32 PM
>>>To: 'Tomcat Users List'
>>>Subject: Second Try: Can anyone explain this?
>>>
>>>I posted this earlier and received a few leads on what to do, but
>>
>> nothing
>>
>>>worked.  I'm hoping a second look and explanation will help.
>>>
>>>The page that is causing the error (search.jsp) uses a taglib to load
>>>xslt.tld (<%@ taglib prefix="acx" uri="WEB-INF/tld/xslt.tld" %>).
The
>>
>> .tld
>>
>>>file defines a tag named xslt that uses a class named JspXslt.
JspXslt
>>
>> is
>>
>>>located in WEB-INF/lib/Xslt.jar.
>>>
>>>So here are my questions:
>>>
>>>1.  Is anyone familiar with a standard Xslt.jar file that contains
the
>>>JspXslt.class object?
>>>2.  Why would Tomcat not find JspXslt.class?
>>>
>>>I've included the xml from the .tld file and the errors below.
>>>
>>><taglib>
>>> <tlibversion>0.0</tlibversion>
>>> <jspversion>1.0</jspversion>
>>> <shortname>acx</shortname>
>>> <tag>
>>>   <name>xslt</name>
>>>   <tagclass>JspXslt</tagclass>
>>>   <bodycontent>jsp</bodycontent>
>>>   <attribute>
>>>     <name>xml</name>
>>>     <required>false</required>
>>>     <rtexprvalue>true</rtexprvalue>
>>>   </attribute>
>>>   <attribute>
>>>     <name>xslt</name>
>>>     <required>true</required>
>>>     <rtexprvalue>true</rtexprvalue>
>>>   </attribute>
>>>   <attribute>
>>>     <name>nobreak</name>
>>>     <required>false</required>
>>>     <rtexprvalue>true</rtexprvalue>
>>>   </attribute>
>>> </tag>
>>></taglib>
>>>
>>>org.apache.jasper.JasperException: Unable to compile class for JSP
>>>
>>>An error occurred at line: 55 in the jsp file: /search.jsp
>>>
>>>Generated servlet error:
>>>   [javac] Compiling 1 source file
>>>
>>>/usr/local/jakarta-tomcat-
>>>5.0.24/work/Catalina/localhost/SIT/org/apache/jsp/
>>>search_jsp.java:295: cannot resolve symbol
>>>symbol  : class JspXslt
>>>location: class org.apache.jsp.search_jsp
>>>     JspXslt _jspx_th_acx_xslt_0 = (JspXslt)
>>>_jspx_tagPool_acx_xslt_xslt_xml.get(JspXslt.class);
>>>     ^
>>>
>>>
>>>
>>>An error occurred at line: 55 in the jsp file: /search.jsp
>>>
>>>Generated servlet error:
>>>/usr/local/jakarta-tomcat-
>>>5.0.24/work/Catalina/localhost/SIT/org/apache/jsp/
>>>search_jsp.java:295: cannot resolve symbol
>>>symbol  : class JspXslt
>>>location: class org.apache.jsp.search_jsp
>>>     JspXslt _jspx_th_acx_xslt_0 = (JspXslt)
>>>_jspx_tagPool_acx_xslt_xslt_xml.get(JspXslt.class);
>>>                                    ^
>>>
>>>
>>>
>>>An error occurred at line: 55 in the jsp file: /search.jsp
>>>
>>>Generated servlet error:
>>>/usr/local/jakarta-tomcat-
>>>5.0.24/work/Catalina/localhost/SIT/org/apache/jsp/
>>>search_jsp.java:295: cannot resolve symbol
>>>symbol  : class JspXslt
>>>location: class org.apache.jsp.search_jsp
>>>     JspXslt _jspx_th_acx_xslt_0 = (JspXslt)
>>>_jspx_tagPool_acx_xslt_xslt_xml.get(JspXslt.class);
>>>
>>>^
>>>Note:
>>>/usr/local/jakarta-tomcat-
>>>5.0.24/work/Catalina/localhost/SIT/org/apache/jsp/
>>>search_jsp.java uses or overrides a deprecated API.
>>>Note: Recompile with -deprecation for details.
>>>3 errors
>>>
>>>
>>>     at
>>>org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErro
rH
>>
>> andl
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>**********************************************************************
>The information contained in this communication is
>confidential, is intended only for the use of the recipient
>named above, and may be legally privileged.
>If the reader of this message is not the intended
>recipient, you are hereby notified that any dissemination,
>distribution, or copying of this communication is strictly
>prohibited.
>If you have received this communication in error,
>please re-send this communication to the sender and
>delete the original message or any copy of it from your
>computer system. Thank You.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to