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.

Similar Messages

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

  • Qns about jsp:include and jsp:forward

    It is said that <jsp:include>'s flush is only fixed to "true". Which means the page cannot pass its full control to another page using <jsp:forward> tag.
    Is there any ways to overcome this problem? Using both in the same jsp and allow it to passes full control.

    Hmm.. I'm using the form action to call back the jsp itself to validate something, and the include to add in another jsp file together with the original jsp to produce some addon visual effects.
    So saying if validate is true, forward to another jsp.
    So the form action.. cannot be use I think.

  • Continuing problems about JSP compilation...

              I have two problems that I can't solve about JSP:
              - my JSPs aren't recompiled when I modify them
              I've got to redeploy the entire webApp for the
              modification to be updated.
              - the precompilation of my JSPs fails
              I've got the common NullPointerException in JSP2Java.makeReader
              I'm working in the deployed directory way, with a WL6.0sp2...
              My xml files seem to be correct and the clocks of the different machines are synchronized.
              I read several threads and solutions concerning those problems but all of these
              were applied and it still doesn't work...
              If someone could help me... TIA...
              

              JimmyL wrote:
              > I have two problems that I can't solve about JSP:
              >
              > - my JSPs aren't recompiled when I modify them
              > I've got to redeploy the entire webApp for the
              > modification to be updated.
              On admin server or managed server????
              >
              >
              > - the precompilation of my JSPs fails
              > I've got the common NullPointerException in JSP2Java.makeReader
              >
              Answered in the other email..
              Kumar
              >
              > I'm working in the deployed directory way, with a WL6.0sp2...
              > My xml files seem to be correct and the clocks of the different machines are synchronized.
              >
              > I read several threads and solutions concerning those problems but all of these
              > were applied and it still doesn't work...
              >
              > If someone could help me... TIA...
              

  • About jsp:include

    i want to show the content of page2.jpg in page1.jsp. i use <jsp:include>, but failed.there is nothing in page1.jsp.
    the jsp source code of page1.jsp follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=GBK" pageEncoding="UTF-8"/>
    <jsp:text><![CDATA[
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ]]></jsp:text>
    <f:view>
    <html head="#{Page1.head}" lang="zh-CN" xml:lang="zh-CN">
    <head>
    <meta content="no-cache" http-equiv="Cache-Control"/>
    <meta content="no-cache" http-equiv="Pragma"/>
    <title>Page1 Title</title>
    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
    </head>
    <body style="-rave-layout: grid">
    <h:form binding="#{Page1.form1}" id="form1" style="background-color: rgb(153, 153, 255)">
    <h:panelGrid binding="#{Page1.gridPanel1}" columnClasses="list-paging-header" id="gridPanel1"
    style="left: 96px; top: -52px; position: absolute" styleClass="list-header">
    <f:subview id="linkpage1">
    <f:verbatim>
    <jsp:include page="/page2.jsp"/>
    </f:verbatim>
    </f:subview>
    </h:panelGrid>
    <f:subview id="linkpage2">
    <f:verbatim>
    <jsp:include page="/page2.jsp"/>
    </f:verbatim>
    </f:subview>
    </h:form>
    <f:subview id="linkpage3">
    <jsp:include page="/page2.jsp"/>
    </f:subview>
    </body>
    </html>
    </f:view>
    </jsp:root>
    i use the following tag segment in three position to check the outcome, but nothing on page1.jsp yet.
    <f:subview id="linkpage*">
    <jsp:include page="/page2.jsp"/>
    </f:subview>
    who can help me?thanks

    Hi,
    Take look at the below threads may help you
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=51180
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=52631
    MJ

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

  • Qestion about jsp:include

    When using <%@ include> , file is included at compiler time. So a) is OK because ShowForm.jsp has access to the form bean.
    When using <jsp:include>, file is included at runtime. So b) is wrong.
    But why c) is correct? Does "flush" attribute for <jsp:include> make things different?
    /////////////form.jsp
    <jsp:useBean id='form' class='beans.Form' scope='request'>
    <jsp:setProperty name='form' property='*'/>
    </jsp:useBean>
    <%@ include file ='showForm.jsp' %> <--a) OK
    <jsp:include page='showForm.jsp' /> <--b) wrong
    <jsp:include page='showForm.jsp' flush = 'true' /> <--c) OK . Why ?????
    ///////////showForm.jsp
    <b>name: </b> <%= form.getName() %><br>
    <b>comments: </b> <%= form.getComments() %><br>
    <b>credit: </b> <%= form.getCredit() %></p>

    When using <%@ include> , file is included at
    compiler time. So a) is OK because ShowForm.jsp has
    access to the form bean.
    When using <jsp:include>, file is included at
    runtime. So b) is wrong.
    But why c) is correct? Does "flush" attribute for
    <jsp:include> make things different?
    /////////////form.jsp
    <jsp:useBean id='form' class='beans.Form'
    scope='request'>
    <jsp:setProperty name='form' property='*'/>
    </jsp:useBean>
    <%@ include file ='showForm.jsp' %>
    <--a) OK
    <jsp:include page='showForm.jsp' />
    <--b) wrong
    <jsp:include page='showForm.jsp' flush = 'true' />
    <--c) OK . Why ?????
    ///////////showForm.jsp
    <b>name: </b> <%= form.getName() %><br>
    <b>comments: </b> <%= form.getComments() %><br>
    <b>credit: </b> <%= form.getCredit() %></p>Are you sure that c is ok, and that you are not just flushing the output to the user before you can display an error message? Try putting information after c) and see if it gets displayed, and check your log files and see if an error is occuring that you are not seeing...
    (not sure if that is real or not, just my suspicion...)

  • How to use bean:write inside jsp:include ?

    I got a problem about JSP's syntax. The following is my code:
    <%@ include file="<bean:write name="HelloForm" property="target" />"%>
    The double quotes inside bean:write is my problem. Could you please teach me how to use bean:write within JSP's include? Thank you!

    http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    Include Directive vs <jsp:include>
    The include directive <%@include %> is done at page translation/compile time.
    It effectively pastes in a static file, and then compiles the JSP as if it was all one file.
    As such, you cannot provide a runtime expression to it.
    To do runtime inclusion, you need to use the <jsp:include> tag which does except runtime parameters.
    <%String test = request.getParameter("pageInfo");%>
    <%String link = test + ".jsp"; %>
    <jsp:include page="<%= link %>" %>Unfortunately you can't use the tag with a bean:write tag as well, you can only use runtime expressions, not tag. So you have to do the include with
    <jsp:include page="<%= HelloForm.getTarget() %>" />
    Cheers,
    evnafets

  • 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

  • Calling custom tags in jsp  with jsp:include

    Hi,
    I have a large jsp file , which uses jstl fmt tags for labels.
    Since the size of jsp was too big iand i was unable to compile it because of 64 kb class size limit,
    I removed the tag lib defination from the jsp file and put it in another jsp file. and used jsp:include to include this file inside the first jsp.
    It is compiling successfully but labels r not showing up.
    but when i use <%@include to include second jsp in the first one i get the labels properly.
    I cannot use <%@include as this starts giving me compilation error related with jsp class file size beyond 64 kb.
    Pls suggest why jsp:include is not working.
    thanks,
    Pramod

    Hi Anil,
    Ur suggestion was good but could not solve my problem.
    I have put a small sample code to illustrate the problem.
    labeldemo.jsp:
    <%-- <%@ include file="WDCComInitLabelsjunk.jsp" %> --%>
    <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tablebg">
                                  <tr class="headtd">
                                       <td colspan="4"><span class="headtext"><fmt:message key="Cash_Management"/> </td>
                                  </tr>
                                  <tr> hi </tr>
                             </table>
                             </fmt:bundle>
    WDCComInitLabelsjunk.jsp:
    <%@ page language="java" %>
    <%@ page contentType="text/html"%>
    <%@ page import="com.tcs.wdc.core.*" %>
    <%@ page import="com.tcs.wdc.core.login.*" %>
    <%@ page import="com.tcs.wdc.core.service.navigation.*" %>
    <%-- Include tag library --%>
    <%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
    <%-- Get language from IDCUserSession & set it in session --%>
    <%
    /*SessionManager sm = new SessionManager(session);
    IDCUserSession ius = sm.getIDCUserSession();*/
    session.setAttribute("language","nl_NL");
    %>
    <%-- Set the locale for the language obtained --%>
    <fmt:setLocale value="${language}" />
    <fmt:bundle basename="labels" />
    If i uncomment the <%@ include file="WDCComInitLabelsjunk.jsp" %> tag in the code above it is working fine ,
    but it is not working with <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    pls suggest.
    Thanks,
    Pramod

  • 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

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

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

Maybe you are looking for