JSCookMenu and jsp:include

I'm newbie to JSF. I want to add dynamic menu to my page. and when click on a menu Item in the same page I want to display corresponding page. So, I tried to use jsp:include tag to display the page.
<f:subview id="myMenu">
            <t:jscookMenu layout="hbr" theme="ThemePanel" >
                <t:navigationMenuItems value="#{dynMenu.navItems}" />
            </t:jscookMenu> 
</f:subview>     
<f:subview id="midPage" rendered="#{dynMenu.pageUrl != null}">          
          <jsp:include page="customer.jsp"/>
</f:subview>but when I use this way Menu is not displaying
If I remove <jsp:include page="customer.jsp"/> then menu is displaying.
(in the page If I use jsp:include tag any where, the menu is not displaying)
pls help me....
Rohitha

I'm newbie to JSF. I want to add dynamic menu to my page. and when click on a menu Item in the same page I want to display corresponding page. So, I tried to use jsp:include tag to display the page.
<f:subview id="myMenu">
            <t:jscookMenu layout="hbr" theme="ThemePanel" >
                <t:navigationMenuItems value="#{dynMenu.navItems}" />
            </t:jscookMenu> 
</f:subview>     
<f:subview id="midPage" rendered="#{dynMenu.pageUrl != null}">          
          <jsp:include page="customer.jsp"/>
</f:subview>but when I use this way Menu is not displaying
If I remove <jsp:include page="customer.jsp"/> then menu is displaying.
(in the page If I use jsp:include tag any where, the menu is not displaying)
pls help me....
Rohitha

