JSP include problem

I am facing problems with the JSP include functionality in my project.
What I want to do is to include jsp files on the fly i.e depending on the business need I should be able to swap in and out jsps from the main jsp.
I plan to do this by feeding the file names in a request attribute and then including the files in the order given.
But on using the jsp:include there is no output generated by the included jsp.
There is no error either in the log or in the page directly.
Please help me in finding out what exactly is the issue here.
the files are index.jsp --> rightRailIncludeFiles.jsp --> dynamically loaded jsps (These may themselves contain other included files)
index.jsp
<div id="right" class="testRight">
    <%@ include file="rightRailIncludeFiles.jsp" %>
</div>
rightRailIncludeFiles.jsp
<%
    out.println("<h1>Dyna Include</h1>");
    String fileNames = (String)request.getAttribute("jspFiles");
    String[] fileList = fileNames.split(",");
    out.println("<!-- Files : " + fileNames + " -->");
%>
<%
for(int i=0;i<fileList.length;i++) {
    try {
         out.print("<!-- "+fileList[i]+" -->");
%>
    <jsp:include page="<%=fileList%>" flush="true"/>
<%
} catch(javax.servlet.ServletException e) {
out.println("<h3 style=\"color:red\"> Error :"+e.getMessage()+"</h3>");
%>
*inlude_1.jsp (This file includes another file which has some common code)*<jsp:include page="include/inlude_1.jsp" flush="true">
<jsp:param name="magicNumberText" value="${request.adMagicNumberText}" />
<jsp:param name="setType" value="${request.adSetType}" />
<jsp:param name="width" value="${request.adWidth}" />
<jsp:param name="height" value="${request.adHeight}" />
<jsp:param name="adOuterDivClass" value="${request.adOuterDivClass}" />
</jsp:include>
Edited by: danbrown on Feb 9, 2009 2:49 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Good morning,
I am not sure that could be the real problem , but I guess your app server does not like the fact that you broke the try catch in two parts. In any case, you should not do that :) Mixing code and display is very painful for maintenance :)
Have you tried to remove the jsp:include and see if the output is correctly produced?
Best Regards
Edmondo

