#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    India
    Posts
    0
    Rep Power
    0

    Dynamic Include JSP


    Hi Everybody,

    I have a problem in using dynamic includes by using <jsp:include > tags.

    Problem begins :
    I want to dynamically include a file in the body subfolder as per code given below :

    <----- code begins ----->

    <% varincludefile ="body/" + dispov_type_assoc + ".jsp"; %>
    <jsp:include page="<%=varincludefile%>" flush="true">

    dispov_type_assoc is a variable whose value is coming from database. When the value of dispov_type_assoc is "userkview" , a file userkview.jsp from the body subfolder is included in the page.

    But if the dispov_type_assoc value is "dispov_user_view" then it gives the following error message :

    <--------- error msg begins -------------->
    Included servlet error: 500
    Location: /adapt/jsp/com.aawara_core/page/page_view.jsp
    Error Location: /adapt/jsp/com.aawara_core/page/display/dispov/side/body/dispov_user_view.jsp
    Internal Servlet Error:

    org.apache.jasper.JasperException: Unable to compile class for JSPerror: Can't write: V:\jakarta-tomcat-3.2.1\work\localhost_8080%2Fadapt\jsp\com_0005faawara_0005fcore\page\display\dispov\side\body\_0002f jsp_0002fcom_0002eaawara_0005fcore_0002fpage_0002fdisplay_0002fdispov_0002fside_0002fbody_0002fdispo v_0005fuser_0005fview_0002ejspdispov_0005fuser_0005fview_jsp_0.class
    1 error

    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
    at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
    at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:345)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
    at jsp.com_0005faawara_0005fcore.page.display.dispov.side._0002fjsp_0002fcom_0002eaawara_0005fcore_0002 fpage_0002fdisplay_0002fdispov_0002fside_0002fbody_0002ejspbody_jsp_0._jspService(_0002fjsp_0002fcom _0002eaawara_0005fcore_0002fpage_0002fdisplay_0002fdispov_0002fside_0002fbody_0002ejspbody_jsp_0.jav a:288)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:345)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
    at jsp.com_0005faawara_0005fcore.page._0002fjsp_0002fcom_0002eaawara_0005fcore_0002fpage_0002fpage_0005 fview_0002ejsppage_0005fview_jsp_0._jspService(_0002fjsp_0002fcom_0002eaawara_0005fcore_0002fpage_00 02fpage_0005fview_0002ejsppage_0005fview_jsp_0.java:2390)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:21 0)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)

    <-------------- error msg ends--------------------------->

    I am using tomcat3.2 server. The various env. settings are as follows :

    1) Context path defined in server.xml file is :
    <Context path="/adapt"
    docBase="/adapt/acm"
    crossContext="false"
    debug="0"
    reloadable="true" >
    </Context>
    I have tried by changing crossContext value to true also and the error is same.

    2) The path and classpath decl. in autoexec.bat file are as follows :
    path c:\jdk1.3\bin; v:\jakarta-tomcat-3.2.1\bin;%path%

    set classpath = %classpath%;c:\jdk1.3\lib;.;v:\jakarta-tomcat-3.2.1\webapps\examples\web-inf\classes;s:\;c:\winnt;


    What could be the possible source of error. I know that in jsp long file names are in dynamic includes are acceptable and even underscores '_' are also acceptable.

    Prateek
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    durban south africa
    Posts
    29
    Rep Power
    0
    try restarting tomcat.
    I had the same error. It's porbably some bug.

IMN logo majestic logo threadwatch logo seochat tools logo