Similar Messages

  • Difference between jsp:forward sendRedirect and jsp include directive

    Am very much confused, please explain me the difference between
    jsp:forward sendRedirect and jsp include directive with a suitable example.
    I'll be very gratefull. Its very urgent.

    One basic difference. The include executes in the .jsp servelet created. The redirect transfers "control" by redirecting the client request to another destination. In other words, the current .jsp is no longer in charge or in the calling chain in any way.

  • Workshop 8.1: Page Flow Action and jsp:include

    Hi everybody.
    Can i use jsp:include to "include" a page flow action ?
    I've tried it, but odd things are happening: The resource got included, but fragments of html source "around" it are been lost.
    Any ideas ?
    Thanks in advance.

    Hi Daniel
    There are 2 ways you can acheive this.
    1) Using something called Pageflowscoped form for this. This will let you use arrays for checkbox group.
    The main part will be that you need to define a member varaible of the form at the pageflow level there by the data will not be lost
    2) Using Request scoped form like you have now but need to modify the getter method to populate the "searchResult" object.
    public List getSearchResult() {
    if( null == searchResult){
    System.out.println(" Pouplate the searchResult here. ");
    searchResult= new ArrayList();
    //populate the default values.
    return this.searchResult;
    More info at:
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/netui/guide/conReqScopedVsPageScopedBean.html
    I have a sample with pageflowscoped bean and requestscoped bean that I can send you if you provide your email address.
    Unfortunately we cannot attach files in the newsgroup.
    Thanks
    Vimala

  • Javascript error with f:subview and jsp:include

    Hi,
    I have tried to include one jsp page with jsf components into another jsp page with jsf components. But somehow I get a Javascript error.
    I have of course included the jsp:include into an f:subview like this:
    <f:subview id="tree" rendered="#{tabsBacker.treeRendered}">
    <jsp:include page="mission.jsp" />
    </f:subview>In mission.jsp, all non-jsf tags are surrounded by f:verbatim tags (otherwise, JBoss would complain anyway).
    The Javascript error says: "elements.form1:_link_hidden_ is null".
    "form1" is the name of the form in my jsp page which includes the other one.
    As soon as I remove the jsp:include thing, everything works fine. The include happens in a t:panelTabbedPane, and (probably as a result of the javascript error), the tab where the included page should be shown, can't be displayed. I can click on the tab, the page is reloaded, but nothing else happens.
    The error occurs in IE and in Firefox.
    Can anyone help me to solve this problem??
    Kind regards,
    Wiebke

    It's just a jsp fragment file. Here's the start of the jspf included above:
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx" %>
    <f:subview id="browseForm">
    <table class="box" width="100%">
         <tr>
              <td><h:outputText value="#{labels.someValue}" styleClass="smalltitle"/></td>
         </tr>And so on. This was just done to stop the jsp files becoming too long, I think. So the subview tag is included in the jspf file rather than around the jsp file as you have it.
    Illu

  • GetRequestURI() and jsp:include

    I have a page, a.jsp (referenced from http://server/app/a.jsp). This page has a line that looks like this:
    <jsp:include page="/app/foo/b.jsp" />
    Now, in b.jsp, I need to get the full URI (/app/foo/b.jsp). The request.getRequestURI() method returns the URI for the original page (a.jsp). I've tried a number of different things, but cannot come up with a way to retrieve this information that is independent of the JSP engine that I am using. Is this actually possible?
    Thanks!

    Hi jfeldmann,
    Did you have a look on
    1.
    javax.servlet.include.request_uri
    javax.servlet.include.query_string
    2.
    put in b.jsp to see
    <%=request.getAttribute("javax.servlet.include.request_uri")%>
    <%=request.getAttribute("javax.servlet.include.query_string")%>
    --Paul.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

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

  • "include directive or jsp:include "

    Hi,
    Which amongst <%@ include file="header.jsp" %> and
    <jsp:include page="header.jsp"/>to be used, when performance is taken into account.

    Code copy from serverside.com
    Is it the same as --> jsp:include and %@ include directive.
    Actually, <jsp:include> vs. <%@ include %> is a different story.
    <%@ include %> is a "compile-time" include. The included file is inserted into the JSP when the JSP compiles.
    <jsp:include> is a "run-time" include. If JSP-1 includes JSP-2, JSP-2 is invoked when JSP-1 executes, and the output of JSP-2 is inserted into the output stream of JSP-1.
    The run-time include runs a bit slowly, but can save a lot of system memory, so in general, the run-time include is preferable. Only use the compile-time include if the include code must be in the same page.
    For example, if you want to use an include that defines a bunch of tag libraries with the taglib directive, it will have to be a compile-time include. If you just want to insert a standard header and footer in your page, a run-time include will be more effecient.
    I hope its enough for you to get an clear cut idea,

  • JSTL core tags not working inside of a jsp:include?

    I have declared the core JSTL tag and have a jsp include tag that calls another jsp page. I want to be able to execute a c:if statement inside the included file, but the c:if statement does not execute and is read back to me within the html. This is a frustrating problem because the EL returns a true or false based on the param I sent, but the c:if does not run.
    Is there a way to fix this, or is this something that I can't change?
    Note: I have found a workaround by using the include directive. I would rather use the jsp:include action, but unless this problem gets solved I will be sticking with the directive.
    Thanks
    Message was edited by:
    nberveiler

    You need to have the Core taglib declared on the page that you are including with jsp:include.
    There is a subtle difference between the include directive <%@ include %> and <jsp:include>
    The latter happens at runtime, and includes the result of running the included page.
    Therefore any page included with <jsp:include> needs to be completely standalone, and declare all of its own taglibraries that it uses. It can't inherit them from the "including" jsp.
    The include directive works, because it pastes in the contents of the included file at compile time - effectively making one big JSP file.
    Cheers,
    evnafets

  • Debugging JSP includes

    We are having a debate on what type of jsp includes to use.
    One option is the static include:
    <%@ include file="testinclude.jsp" %>
    The other the dynamic include
    <jsp:include page="testinclude.jsp" flush="true" />
    A major stumbling block to using the former is that we can not seem to debug using it - a breakpoint set at that line appears to be ignored, and any breakpoints within the include itself also appear to be ignored. Why is that?
    Also, are there opinions on the pros and cons between these two methods?
    Thanks,
    Amy Schmieder
    Rentals.com

    Hi Amy,
    The difference between the two tags is that <%@ include> (the "include directive") is processed at compile time, and <jsp:include> (the "JSP include tag") is processed at runtime.
    A JSP is compiled into a Java servlet. When the compiler sees the include directive, it finds the relevant code, compiles it, and drops it straight in. A breakpoint on the directive is never reached because the directive doesn't exist in the compiled version at all (it's been replaced with the included code), and breakpoints in the included code are forgotten when the code is inserted (since they're not stored in the code itself).
    The jsp include tag, on the other hand, functions sort of like a method call to the included code. It's invoked at runtime.
    Advantages and disadvantages:
    On repeat hits, the include directive is faster, since it only needs to be processed once, at compile time.
    However, for just this reason, it's more limited. The jsp include tag can be dynamic--you can programmatically figure out, within your JSP, what you want to include (or, say, what parameters you want to pass the included page). An include directive won't let you do that--information about what exactly will be included must be present at compile time.
    So, for example,
    <jsp:include page="<%= includePage %>" flush ="ture"/>
    is perfectly legal, but
    <%@ include file="<%= includePage %>" %>
    isn't.
    Hope this helps,
    Avrom
    null

  • Jsp:include directives compilation errors

    hi,
    we have lot of <%@ include file="" %> files in out jsp page. when we trying to change this to <jsp:include page="" %>. we r getting lot of comilation errors
    The file size is increasing more than 64mb.
    Can u tell how to contain them within 64mb .
    thank you.

    The stack trace isn't very indicative of whatever problem you may be having.
    However, there is a major difference between <%@ include %> and <jsp:include />. The include directive <%@ include %> slams the content of the included resource into your JSP at compilation time, it is "static". No individual evaluation of the included resource is done, it becomes a part of the JSP that included it.
    <jsp:include /> is a dynamic include--it is evaluated at run-time. The content of the included resource is accessed and written to the output stream with the JSP is accessed. If the included content is a JSP, it is compiled and accessed as a separate servlet.
    So, it looks like your included JSPs do not qualify as valid, standalone JSPs. Typically, this is because of some dependency on variables or beans declared in the including JSP.
    Good luck.
    -brian

  • Jsp:Include VS @ include

    Hi,
    Is there a big diffrence between using <%@ include file="url" %> and <jsp:include page="relative URL" flush="true"/>?
    I know that the first is put in the servlet at the translation and the second is included when the page is requested. I use this for my web pages header which is the same for every page. Which one would be the best?
    thanks,
    Stephane

    Hi,
    Is there a big diffrence between using <%@ include
    file="url" %> and <jsp:include page="relative URL"
    flush="true"/>?This question has been answered many times :-)
    http://www.google.com/search?q=difference+between+include+directive+and+jsp+include
    >
    I know that the first is put in the servlet at the
    translation Here's the full official description on include directive:
    http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408
    and the second is included when the page
    is requested. Here's the description on jsp:include
    http://java.sun.com/products/jsp/syntax/2.0/syntaxref2020.html#8828
    I use this for my web pages header
    which is the same for every page. Which one would be
    the best?Think about the future changes, in the future will you ever add dynamic content to the header? Then go with jsp:include or if you are into JSTL use c:import
    If you are very sure that you don't need to add dynamic code to the header then go with the include directive. But be sure of this, otherwise you;ll have to change all JSP headers -- probably with search and replace --- but still it will be a PITA.
    Another option is you could set coda and prelude in web.xml , that will auto include static content in all JSP pages --- with coda and prelude specified in web.xml you don't have to include files in the JSP pages themselves. But the disadvantage is that the header and footer will appear before the opening html and after the closing html tag.
    >
    thanks,
    Stephane

  • Jsp include and jsp param

    Hi All,
    I have the following:
    <jsp:include page="anotherPage.jsp">
            <jsp:param name="testing" value="sdfasdfsd"/>
    </jsp:include> And in anotherPage.jsp I have:
    <%@ taglib uri="/WEB-INF/tld/commons-log.tld" prefix="log" %>
    <log:dump scope="request"/>
    <log:dump scope="session"/>
    <log:dump scope="page"/>
    <log:dump scope="application"/>
    <h3>
    Test: <%= request.getParameter("testing") %>
    </h3>Not only does this output:
    Test: null
    but I don't see 'testing' anywhere in the dumps! What is going wrong?
    Have I badly misunderstood parameter sending? :-/
    Actually, my assumption was that the include code puts the "testing" variable
    into the request.. 1) where does jsp:param put the data items it
    passes through and 2) if the data item didn't previously exist as a
    request parameter, does it ignore it?
    Any assistance would be most appreciated!
    Rob
    :)

    Depends on the server version you are using. If you are using a JSP 2.0 server like Tomcat 5, then you should be able to do that, as long as you set up the container correctly (to use servlet 2.4 and JSP 2.0 specs rather than 2.3 and 1.2...)
    Is you are using a JSP 1.2 container (less then TC5) then you will not be able to use EL anyware except in JSTL tags. The fix is to use the JSTL tags to do the include:
    <c:import url="thepage.jsp">
      <c:param name="param1" value="${attr}"/>
    </c:import>

  • OC4J 10.1.3.1 and Spring - jsp:include issues

    Hi,
    I've got a strange problem when using OC4J 10.1.3.1 together with Spring framework.
    I have several controllers in spring that generate things like page headers, footers, and other common elements. Historically I've merged these into a page with jsp:include or a c:import directive in the page.
    However, with the newer versions of OC4J, it will retrieve the content for the first request, and then repeat that same content for each subsequent request.
    If I replace that controller request with a direct .jsp page request, those elements are inserted and merged without any problem into the main page.
    I haven't had this problem on other servers... nor have I had the problem with OC4J until the latest release... Does anybody have an idea how to allow me to merge this Spring-Controller generated content with a jsp page successfully?
    thanks!

    Sure, I've examined it a few times when I've adjusted various JSP options.. mostly around the tag handling. By the way, right now I have Tag Resuse Default set to "compiletime with release", though I've tried the other options as well.
    __ojsp_s_out.write(__oracle_jsp_text[0]);
    /*@lineinfo:translated-code*//*@lineinfo:6^5*/ {
    String __url=OracleJspRuntime.toStr("/global/globalHeader.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    /*@lineinfo:generated-code*/
    __ojsp_s_out.write(__oracle_jsp_text[1]);
    /*@lineinfo:translated-code*//*@lineinfo:11^1*/ {
    String __url=OracleJspRuntime.toStr("/global/globalNav.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    /*@lineinfo:generated-code*/
    __ojsp_s_out.write(__oracle_jsp_text[5]);
    /*@lineinfo:translated-code*//*@lineinfo:35^1*/ {
    String __url=OracleJspRuntime.toStr("/global/globalFooter.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    There are three obviously.. and with this page execution I see the first one (globalHeader.do) duplicated three times in the final page.
    thanks!

  • JSP, c:forEach, and import / include(s)

    To any,
    I'm having a bit of a problem. I'm currently working on a webapp which basically translates information in an XML file to a neat webpage, using Spring MVC / JSP / JSTL / the works.
    There's several items in the XML file that are of the same format, which as such use the exact same bit of HTML to represent. So, I figured, let's do it like so and so:
    <c:forEach items="${plugin.executions.execution}" var="execution">
         <jsp:include url="execution.jsp"/>
    </c:forEach> Buut this doesn't work, most likely because execution.jsp is parsed / compiled not at runtime, but at compile time (or whatever), leading to an error (which I can't see by the way) because the 'execution' variable isn't present in execution.jsp.
    Note that I'm not getting any errors (at least, not in the console using Maven, the jetty:run command), just a blank screen with nothing in there.
    What I'm looking for is a solution to this. Basically, I'm looking for an include statement that chucks the html / jsp found in execution.jsp into the forEach loop, then compiles and displays it.
    I've tried <jsp:include>, <c:import>, <%@ page import=""%>, but none of the three works. I've asked for an alternative, but those include creating my own tag library (although I don't think that'll work) or switching to an entirely different view framework (like Wiicket). Seeing that it'll take days to convert the application to a different framework (including AppFuse, I think, which is the app I'm building on top of), I'd rather not.
    The other alternative is copy / pasting a load, which will work (I know it'll work), but making a change will result in making half a dozen changes, one for each copy / paste job. I'd prefer a solution like this.
    Help me plox :(.

    On second thought, nevermind. Re-asked my colleague, and he pointed out the use of tag files
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags5.html
    Which works excellently, imho.

Maybe you are looking for

  • Moved my mac over to a new HD and my Windows Partition no longer boots.

    Hello people smarter than me.  I seek knowledge and skills I do not posses.  I replaced my SSD with a bigger one going from 240gb to 960gb.  The old one had two bootcamp OS partitions (Mac, Windows) and four partitions (EFI System Partition, Recovery

  • TS3694 iPhone 3GS iTunes recovery logo loop

    Hi, I'm trying to restore a preowned iPhone 3GS using iTunes, but when it finishing restoring it ask for restore again. Also I can't turn on or off (the bar doesn't appear, tried holding power, holding power+home 10 seconds, etc.) or enter in DFU mod

  • Desktop Icons Change Positions After Restart

    Hi, After I inadvertently synced my computer with another Mac computer my icons change position after restart. I was trying to sync another computer to mine. I have tried the usual suggestions of taking out com.apple.finder.plist and com.apple.deskto

  • BPC 7.5NW: Drill through to ECC

    Hi Experts, I am following the steps as given in the Drill through White Paper, but am having issues in passing the parameter to ECC's t-code. The web link etc is working fine, but when I "Test" it in Admin, the t-code in ECC is not accepting any val

  • Getting Data from Structure and Store Data into Table using Function Module

    Hello... we are created a function module to import 2 structures in the systems and want to read the data from the structure into a customized table when the fucntion module is called. However, whenever the function module is run, we only managed to