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>
          > ...
          

Similar Messages

  • 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
    }

  • jsp:include from a Servlet???

    Hi guys,
    Does anybody know if there is a way of using <jsp:include> from a servlet?? It would save me alot of hassle!!

    Of course <jsp:include> is a JSP tag so it requires JSP :-).
    It is not clear exactly what you want to do, but here is one way to do includes. The JOT Servlets framework (http://www.jotobjects.com)
    has a general include mechanism. Here is an example that could be configured with web.xml elements to merge (include) one web page into another without any Java programming:
    <html>
    <body>
    ... start of page
    JOT.ContentName.Content
    <!-- merges content from another file or URL -->
    ... rest of page
    </body>
    </html>

  • Error While opening a JSP page from inside form window

    Hi,
    I am using Oracle EBS 12.0.4 and using IE 7 as my browser.
    Now when i am trying to open a jsp page form EBS Home page (after login) it is opening perfectly.The problem occurs when i tried to open jsp pages from inside form window.
    E.g. From the home page when i tried to open a jsp page "Control Purchasing Periods" which is assigned in one of our custom responsibility(Manager Systems-->PO Super User-->Set up-->Financials-->Accounting-->Control Purchasing Periods) it opens a new log in page for the EBS. When i logged in it is showing
    Error
    You have insufficient privileges for the current operation. Please contact your System Administrator. Same is happening when i am trying to open User Page form user management responsibility from inside a form window.Where as it is opening fine from home page.
    Please help.

    Hi, hueesin
    in error log i got this 4 new lines while performing the transaction from my host
    [Thu Dec 30 13:27:39 2010] [error] [client 172.16.6.144] [ecid: 1293695859:172.16.48.61:25634:0:8748,0] Directory index forbidden by rule: /dev02/KMCTEST/apps/apps_st/comn/java/classes/
    [Thu Dec 30 13:27:40 2010] [error] [client 172.16.6.144] [ecid: 1293695860:172.16.48.61:25328:0:8829,0] Directory index forbidden by rule: /dev02/KMCTEST/apps/apps_st/comn/java/classes/
    [Thu Dec 30 13:28:06 2010] [error] [client 172.16.6.144] [ecid: 1293695886:172.16.48.61:25654:0:9225,0] File does not exist: /dev02/KMCTEST/apps/apps_st/comn/java/classes/oracle/forms/engine/RunformBundle_en_IN.class
    [Thu Dec 30 13:28:06 2010] [error] [client 172.16.6.144] [ecid: 1293695886:172.16.48.61:25654:0:9226,0] File does not exist: /dev02/KMCTEST/apps/apps_st/comn/java/classes/oracle/forms/engine/RunformBundle_en_IN.propertieswhile in access log i got
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "POST /OA_HTML/OA.jsp?page=/oracle/apps/fnd/sso/login/webui/MainLoginPG&_ri=0&_ti=587084970&language_code=US&requestUrl=http%3A%2F%2Fkmctapp2.kmc.com%3A8005%2FOA_HTML%2FRF.jsp%3Ffunction_id%3D2014%26resp_id%3D50670%26resp_appl_id%3D7000%26security_group_id%3D0%26lang_code%3DUS%26params%3Df7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0%26oas%3DAuZa28Bnhl7glqYyqXbjsg..&cancelUrl=http%3A%2F%2Fkmctapp2.kmc.com%3A8005%2FOA_HTML%2FAppsLogin&langCode=US&oapc=2&oas=rucHEnmoEQ25-3xRNnl0ZA.. HTTP/1.1" 302 708 1 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=28636&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=Br702.NFW.nrlg1EodytbsK-Dc1k9ERgGeColziC.cPOIi7hiyjaPiR6AJ7.Lk4IUbiFt8MZ-sww1yPk9nLXIYqdPHfttMeywkt5IQhVsrG8Y9M-0CrrcAU8ZntmtaFjlkc2vXbUaot6TQpdqAPHJyaJn6YLsew516hhfiB2xemOmo6e-.WpPrlXfvBQG.XVr-Z8y-V4uRkwwHgWHTK.ju6jLsF35BmqTRszq39cgoHe38QZqjtonDRWgTFzvxooOAmX1EHPfxfMz88uKnVWnnzU-4996ZD8e3X0Dagp19gjOYgefJlT1fTUaFvMo3cP.-7Ypt0s4Cck.GhdFOnHRK1Ok6KdvnjFyjK-WHCy4ZHCvw3NZPREYBngqJc4gvnDziIu4Yso2j4kegCe-i5OCFG4hbfDGf7MMNcj5PZy1yFwJ8GIMHyNmCAg9Yo1bXn5cTHOy7xYWHyOD5.ax3JG6Q&oas=W0vxAqkroMB_7DgeNPZhYw.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "GET /OA_HTML/RF.jsp?function_id=2014&resp_id=50670&resp_appl_id=7000&security_group_id=0&lang_code=US&params=f7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0&oas=AuZa28Bnhl7glqYyqXbjsg.. HTTP/1.1" 200 7534 0 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=28636&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=Br702.NFW.nrlg1EodytbsK-Dc1k9ERgGeColziC.cPOIi7hiyjaPiR6AJ7.Lk4IUbiFt8MZ-sww1yPk9nLXIYqdPHfttMeywkt5IQhVsrG8Y9M-0CrrcAU8ZntmtaFjlkc2vXbUaot6TQpdqAPHJyaJn6YLsew516hhfiB2xemOmo6e-.WpPrlXfvBQG.XVr-Z8y-V4uRkwwHgWHTK.ju6jLsF35BmqTRszq39cgoHe38QZqjtonDRWgTFzvxooOAmX1EHPfxfMz88uKnVWnnzU-4996ZD8e3X0Dagp19gjOYgefJlT1fTUaFvMo3cP.-7Ypt0s4Cck.GhdFOnHRK1Ok6KdvnjFyjK-WHCy4ZHCvw3NZPREYBngqJc4gvnDziIu4Yso2j4kegCe-i5OCFG4hbfDGf7MMNcj5PZy1yFwJ8GIMHyNmCAg9Yo1bXn5cTHOy7xYWHyOD5.ax3JG6Q&oas=W0vxAqkroMB_7DgeNPZhYw.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "GET /OA_HTML/cabo/images/swan/t.gif HTTP/1.1" 304 0 0 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=2014&resp_id=50670&resp_appl_id=7000&security_group_id=0&lang_code=US&params=f7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0&oas=AuZa28Bnhl7glqYyqXbjsg.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "GET /OA_HTML/cabo/images/swan/errorl.gif HTTP/1.1" 304 0 0 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=2014&resp_id=50670&resp_appl_id=7000&security_group_id=0&lang_code=US&params=f7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0&oas=AuZa28Bnhl7glqYyqXbjsg.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "GET /OA_HTML/cabo/images/swan/navBarUnderTopTabsBg.gif HTTP/1.1" 304 0 0 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=2014&resp_id=50670&resp_appl_id=7000&security_group_id=0&lang_code=US&params=f7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0&oas=AuZa28Bnhl7glqYyqXbjsg.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"
    172.16.6.144 - - [30/Dec/2010:13:32:51 +0530] "GET /OA_HTML/cabo/images/swan/footerBg.gif HTTP/1.1" 304 0 0 "http://kmctapp2.kmc.com:8005/OA_HTML/RF.jsp?function_id=2014&resp_id=50670&resp_appl_id=7000&security_group_id=0&lang_code=US&params=f7B5hnH8rkFfR.idy0MT1JZrquJxVBy3CVpSV.GpXc0&oas=AuZa28Bnhl7glqYyqXbjsg.." "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)"

  • Using jsp:include in iPlanet6SP2

    I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
    another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
    deployment both files sit under their respective folders (for example in
    c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
    [proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
    to [proj_common], and here's the code I've added in
    [proj_parent]/parent.jsp:
    <jsp:include page="../[proj_common]/common.jsp">
    <jsp:param name="p1" value="v1"/>
    </jsp:include>
    I'm using only static HTML in common.jsp as a test. The following error then
    occured when I view [proj_parent]/parent.jsp :
    500 SC_INTERNAL_SERVER_ERROR
    Error: 500 SC_INTERNAL_SERVER_ERROR
    javac error:
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
    package jsp.APPS.[proj_parent]....[proj_common];
    ^ (pointing under 2nd dot of ....)
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
    class common not found.
    public class common extends HttpServlet {
    ^ (pointing under HttpServlet)
    2 errors
    I believe this is not a path error (since that error explicitly tells me the
    included file cannot be found). I have read other previous messages and
    learn that there is a problem with <jsp:include> and relative paths... Also
    a test when both files are in the same directory shows no problem at all. Is
    there a solution to this problem of parsing relative paths in SP2?
    Thanks and regards,
    Anthony Yuen

    Another strange thing happened:
    We have been including html and jsp files. From a certain point the system was
    not able to include html files. When we renamed html includes to jsp, it was
    working again.
    Has anyone experienced the same thing?
    Does anyone know the resolution?
    Regards,
    Gyorgy
    Anthony Yuen wrote:
    I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
    another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
    deployment both files sit under their respective folders (for example in
    c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
    [proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
    to [proj_common], and here's the code I've added in
    [proj_parent]/parent.jsp:
    <jsp:include page="../[proj_common]/common.jsp">
    <jsp:param name="p1" value="v1"/>
    </jsp:include>
    I'm using only static HTML in common.jsp as a test. The following error then
    occured when I view [proj_parent]/parent.jsp :
    500 SC_INTERNAL_SERVER_ERROR
    Error: 500 SC_INTERNAL_SERVER_ERROR
    javac error:
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
    package jsp.APPS.[proj_parent]....[proj_common];
    ^ (pointing under 2nd dot of ....)
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
    class common not found.
    public class common extends HttpServlet {
    ^ (pointing under HttpServlet)
    2 errors
    I believe this is not a path error (since that error explicitly tells me the
    included file cannot be found). I have read other previous messages and
    learn that there is a problem with <jsp:include> and relative paths... Also
    a test when both files are in the same directory shows no problem at all. Is
    there a solution to this problem of parsing relative paths in SP2?
    Thanks and regards,
    Anthony Yuen

  • 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

  • Using jsp:include in showOneTab - main form not loaded on submit

    I have a JSP page with JSF and ADF components. It is a large JSP containing some main details and then an af:showOneTab component to create a set of tabs. It works fine with JDK 1.5 and Tomcat 5.0 but when changed to Oracle Application Server 9.0.4 and JDK 1.3 We get the following error:
    JspCompileException:.... code too large for try statement catch( Throwable e}....
    Finding this to be caused by large size of JSP, we divided the page as follows - a main jsp containing the main form details and 1 jsp for each tab. Whenever one of the tabs is clicked the corresponding JSP is dynamically loaded using jsp:include tag as follows:
    <af:showDetailItem text="Tab1" id="tab1" styleClass="menu">
              <f:subview id="viewTab1">
                   <jsp:include page="Tab1.jsp" />
              </f:subview>
    </af:showDetailItem>
    There is a Submit button in the main jsp, when this is clicked the main jsp is reloaded.
    But when the user navigates to any of the tabs and then clicks the Submit button in the main form, the main form is not reloaded - only the jsp for the currently selected tab is loaded.
    (I am using f:view and h:form in the main form, and no form tag in the included jsps)
    How to solve this problem?

    The af:selectOneChoice components are in the test.jsp page included in main.jsp with jsp:include tag.
    The code look like this:
                   <af:selectOneChoice label="#{msg.team}"
    id="soc1"
    value="#{myBean.selectedTeamID}"
    autoSubmit="true">
    <f:selectItems id="si1" value="#{myBean.teamList}"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="#{msg.subteam}"
    id="soc2"
    value="#{myBean.selectedSubteamID}"
    partialTriggers="soc1"
    rendered="#{myBean.selectedTeamID!=null}"
    autoSubmit="true">
    <f:selectItems id="si2" value="#{myBean.subteamList}"/>
    </af:selectOneChoice>
    the code works fine in the seperate page, but when I include the page the second selectOneChoice component doesnt get rendered.
    Edited by: Migan on 2010-jul-13 08:36

  • Using JSP include function

    Using JSP include function + collapse/expand table
    (1) I've got a page A (A.jsp) and a page B (B.jsp) which includes 3 files : the header (head.html) and the side panel of icons (icons.jsp) are the same files for both A.jsp and B.jsp
    but the 3rd file containing the contents, are different for A and B
    (2) icons.jsp
    This is what the side panel of icons is suppose to do. E.g. click on icon1, its submenu will appear and the 3rd file is suppose to link to e.g. A.jsp
    When click on icon2, icon1's submenu will collapse and icon2's submenu will expand and the 3rd file is suppose to link to B.jsp
    The expand/collapse function is written in javascript
    (3) Problem : e.g. when i click on icon1, its submenu wont remain expanded, when it changes to another page, icon1's submenu will collapse back, even though the other page includes the icons.jsp too.
    Hence, i've decided to pass a parameter using JSP to achieve the desired effect. as a result, i include the icons file like this
    <%@ include file="icons.jsp?item=icon1" %>, but the icons.jsp file isnt included into the page at all.
    Is the above include file method possible? And is it possible to use JSP to achieve the effect i've stated?
    Thanx

    sounds more like a html problem.
    Do you have a target with the <a href> of your icons? Sounds like the icon page is being refreshed as well.
    <html>
    <frameset .....>
    <frame src=header.jsp name=head>
    <frameset name=bottom>
    <frame src=icons.jsp name=navigate>
    <frame src=dummy.jsp name=content>
    </frameset>
    </frameset>
    try <img src=niceIcon1.gif>

  • 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.

  • ADF FACES EA16 Why survey demo don't use jsp:include for common part

    Is it a reason why the surveyPage1, surveyPage2 and others don't use jsp:include to load dynamically the actions, menuglobal and location facet ?
    These facet's contains the same adf components with same properties !
    Why not use a subview containing these flow management component and include this subview in the panelpage with the jsp:include ?
    I'm testing this approach but i'm not able to render these components ... may be i'm completely wrong ? I didn't find any example in the demo that demonstrate how to include subview in an adf document or panelpage.
    Help will be appreciate a lot !!!

    so what exactly is the problem here?
    what is not working?

  • Is possible to write a custom tag inside another custom tag ??

    Hi
    I�m trying to reduce the time needed to code mi app presentation layer, it uses some custom tags with certain configuration, i would like to know if its possible to do something like this inside my custom tag doAfterBody().
    public int doAfterBody() throws JspException {
              JspWriter writer=bodyContent.getEnclosingWriter();
              try {
                   writer.print("<customTag:myAnotherTag someEspecificConfigurationParams="someEspecificValues"/>");
              } catch (IOException e) {
                   pageContext.getServletContext().log("Error: "+e.getMessage());
              }return SKIP_BODY;
         }The goal is to simplify the jsp code because the configuration params for the custom tags (css styles and similar) are allways the same.
    That don�t work, it simply prints <customTag:myAnotherTag/> in screen but the tag is not evaluated, i�ve tried too something like
    public int doAfterBody() throws JspException {
              if (repeat) {
                   JspWriter writer = bodyContent.getEnclosingWriter();
                   try {
                        writer.print("<customTag:myAnotherTag/>");
                   } catch (IOException e) {
                        pageContext.getServletContext().log("Error: " + e.getMessage());
                   repeat = false;
                   return EVAL_BODY_AGAIN;
              return SKIP_BODY;
         }And it doesn�t worked worked. Maybe using the taghandler classes and calls to the doAfterBody could make it work, but when you need to nest tags it could be a little hell of coupling calls, so before doing it i would like to know if what i want is possible. After reading some books i tought it could work because the stack of out objects, but i can�t make it work.
    Another idea is to inherit from tagHandler and override some properties in the tags, but i don�t like the idea to much.
    So, can anyone help me??
    Thanks.

    You cannot do that and I have listed out the reason and a possible solution in this post http://forum.java.sun.com/thread.jspa?threadID=697243 from yesterday.
    cheers,
    ram.

  • WebLogic Server 7.0: Including another JSP from within a custom tag

    Hi all,
              has anyone made experience with including (ie. processing) a dynamic
              resource (JSP) from within a custom JSP tag?
              Using the following code inside doEndTag():
              pageContext.include("/templates/blub.jsp");
              throws a ServletException (Note: the JSP is a part of the web app
              which is deployed as war). Does it make a difference if the web
              application is warred up into and therefore include cannot resolve the
              specified relative URL?
              [Tomcat 4.1.10 doesn't have problems for that matter]
              The full stack trace is:
              javax.servlet.ServletException: java.lang.NullPointerException
              at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              at jsp_servlet._models.__index._jspService(__index.java:774)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              TIA,
              niko.
              

    Try the same code from an exploded web app.
              Niko Schmuck wrote:
              > Hi all,
              >
              > has anyone made experience with including (ie. processing) a dynamic
              > resource (JSP) from within a custom JSP tag?
              >
              > Using the following code inside doEndTag():
              >
              > pageContext.include("/templates/blub.jsp");
              >
              > throws a ServletException (Note: the JSP is a part of the web app
              > which is deployed as war). Does it make a difference if the web
              > application is warred up into and therefore include cannot resolve the
              > specified relative URL?
              > [Tomcat 4.1.10 doesn't have problems for that matter]
              >
              > The full stack trace is:
              >
              > javax.servlet.ServletException: java.lang.NullPointerException
              > at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              > at jsp_servlet._models.__index._jspService(__index.java:774)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              > at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              > at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              > at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              > at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              >
              > TIA,
              > niko.
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • 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

  • Include using jsp:include for a file from the docroot directory.

    Hello,
    I try to include one file from the doocroot but only can import files from the context (War deployed).
    when I put
    <jsp:include page="/foo.htm">
    to include this file: http://www.mydomain.com/foo.html
    it try to show this file: http://www.mydomain.com/mycontext/foo.html
    it puts ever the context before the name of my file.
    How can I include this file.
    Thanks
    PD: obviously 'foo.html' is in the doocroot.

    From within a JSP you have a reference to a PageContext called pageContext. This has a method getServletContext(). From the ServletContext you can find the real path the servlet lives in. So...
    File basePath = new File(pageContext.getServletContext().getRealPath("/"));Now basePath contains your path $Catalina/webapps/webservices. Then it's just a matter of working relative to that, e.g.:
    File usersFile = new File(basePath, "users.txt");

Maybe you are looking for