How to "extend" jsp:include ... / ?

Hello!
Does anybody know how to create custom-tag which extends the <jsp:include page='xxx'/>?
I need to pass some info in the included xxx page and I don?t want to do it by the <jsp:param /> tags.
For example: I need the tag <my:object id='7'/> and it must set some info into session and makes the work of the tag <jsp:include page='xxx'/>
Thanks much. Any assistance is greatly appreciated.

The jsp:include is just doing a RequestDispatcher.include under the covers. You could write your own custom tag that does the same thing.

Similar Messages

  • Try again: jsp:include fails with NPE in ValueBindingImpl

    JSF 1.1, RichFaces 3.1.3, WebLogic 9.2.2.
    I asked about this a couple of weeks ago, but I didn't get any useful responses.
    I have a simple "toy" application using a tabpanel that works fine right now. There is one tab that I will want to repeat several times, with only variations in the data in the fields (and the tab title). So, I copied the current template of that tab into an include file and I'm trying to include it with "jsp:include" from the original page, with a parameter. I've read all the suggestions about how to get jsp:include working with JSF, but it still doesn't work.
    When I display the page, I just get this:
    java.lang.NullPointerException
         at com.sun.faces.el.ValueBindingImpl.(ValueBindingImpl.java:98)
         at com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:292)
         at javax.faces.webapp.UIComponentTag.setProperties(UIComponentTag.java:890)
         at org.ajax4jsf.webapp.taglib.UIComponentTagBase.setProperties(UIComponentTagBase.java:80)
         at org.ajax4jsf.webapp.taglib.HtmlComponentTagBase.setProperties(HtmlComponentTagBase.java:78)
         at org.richfaces.taglib.TabTag.setProperties(TabTag.java:568)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1017)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
         at jsp_servlet.__main._jsp__tag42(__main.java:1603)
    ...more...The JSP code for the tab looks like this:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <f:subview id="propertysubview0">
              <jsp:include page="/faces/propertyTab.jsp">
                   <jsp:param name="propertyIndex" value="0" />
              </jsp:include>
         </f:subview>
    </rich:tab>The file this tries to include is this:
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:subview id="includedPropertyPage">
         <h:panelGrid id="propertyPanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn"
                              value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn"
                              value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </f:subview>For more background, here's the code in the tab before I changed it to use jsp:include, and remember that this works:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <h:panelGrid id="property0PanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn" value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn" value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </rich:tab>I don't have the source for the JSF implementation, but when I disassemble the class with the NPE, I see that the exception occurs in the ValueBindingImpl constructor that takes a Application object, and the NPE might occur because either the FacesContext or ExpressionInfoInstancePool is null (I think the former is the most likely, but I don't know why).

    Done. The results are ironically very similar to what happened with the BEA implementation, but I have a feeling this is something else, because it's failing not on the included page, but on a value binding on the main page. Perhaps I'm missing some property settings in my web.xml while using the RI.
    The entire stack trace is pretty large. I would have only included the excerpt from the root cause, but the JSF RI stack trace seems to have some interesting info up to that point. You'll see from the code at the top of the stack that either the FacesContext or the Application is null.
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:2
    1: <% session.invalidate(); %>
    2: <jsp:forward page="/faces/main.jsp"/>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    org.apache.jasper.JasperException: Exception in JSP: /main.jsp:104
    101:                <rich:tab id="ratings" name="ratings" label="Ratings">
    102:                     <h:panelGrid id="ratingsPanelGrid" columns="3">
    103:                          <h:outputText id="field3Out" value="Field3"/>
    104:                          <h:inputText id="field3In" value="#{ratingRequest.field3}"/>
    105:                          <rich:message for="field3In" showDetail="true" passedLabel=" "/>
    106:                          <a4j:commandButton id="processRequest" value="Submit Request"
    107:                                             action="#{ratingRequest.processRequest}"
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:134)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.NullPointerException
         com.sun.faces.util.Util.getValueBinding(Util.java:987)
         com.sun.faces.taglib.html_basic.InputTextTag.setProperties(InputTextTag.java:265)
         javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1027)
         javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1046)
         javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:761)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:451)
         com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:506)
         org.apache.jsp.main_jsp._jspx_meth_h_005finputText_005f3(main_jsp.java:1375)
         org.apache.jsp.main_jsp._jspx_meth_h_005fpanelGrid_005f3(main_jsp.java:1309)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftab_005f3(main_jsp.java:1278)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftabPanel_005f0(main_jsp.java:950)
         org.apache.jsp.main_jsp._jspx_meth_a4j_005fform_005f0(main_jsp.java:208)
         org.apache.jsp.main_jsp._jspx_meth_f_005fview_005f0(main_jsp.java:162)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:124)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • How to Parse Escape Character(&) with JSP Include URGENT

    Hi,
    I guess anyone could help me out.
    I have a JSP file where I am including another JSP file and setting parameter for that include file. Among those parameters one of the parameter is having a value having ampersand with it. like R&D. In such case am i getting following error.
    I dont know how should I get rid of this &.
    I tried converting it to amp; even tried \\& also tried using escape("R&D"). But no success. Can you guys help
    Code:
    <jsp:include page="../hottopics/controller_hottopics1.jsp" flush="true">
    <jsp:param name="UserID" value="<%=username%>" />
    <jsp:param name="kmsid" value="<%=kmsid%>" />
    <jsp:param name="department" value="<%=department%>"/>
    <jsp:param name="location" value="<%=location%>"/>
    <jsp:param name="supportorg" value="<%=supportorg%>"/>
    <jsp:param name="supportflag" value="<%=supportflag%>"/>
    </jsp:include>
    department : R&D
    Error :
    java.lang.IllegalArgumentException
    at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:151)
    at org.apache.tomcat.facade.RequestDispatcherImpl.addQueryString(RequestDispatcherImpl.java:546)
    at org.apache.tomcat.facade.RequestDispatcherImpl.doInclude(RequestDispatcherImpl.java:388)
    at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:270)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
    at ITHelpAlerts_0002dv_00034._0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7._jspService(_0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7.java:210)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:534)

    Okay, not surprising. Like I said, the & has special meaning in URLs, to seperate one parameter from the next. Perhaps you should thing about using request attributes instead of parameters:
    request.setAttribute("department", "R&D");
    //then on recieving side
    String department = (String)request.getAttribute("department");

  • How to do a redirect after a jsp:include

    Friends,
    How do I do a redirect either through HttpServletResponse.sendRedirect () or
    <jsp:forward /> in a JSP that does a <jsp:include /> at the top.
    I am getting a IllegalState exception.
    Thanks
    Regards
    Lawrence Lourduraj
    VocaLoca Inc.

    In the doc, it states:
    sendRedirect
    If the response has already been committed, this method throws an
    IllegalStateException. After using this method, the response should be
    considered to be committed and should not be written to.
    In other words, you must not do anything before or after with the response.
    Cameron Purdy, LiveWater
    "Lawrence Lourduraj" <[email protected]> wrote in message
    news:8ip9p4$r0g$[email protected]..
    >
    Friends,
    How do I do a redirect either through HttpServletResponse.sendRedirect ()or
    <jsp:forward /> in a JSP that does a <jsp:include /> at the top.
    I am getting a IllegalState exception.
    Thanks
    Regards
    Lawrence Lourduraj
    VocaLoca Inc.

  • How to extend apple.schema to include apple-user-homeDirectory

    Howdy All,
    I'm trying to extend the apple.schema in open directory on 10.5 Server to include the apple-user-homeDirectory attribute. I see that it included, but commented out in the apple.schema. I tried removing the comments and restarting openldap, but it's still unavailable.
    Any ideas?
    John

    See these relevant discussions:
    Best bets to extend/boost signals from Airport and AP Extreme
    How to extend and Extreme network using Express

  • 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

  • How to get JSP to include content from another WAR

    I'm writing a group of web applications that are all going to be run out of the same web server with the same domain name. Since these applications are all independent, I want to give them separate wars.
    I've created a directory application that lets the user create an account, log in, and pull up a listing of each of the other applications on the server. However, rather than just posting a hyperlink to each of the other apps, I'd like to call a custom .jspf in the respective wars so that they can return a block of HTML that gives a richer user experience (the HTML will contain some formatted text that describes the link, given the user ID and a couple of other parameters).
    Anyhow, jsp:include seems to have me sandboxed inside my directory app. <jsp:include page="../MyOtherApp/link.jspf"/> causes an error. Is there someway I can have my directory call custom pages in my other wars and include the results in the generated webpage?

    use <%@include file="../MyOtherApp/link.jspf" %>

  • How to do a jsp:include inside a noscript tag??

    I am new to JSP and I need help to do a <jsp:include page="pageName" /> inside a <noscript> tag. My goal is to include another jsp if the user has javascript disabled on its browser.
    I am using a JSP template that retrieves content from the Database, so I need to pass a parameter also, like:
    <noscript>
    <jsp:include page="/include/template.jsp" flush="true"/>
         <jsp:param name="pageName" value="holidays_onboard_html"/>
    </noscript>
    My code doesn't seem to work. I found an explanation that says that the noscript tag is interpreted after the servlet already tried to compose the original page, so I can't use a <jsp:include> tag inside the noscript tag. Is it true? Is there any other solution for what I am trying to accomplish?
    Thanks a lot!

    Java indeed runs at the server side, not at the client side. Java runs at the server side and produces a HTML page. HTML only runs at the client side.
    The <noscript> tag is not a Java/JSP tag, it is a HTML tag. What you want is only possible when you checked in Java if the client has JS enabled, e.g. using a request parameter, or by loading the page template using a HTML tag, e.g. <iframe>.

  • [JSP/Newbie]: howto write my own jsp:include tag?

    Hi folks,
    I'm trying to write a replacement tag for <jsp:include> (which shall later decide upon its context what to include..), i.e. I want to include another JSP from within a tag.
    Unfortunately right now my best bet does not allow to control the position of the included JSPs output in my output stream - it prints directly :-((
    // index.jsp is my startpage:
    <%@ taglib uri="/cistags" prefix="cis" %>
    index.jsp START:
    <cis:include file="/theincludefile.jsp" />
    index.jsp ENDE
    // theincludefile.jsp is the included file
    -->INCLUDEFILE<--
    // include.java is my current idea to approach this:
    public class include extends TagSupport {
    private String jspName;
    public void setFile(String name) {
    this.jspName = name;
    public int doEndTag() {
    HttpServletRequest request =
    (HttpServletRequest) pageContext.getRequest() ;
    HttpServletResponse response =
    (HttpServletResponse) pageContext.getResponse() ;
    try {
    request.getRequestDispatcher(
    response.encodeURL(jspName)).include(request,response) ;
    catch (Exception e) { }
    return EVAL_PAGE;
    the result expected is:
    index.jsp START:
    -->INCLUDEFILE<--
    index.jsp ENDE
    but instead I receive:
    -->INCLUDEFILE<--
    index.jsp START:
    index.jsp ENDE
    So how can I get hold of the ouput generated by the JSP I'm calling through RequestDispatcher.include so that I can rewrite it into my own output stream here?
    Is someone out there able to point me into the right direction?
    Ingo
    [email protected]

    check this article out
    http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html

  • Jsp:include does not work in 8.1 SP3?

    Hi all,
              I need to include a local file (external to the app) in jsp code. The external file includes an image map which changes very so often. So in order to avoid doing a build everytime, I thought about keeping the image map in a file which can be "included" in the jsp file, making it very dynamic to a change.
              So I have a servlet which will read this file and output the contents to response.getWriter(), which will be included in calling jsp code.
              But the jsp file does not seem to call the servlet at all.
              Here is the code in the jsp file:
              <%
              String sFileUrl = "/Prj/RenderReport?file=OrgChart.html";
              %>
              <jsp:include page="<%=sFileUrl%>" />
              What am I doing wrong? Is this not possible at all?
              Thank you all in advance.

    hi pjoshi,
              <jsp:include page="hello.jsp" /> tag is working fine in weblogic 8.1 sp3.
              I think it might be syntax error in your jsp page.
              This is the syntax to including dynamic files in jsp using <jsp:include page="" />tag as given below.
              <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
              go through the below link and you will find exact information how to include dynamic files in jsp using <jsp:include page=""/>
              http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html
              --Anilkumar kari                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Reusing the same jsp include multiple times on the same page

    If someone knows a way out of this
    I'd like to print out 2 records of the same data type I have a JSP include which does that.
    Now my issue is how to use the same include twice on the same page
    Ideally I would like to do the following:
    <%
    request.setAttribute("person", person1);
    %>
    <jsp:include page="./person.jsp"/>
    <%
    request.setAttribute("person", person2);
    %>
    <jsp:include page="./person.jsp"/>
    And in person.jsp
    I could have
    <h:inputText name=#{person.name}/>
    This fails in the updateModel phase - And I realize why it's failing. There really is no person managed bean.
    It's just that I am at a kind of loss as to what I need to do now -
    Am missing something or is it just impossible to use jsp:includes the way Ive tried to?

    I do not understand, have you created a backing bean named person? Have you defined it in your config file?
    Please copy/paster your backing bean code and config file.
    Normally, you can set directly the value of the bean by using some java code in your jsp instead of setting the request attribute.

  • How to extend an address of a BP  with more fields ???? EEWB??

    Hi Gurus,
    I need to extend the address of a BP with some customer fields. I have tried to do it using EEWB but when you have to choose a Business Object for the new extension, the reasonable only possibility is to choose BUPA Object. Thus, the DB table BUT000 is extended with a custom include that contains the customer fields, but what I want to do is extending ADRC DB table. There is some way that I do not know of achieve this in which the system creates automatically all the FM for the BDT events????
    If it is not possible, which would be the procedure to do that with my own development???
    Thanks in Advance.
    Regards,
    Rosa

    Rosa, you can only extend table BUP000 and not the actual address table. Sorry for that for more details on how to extend the BP itself refer to my WeBLOG I wrote on this. Have fun and let me know whether you need more help, Tiest.
    Also do not forget to award points to useful responses.
    <a href="/people/tiest.vangool/blog/2005/07/24/pc-ui-and-easy-enhancement-workbench-eew-integration and Easy Enhancement Workbench (EEW) Integration</a>

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

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

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

  • OK.. ha ha funny. But really does ojsp really support jsp:include ?

    I've been reading this list for a month or so now and still have a nagging question.
    Has anyone gotten ojsp to work using an include of the form: <jsp:include page="/somefile.jsp" />?
    According to the Oracle JSP team you should be able to use it:
    <% request.setAttribute("show","script"); %>
    <jsp:include page="/search_navigation.jsp"/>
    [/CODE\
    Similar to the IBM Websphere example.
    <HR></BLOCKQUOTE>
    This sounds nice, but first the syntax above is missing the flush modifier (which ojsp requires to be set to "true"), second the server gives the error:
    A Servlet Error Occurred
    An unexpected error occured attempting to run this servlet.
    The most likely explanation is a problem with the servlet code.
    Please check the server log for a detailed message.
    So can anyone use the <jsp:include> action in ojsp (the current one on OTN)?
    Thanks in advance.

    Thanks for your reply. Answers below:
    <jsp:directive.page language="java" />
    <jsp:include page="/arena/pages/login.jsp" flush="true" />
    <html>
    <body>
    Hello there.
    </body>
    </html>Generates this code:
    package jsptest;
    import oracle.jsp.runtime.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import java.io.*;
    import java.util.*;
    import java.lang.reflect.*;
    import java.beans.*;
    public class test1 extends oracle.jsp.runtime.HttpJsp {
    public final String _globalsClassName = null;
    // ** Begin Declarations
    // ** End Declarations
    public void _jspService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    /* set up the intrinsic variables using the pageContext goober:
    ** session = HttpSession
    ** application = ServletContext
    ** out = JspWriter
    ** page = this
    ** config = ServletConfig
    ** all session/app beans declared in globals.jsa
    JspFactory factory = JspFactory.getDefaultFactory();
    PageContext pageContext = factory.getPageContext( this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
    // Note: this is not emitted if the session directive == false
    HttpSession session = pageContext.getSession();
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) {
    pageContext.setAttribute(OracleJspRuntime.JSP_PAGE_DONTNOTIFY, "true", PageContext.PAGE_SCOPE);
    factory.releasePageContext(pageContext);
    return;
    ServletContext application = pageContext.getServletContext();
    JspWriter out = pageContext.getOut();
    test1 page = this;
    ServletConfig config = pageContext.getServletConfig();
    try {
    // global beans
    // end global beans
    out.println( "");
    out.println( "");
    String __url = (String) "/arena/pages/login.jsp";
    // Include
    out.flush();
    pageContext.include( __url);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    out.println( "");
    out.println( "");
    out.println( "<html>");
    out.println( "<body>");
    out.println( "Hello there.");
    out.println( "</body>");
    out.println( "</html>");
    out.flush();
    catch( Exception e) {
    try {
    if (out != null) out.clear();
    catch( Exception clearException) {
    pageContext.handlePageException( e);
    finally {
    if (out != null) out.close();
    factory.releasePageContext(pageContext);
    }You'll notice the out.flush() just prior to the pageContext.include(). BTW I have to have flush="true" or OAS throws a fit.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Sorry for any inconvenience caused.
    Thanks.<HR></BLOCKQUOTE>
    Thank you.
    null

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

Maybe you are looking for