Similar Messages

  • Jsp:include problem in custom tag

    I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a file
              caller.jsp), which does emailing.
              When I invoke caller.jsp from browser, I do get the output(body of the
              email) on the browser screen, but not the output is not send as the body of
              the email.
              When I use static include namely, <@include file="emailbody.jsp" />, the
              output is directed to the body of the email.
              The above means, for a static jsp include file, it is parsed and included in
              the body-evaluation of the custom tag.
              For a dynamic include file, it is NOT parsed and NOT included in the
              body-evaluation of the custome tag.
              The reason could be, How Weblogic loads classes for custom-tag for dynamic
              include files.
              Can anybody at BEA throw loght on this and the solution.
              Thanks in advance.
              Chandra
              

    Well I found out jsp:include is not supported inside custom tags for JSP
              spec 1.1.
              This was stated in section 5.4.5 of spec 1.1.
              May be in future spec 1.2.
              Thanks
              Chandra
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > Have you sent this to [email protected]?
              >
              > It sounds serious.
              >
              > Peace,
              >
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > +1.617.623.5782
              > WebLogic Consulting Available
              >
              >
              > "matthew mcclain" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have run into the same problem.
              > > I'm certain it's because CustomTags have their own buffer and
              > > jsp:include or pageContext.include() or requestDispatcher.include()
              > > all bypass the buffer and write to the underlying stream.
              > >
              > > I attempted to define jspx:include by wrapping the response object
              > > which is sent to requestDispatcher.include and then wrapping the
              > > OutputStream returned from the response with a stream which
              > > writes to the "out" of the pageContext for my tag.
              > >
              > > Unfortunately, I get a class cast exception because weblogic expects
              > > it's own class to be there as a ServletOutputStream:
              > >
              > > java.lang.ClassCastException:
              com.allmystuff.wif.IncludeServletResponse$1
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:202)
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:172)
              > > at com.allmystuff.wif.Include.doStartTag(Include.java:37)
              > >
              > > So any chance, jsp:include will get fixed?
              > >
              > > Thanks,
              > > Matthew McClain
              > > [email protected]
              > >
              > >
              > > "chandra" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a
              > file
              > > > caller.jsp), which does emailing.
              > > > When I invoke caller.jsp from browser, I do get the output(body of the
              > > > email) on the browser screen, but not the output is not send as the
              body
              > > of
              > > > the email.
              > > > When I use static include namely, <@include file="emailbody.jsp" />,
              the
              > > > output is directed to the body of the email.
              > > >
              > > > The above means, for a static jsp include file, it is parsed and
              > included
              > > in
              > > > the body-evaluation of the custom tag.
              > > > For a dynamic include file, it is NOT parsed and NOT included in the
              > > > body-evaluation of the custome tag.
              > > > The reason could be, How Weblogic loads classes for custom-tag for
              > dynamic
              > > > include files.
              > > > Can anybody at BEA throw loght on this and the solution.
              > > > Thanks in advance.
              > > > Chandra
              > > >
              > > >
              > >
              > >
              >
              >
              

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • A peculiar problem using jsp:include conditionally

    Hi,
    This is regarding usage of jsp:include in Myfaces 1.1.4.
    lets say the page containing the jsp:include statements as PARENT PAGE
    I have a requirement to display some components in the PARENT PAGE which are continued from the same form using different JSPs since the components are different based on a condition.
    I used the following code:
    <h:panelGrid id="CandidateRequestorView" rendered="#{RgsViewRequirementBB.displayCandidateView}" columns="1">
         <jsp:include page="/RGSPages/requestorViewReq.jsp"/>
    </h:panelGrid>
    <h:panelGrid id="CandidateMatcView" rendered="#{!RgsViewRequirementBB.displayCandidateView}" columns="1">
         <jsp:include page="/RGSPages/matcViewReq.jsp"/>
    </h:panelGrid>Now if I use only 1 panel grid (any one out of the above 2) it works. I didnt even use <f:subview> any where( neither in the PARENT PAGE nor in the included jsps), but it works.... Also for your knowledge these jsps contain only JSF elements( no plain HTML code is used)
    But if I am using the above displayed code to have both the jsps (actually only one will be displayed bcoz the same condition is used)
    then its not displaying all the contents of included jsp. (YES I AM ABLE TO GET TO THE JSP...THERE IS NO ERROR) There is a datatable inside this jsp which is not rendered......
    I have used <f:subview> when i faced this problem.......
    I have tried every combination....writing <f:subview> in the PARENT PAGE ....writing in included jsps and removed it from PARENT PAGE.....also some of the articles in the forum mentioned that <f:subview> element should not be used inside <h:panelgrid> .....i even tried that....but final result is same as I was getting the first time...
    I am able to reach the jsp page (with or without <f:subview>) but i am not able to display all the contents....but if i use only one of the included jsps(by removing any one of the panel grids) I am able to view them. Since I am able to view all the contents when i view these pages inside the PARENT PAGE one at a time, that indicates there is no problem in datatable contained in these pages.....
    ( Also I have not used <f:view> inside my included jsps.)
    Please help to solve this problem...
    Thanks
    Avner

    Hi BalusC,
    The RgsViewRequirementBB is already in the session scope.
    Also I am using the setDisplayCandidateView(true) or setDisplayCandidateView(false ) explicitly as depicted below. The page is still under construction thats why the rendered attribute is explicitly set.
    public RgsViewRequirementBackingBean() {
    super();
    // TODO Auto-generated constructor stub
    try{
                setDisplayCandidateView(true);
                 // some more code goes in here
         catch(Exception){
               ResourceBundle bundle = null;
               bundle = ResourceBundle.getBundle("resources.ErrorMessages", FacesContext.getCurrentInstance().getViewRoot().getLocale());
                 //some more code goes in here
    }

  • Problem with flush=true in the jsp:include tag

    Hello
    I have deployed a JSP based application , based on the apache struts framework. The web server is Sun One Webserver 6 Service Pack4, on a windows 2000 machine
    The same application was tried on SunONE application server 7, and it works without any problem. However in this case the following error , on the page
    javax:servlet.jspexception:Illegal to flush within a custom tag
    Does this mean flush="true" is not allowed within custom tags
    Or is there a workaround for this
    Any help is appreciated
    thanks
    - Aniruddha

    Hi,
    This is a known problem, ��flush before you include�� limitation in JSP 1.1.
    As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
    Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
    Gary Wang
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Problem with jsp:include of 2 or more pages in a jsp in OC4J 10.1.3

    My application has ben developed in spring framework and it is running successfully in jdeveloper,
    but when I deployed my application in OC4J 10.1.3,
    I am getting strange results, one of the jsp includes 2 and more jsps using <jsp:include> tag, but I could see only first of them in my jsp is included and the
    remaining display area for remaining included jsps are filled with the first included jsp only, The application is running successfully in Jdeveloper 10.1.3
    I have been trying to solve this problem for the last 3 weeks,
    please help me in this regard.
    Thanks

    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[35]);
    String __url=OracleJspRuntime.toStr("/wo.create.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[36]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[37]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woUpdate'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[38]);
    String __url=OracleJspRuntime.toStr("/wo.update.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[39]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[40]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woCharge'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[41]);
    String __url=OracleJspRuntime.toStr("/wo.charge.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[42]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[43]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woSearchAdvanced'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[44]);
    String __url=OracleJspRuntime.toStr("/wo.search.advanced.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[45]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[46]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woViewDetail'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[47]);
    String __url=OracleJspRuntime.toStr("/wo.view.detail.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[48]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[49]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woAttach'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[50]);
    String __url=OracleJspRuntime.toStr("/wo.attach.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[51]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[52]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'contactUs'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[53]);
    String __url=OracleJspRuntime.toStr("/contact.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[54]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[55]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'help'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[56]);
    String __url=OracleJspRuntime.toStr("/help.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[57]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[58]);
    __jsp_tag_ctru8.setPageContext(pageContext);
    __jsp_tag_ctru8.setParent(__jsp_tag_ctru7);
    __jsp_tag_ctru8.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'error'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru8.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[59]);
    String __url=OracleJspRuntime.toStr("/error.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[60]);
    } while (__jsp_tag_ctru8.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru8.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[61]);
    __jsp_tag_ctru9.setPageContext(pageContext);
    __jsp_tag_ctru9.setParent(__jsp_tag_ctru7);
    __jsp_tag_starteval=__jsp_tag_ctru9.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[62]);
    String __url=OracleJspRuntime.toStr("/wo.view.html"); // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[63]);
    } while (__jsp_tag_ctru9.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru9.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[64]);
    } while (__jsp_tag_ctru7.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru7.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[65]);
    __jsp_tag_ctru6.setPageContext(pageContext);
    __jsp_tag_ctru6.setParent(null);
    __jsp_tag_ctru6.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${fn:startsWith(module.centerModule,'wo')}",java.lang.Boolean.class, __ojsp_varRes, __ojsp_fnmappers[0])));
    __jsp_tag_starteval=__jsp_tag_ctru6.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[66]);
    __ojsp_s_out.write(__oracle_jsp_text[67]);
    String base_url = request.getContextPath();
    base_url+="/statistics.html";
    __ojsp_s_out.write(__oracle_jsp_text[68]);
    out.print( base_url);
    __ojsp_s_out.write(__oracle_jsp_text[69]);
    __jsp_tag_ctru10.setPageContext(pageContext);
    __jsp_tag_ctru10.setParent(__jsp_tag_ctru6);
    __jsp_tag_ctru10.setTest(OracleJspRuntime.toBoolean( (java.lang.Boolean)oracle.jsp.runtime.OracleJspRuntime.evaluate("${module.centerModule == 'woCreate' || module.centerModule == 'woCharge' || module.centerModule == 'woUpdate'}",java.lang.Boolean.class, __ojsp_varRes,null)));
    __jsp_tag_starteval=__jsp_tag_ctru10.doStartTag();
    if (OracleJspRuntime.checkStartTagEval(__jsp_tag_starteval))
    do {
    __ojsp_s_out.write(__oracle_jsp_text[70]);
    String __url=OracleJspRuntime.toStr("/history.equip.html");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    __ojsp_s_out.write(__oracle_jsp_text[71]);
    } while (__jsp_tag_ctru10.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru10.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    __ojsp_s_out.write(__oracle_jsp_text[72]);
    } while (__jsp_tag_ctru6.doAfterBody()==javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN);
    if (__jsp_tag_ctru6.doEndTag()==javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
    return;
    The lines in bold are inside a switch case , the problem is generating when I am including two pages
    "/wo.charge.html" and
    "/history.equip.html"
    the output of "/wo.charge.html" is duplicating
    in place of "/history.equip.html"
    Somewhere I have read that there is a size limit for jsp service method of upto 64KB,
    the above code is in a jsp "/main.html" of size when compiled (.java) 42KB
    "/wo.charge.html" is of size 40KB
    Could this be leading to probem?
    Please clarify the above things
    Thanks
    Message was edited by:
    user471571

  • Problems with Tomcat 4.0 and jdk 1.3.1 (jsp:include) Help Gurus...

    Im running examples of the include:
    <jsp:include page="xxx.jsp" flush="true">
    and received error:
    org.apache.jasper.JasperException: No se puede compilar la clase para JSP
    An error occurred at line: 17 in the jsp file: /jsp/include/include.jsp
    Generated servlet error:
    /Programas/Tomcat4/work/localhost/examples/jsp/include/include$jsp.java:79: Method include(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, javax.servlet.jsp.JspWriter, boolean) not found in class org.apache.jasper.runtime.JspRuntimeLibrary.
    JspRuntimeLibrary.include(request, response, "/jsp/include/foo.html" + jspxqStr, out, true);
    ^
    Please Help me Im running this equal with:
    <%@ include file="xxx.jsp" %>
    and runnig fine....

    The two means of including files are different in their approach.
    Using <jsp:include .../> compilation of the included jsp is done at run -time not during compilation.
    Using <%@ include .../> compiles at compile time.
    Looking at the error it seems that the method JspRuntimeLibrary.include is not being found which suggests that you may have a classpath problem. Check that there is not a servlet.jar in the classpath that is from a earlier spec than the one provided with Tomcat.
    Dave

  • Problem when using jsp:include.. / in JSP when run on OC4J903

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

  • Relatiive Path problem when using JSP:include in web portlet

    Hi
    I am using Oracle Portal 9.0.2, and thus OC4J as the J2EE platform.
    I have created a JSP web portlet that is supposed to inlude a specific static html file, which name is passed to it using a portlet parameter. It works, but I had to create a symbolic link from the applicable J2EE applications's htdocs directory in order to access the content:
    /j2ee/OC4J_Portal/applications/<application>/htdocs/<portlet>/content/
    where /content/ is a symbolic link to another directory altogether.
    I can then access the content from within the portlet with a JSP include tag that looks like :
    docPath = "/htdocs/<portlet>/html/"+doc_path;
    %>
    <br>Include:
    <jsp:include page="<%=docPath%>" flush="true"/>
    I would like to access the content using the JSP include without having to use the symbolic link. Is there a way to do this. I tried using an Apache alias, but that did not work.
    Regards
    Harry

    Hi
    Thanx
    In the end we build up a static URL to the document to be included using:
    String contentLocation="content/";
    docPath = contentLocation+getAdditionalDocPath();;
    out.println("docPath="+docPath);
    String docPathAndName = portletRequest.getParameter("doc_path");
    %>
    <!--
    This java script function calls the display content page with the
    page parameter doc_path (which is in return passes it to the display
    content portlet) in order to retrieve and display specific document
    with a JSP:include tag
    -->
    <script language="JavaScript">
    function generateSectionPath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+"<%=docPath%>"+docName;
    <script language="JavaScript">
    function generateRelativePath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+docName;
    </script>
    <br>Include:
    <%
    if (portletRequest.getParameter("doc_path") == null) {
    out.println("Error - no doc path specified");
    } else { 
    try { %>
    <jsp:include page="<%=docPathAndName%>" flush="true"/>
    <% } catch (Exception e) {
    out.println("Error retrieving document:"+e.toString());
    } // end if
    %>
    Each link from one included HTML file to another becomes a JS function that points the browser to the portal page that includes the portlet that includes thwe JSP that has the include tag to include the html document that is to be displayed.
    The current relative path the the html document (from a predefined root in the file system that is symbolically linked to the same directory as where the including JSP lives) is stored in a session variable, and appended to the document name that is passed to the page.
    If a full document path, as opposed to just the name, is stored, that no appending is done. However, the path is stripped out and stored in a session variable.
    Ths thing is, sometimes a document name, and sometimes a path is passed to the page. Therefore the requirement to know the path when it is not available. A name only will always be passed subsequent to a request for a document with the full path specified, therefore the session variable mechanism works.
    Thanx for the input
    Harry

  • A problem about jsp:include

    When I use
    <jsp:include page="list.jsp" >
    <jsp:param name="year" value="2002" />
    </jsp:include>
    how can I get the value of the param year in the jsp list.jsp?

    yes, but from JSTL.
    but to use it, you have to
    in your jsp
    <%@ taglib uri="jstl-core" prefix="c"%>
    in your web.xml
    <taglib>
    <taglib-uri>jstl-core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    in your /WEB-INF folder put c.tld (and the other JSTL tld files if you want)
    and jstl.jar in your /WEB-INF/lib folder.
    The JSTL tag lib provide a lot of possibility ...
    Regards.

  • Problem with jsp:include ..any ideas ?

    Hi,
    I have the following code in a recordfollowup.jsp,
    <jsp:include page="contacthistory.jsp" flush="true">
    <jsp:param name="packet" value="<%=somevalue%>"/>
    </jsp:include>
    I get this exception "recordfollowup.jsp(364,0) "Unterminated
    I tried using the end tag /> and then I was able to include the contacthistory.jsp but I need to get the additional param sent to the contacthistory.jsp so this will not do...
    please help me with suggestions/sample code .....
    thanks a lot !

    Sounds to me like the variable someValue contains a quote (").
    You could try putting it into the pageContext and getting it out in the included page. Or if that doesn't work, try the session.
    // using pageContext
    <%
    pageContext.setAttribute("someValue", someValue);
    %>
    <jsp:include page="contacthistory.jsp" flush="true"/>
    then in contacthistory.jsp
    <%
    String value = (String)pageContext.getAttribute("someValue");
    // swap 'pageContext' with 'session' to use the session
    %>

  • Jsp:include static svg does not work

    I am running tomcat4- and I have a jsp file that outputs svg content like so:
    <?xml version="1.0" encoding="US-ASCII"?>
    <%@ page contentType="image/svg+xml"%>
    This works fine- the problem is that up until now I have included other svg widgets like this:
    <g id="radio_off" >
                   <%@ include file="../graphics/radioButton.svg" %>
              </g>
    which also works just fine. Now, I have to change this to pass in a dynamic directory containing the image (there will be various directories with same file name- I determine at runtime which directory to use)- so I have to use a jsp:include instead.
    When I do this:
    <g id="radio_off" >
    <jsp:include page="graphics/radioButton.svg" flush="true"/>
              </g>
    When it is run I just get:
    g id="radio_off" >
              </g>
    Just blank inside the <g> . If I change radioButton.svg to radioButton.jsp and say:
    g id="radio_off" >
    <jsp:include page="graphics/radioButton.jsp" flush="true"/>
              </g>
    Then I get what I expect with
    g id="radio_off" >
    <svg width="15" height="15">
    ....and so on
              </g>
    I thought jsp:include would include the static content of a file (like html or svg), but apparently only the OUTPUT of that file.....
    Is this correct- I cannot get my svg content to be included in the svg by using jsp:include or am I missing something?
    I think it will be strange that I have to rename all my svg files jsp to get them included...Anu ideas???
    Thanks,
    Jim

    Michael,
    You are right- I reread your post more closely and saw that you are suggesting to basically just map all my static files (like the .svg) into .jsp extensions- which is basically what I was asking was true- that for svg, xml, htm, any static content to be included as in the <%@include directive but using the action <jsp:include it needs to either be changed to the extension .jsp or, as you suggested, mapped in the web.xml to .jsp. I have remapped my svg to .jsp so as to preserve their .svg extensions- (of course now the first user is hit by about 20 jsp:init's on that page!!- but is then cached as in all jsp's).
    I guess kinda makes since since the include action gets the actual response from the page (which is blank image)- but as jsp it is the actual code....Well needed confirmation- and that's what I got along with the reminder to use the mapping in web.xml.
    So thanks alot- even put extra duke in for you !!
    Jim

  • Jsp:include not working - Please Help.

    I am trying to do a jsp:include page but I must have the syntax wrong for the declaration of the filename. There shouldn't be a problem with my included file since it only has the word "TEST" in it. Both files are in the same directory. The error I'm getting is a 404 error.
    Message:File not found: null
    Target Servlet: File Serving Enabler
    StackTrace:
    If you look at the code, you'll see that I am doing two includes, one using the directive and one using jsp:include. The directive one comes up fine but not the jsp:include. Thanks for any help. Here's my code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META name="GENERATOR" content="IBM WebSphere Page Designer V3.5.3 for Windows">
    <META http-equiv="Content-Style-Type" content="text/css">
    <TITLE>This is the page title</TITLE>
    </HEAD><BODY>
    <center>
    <table border="1">
    <tr>
    <td align="center"><jsp:include page="navigationTest2.html" flush="true"/></td>
    <td align="center"><%@ include file="navigationTest2.html" %></td>
    </tr>
    </table>
    </center>
    </BODY></HTML>

    Yeah I know, I tried that. I did notice that the directive include doesn't accept the path the same way. If I put in the full path /test/navigationTest1.html the compile would tell me couldn't read file, but the path of the file it was trying to read was /test/test/navigationTest1.html. I took the /test out and just left the / and could not read the file in the root dir, of course, because it's in the test dir. So now I have the full path /test/navigationTest1.html in the jsp:include and no path in the directive include and same results.

  • Jsp:include doesn't work with Tomcat & IIS

    Hi, Guys,
    I installed IIS4.0 and Tomcat in my windows NT system. http://localhost/examples/jsp/index.html works fine.
    When I load http://localhost:8080/about.jsp, it's also working fine. But when I load http://localhost/about.jsp, it will ignore the part which the line is display as
    <%String topName = "/servlet/topServlet";%>
    <jsp:include page="<%=topName%>" flush="true"/>
    The other part will work just as a html file. And I didn't get any error message.
    Would can tell me how to figure out this problem. Thank in advanced very much!

    Oh, God, why not tell me earlier!!!!!! I do use tomcat 3.1 and it just support servlet. I have no way out but modify all my jsp:include to encoding into a servlet page. I almost re-do all my work. But anyway, thank you! Next time I will know.

  • JSP include directive not working with Tomcat 5.0

    Hi.
    I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
    I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
           version="2.0">
    <jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
    <%@ include file="/jsp/panelpage_header.inc" %>
         <h:outputText value="Welcome!"/>
    <%@ include file="/jsp/panelpage_footer.inc" %>
    </jsp:root>However, when I try to load the page, a compilation error occurrs:
    org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    ...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
    Did anyone see this kind of error before?

    Ok, the solution with jsp:directive.include works,
    if header.inc and footer.inc themselves are well
    formed too. If I understood the concept right this is
    because header and footer are processed during
    request time and therefore interpreted as
    'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
    >
    But: What can I do when these two files define a tag
    that should enclose my current page (for example,
    header opens a panelGrid-Tag, and footer closes it).
    For this case I thought the use of the
    @include-directive would be neccessary to combine the
    three pages during compilation. By this the resulting
    page would be well-formed although header and footer
    are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
    Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
    What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else.

Maybe you are looking for

  • How to specify the target name while deploying a code in OSB-- Plz Help

    Hi all, Am working in creating a cluster environment. For my testing i created a new managed server(OSB_Server) in 9001 port in the admin console itself and that server started running. The default managed server(Admin_Server) is in 7001 port. So whe

  • What's the best audio filter and settings to eliminate echo?

    I shot an interview in a hallway. What's the best audio filter and settings to reduce/eliminate echo?

  • Font types of illustrator cs2 document

    Hi,           I need to get font types (open type, true type and type1) of illustrator cs2 document.  Can't able to get using script and action.  Manually i can get by saving document info of a document.  But when i trying through action cant able to

  • Cut and Paste to Existing Layer (CS4)

    Is there a way to cut pixels from one layer and paste them to a selected layer (as opposed to pasting the pixels to a new layer which is created by PhotoShop)?  Also, is there an easy way to make sure that the pasted pixels remain in their original p

  • Windows xp  doesnt display  I-touch as a device

    I used to own a 60gb video Ipod. I loved it for the fact i use to drag n drop all my pictures, files , software and window programs just in case my Pc Died or corrupted by some crazy virus that holds files HOSTAGE..some of u out there have prolly gon