Hi,

I use Apache .3.20 with Tomcat 3.2.1.I got a strange error while using
include directive and useBean tag.

In my index.jsp, I include search.jsp:
<%@ include file="../../common/search/search.jsp" %>

In search.jsp, I use useBean tag:
<jsp:useBean id="queryobj" class="BeanDB.QueryObj" scope="page" >
</jsp:useBean>
<jsp:useBean id="RR" class="BeanDB.ReturnRecord" scope="page" >
</jsp:useBean>

<Other Code>...

And it generates error:
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
--------------------------
org.apache.jasper.JasperException: Unable to compile class for
JSPD:\CA_Root\Production\Tomcat\work\localhost_8080%2Fucas\_0002fjsp_000
2fCA_0005fFiles_0002fActors_0002fsuperuser_0002fact_0005fas_0002findex_0
002ejspindex_jsp_6.java:399: Invalid escape character.
            // HTML // begin
[from=D:\CA_Root\Production\Tomcat\webapps\ucas\jsp\CA_Files\Actors\comm
on\search\search.jsp(0,0);to=D:\CA_Root\Production\Tomcat\webapps\ucas\j
sp\CA_Files\Actors\superuser\act_as\index.jsp(61,0)]
                                                                       ^
D:\CA_Root\Production\Tomcat\work\localhost_8080%2Fucas\_0002fjsp_0002fC
A_0005fFiles_0002fActors_0002fsuperuser_0002fact_0005fas_0002findex_0002
ejspindex_jsp_6.java:399: Invalid escape character.
            // HTML // begin
[from=D:\CA_Root\Production\Tomcat\webapps\ucas\jsp\CA_Files\Actors\comm
on\search\search.jsp(0,0);to=D:\CA_Root\Production\Tomcat\webapps\ucas\j
sp\CA_Files\Actors\superuser\act_as\index.jsp(61,0)]
 
^
2 errors

        at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
        at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
        at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146
)
        at
org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J
spServlet.java:258)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:268)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
a:797)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnec
tion(Ajp12ConnectionHandler.java:166)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416
)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:50
1)
        at java.lang.Thread.run(Thread.java:484)
------------------------------------------------------------------------
----------------------------------------------------
I reviewed the generated servlet and only the statement highlighted by
the error message use single back slash, all others use double back
slash correctly. I am sure the error is related to useBean tag, since
after I moved useBean tag to Index.jsp:

In Index.jsp
<jsp:useBean id="queryobj" class="BeanDB.QueryObj" scope="page" >
</jsp:useBean>
<jsp:useBean id="RR" class="BeanDB.ReturnRecord" scope="page" >
</jsp:useBean>
<%@ include file="../../common/search/search.jsp" %>

In search.jsp
<Other Code>...

And it works.
I know I have to touch the file after I chage the included file. I did
every time.

Another interesting point is, actually the former code worked before.
All I did is I changed the context name.After that I have changed all
the occurance of old context name to new one, touched all the files,
recompiled all the beans and restart server. Everything works except the
included file which use useBean tag. Other included file also works.
>From my understanding, the include directive just include the code
statically in place. I don't know why the above two block of code really
makes difference. Anyone have any insight?

Charley Zuo

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to