At 12:00 AM -0700 8/23/00, Automatic digest processor wrote:
>The bean goes into the WEB-INF/classes directory (if its a class) or into
>WEB-INF/lib if it's a jar.
>
>Even if you have an application you don't need to change your HREFs you can
>still use relative paths,

This is the "book" answer, but it doesn't work with virtual domains
where there IS no WEB-INF directory.

(And this isn't really a good solution, as I don't want to make a global
directory writable by all).


Everyone sent me the this answer so I must have been unclear.  Here's the
nub of the problem in a very few lines.


BEANS WORK FINE ON MAIN DOMAIN

I am serving multiple domains with one server and one instance of Tomcat.

I have no trouble installing new classes into the root domain (in fact, the
Tomcat examples are a good, er, example, <http://www.editev.com/examples/jsp/>)


JSP WORKS FINE ON OTHER DOMAINS.

I have many other domains though.  On one of them, cliktrik, there is a
very simple JSP page:

<http://cliktrik.com/page.jsp>

><HTML><HEAD></HEAD> <BODY>
>
>  <%= new Integer(23).toString() %>
>
></BODY></HTML>

which works fine!


JSP/BEANS ON OTHER DOMAINS DOESN'T WORK

<http://cliktrik.com/page2.jsp>

><%@ page import="TestBean" %>
>
><HTML><HEAD></HEAD> <BODY>
>
>  <%= new Integer(23).toString() %>
>
></BODY></HTML>

gets an error:

[blah, blah]
>Class TestBean not found in import.


However, TestBean is in fact there...

>[root@www classes]# cd /home/jakarta-tomcat/webapps/ROOT/WEB-INF/classes
>[root@www classes]# cat TestBean.java
>public class TestBean implements java.io.Serializable {
>    public        TestBean() {                    }
>
>    public String getName( ) { return "Success!"; }
>    public String toString() { return getName() ; }
>}
>[root@www classes]# javac TestBean.java


The point is:  there is *no* WEB-INF directory for virtual domains,
at least that I can see.

I've played around with putting the .class file into
    /home/jakarta-tomcat/classes
or a .jar into
   /home/jakarta-tomcat/lib
with no luck.


A CHEAT MAKES A LITTLE PROGRESS

The thoroughly-bad seeming idea of putting a TestBean.class file into

   /home/jakarta-tomcat/work_cliktrik/localhost_8080

gets me through the compilation phase... so page2.jsp then works!


but I can then never instantiate the bean:

<http://cliktrik.com/page3.jsp>
><%@ page import="TestBean" %>
>
><HTML><HEAD></HEAD> <BODY>
>  <jsp:useBean id="testBean" scope="request" class="TestBean"/>
>
>  <%= new Integer(23).toString() %>
>
></BODY></HTML>
>


gives me the following, highly useless error.

>Error: 500
>
>Location: /page3.jsp
>
>TestBean


I'm completely stuck at this point.  And it's really disconcerting because
all I want to do is add a "one-liner" bean to a "one-liner" JSP file in
a virtual domain and I've spent many hours on it...

        /t


...electronic a capella madness  <http://volectrix.com>.........
...extreme internet radio        <http://extremeNY.com/radio>...

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to