1 Reply Latest reply on May 22, 2009 12:33 PM by benziman kirism

    Can not import other pages to main page.

    benziman kirism Newbie

      Hi all

      i am writing the main page of my project to set layout for import the other pages into the main page .

      but i have the problem when importing two pages into main page , when i run the program i just see only one page of two pages to
      import to be display on web browser

      the follow of action will be display:

      main page: default.jsp

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      JSP Page






      <jsp:include page="/pages/header.html" flush="true"/>




      <jsp:include page="/pages/Menu.jsp" flush="true"/>




      <jsp:include page="/pages/MenuLeft.jsp " flush="true"/>

















      the Menu.jsp page write here:

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

      .pic {
      margin-bottom: -4px;
      margin-right: 2px;
      }
      .barsearch {
      height:14px;
      width:160px;

      }
      .barsearchbutton {
      border-width:1px;
      background-color:transparent;

      }


      Menu frame






      <f:view>
      <h:form>

      <rich:toolBar>

      <rich:dropDownMenu submitMode="none">
      <f:facet name="label">
      <h:panelGroup>
      <h:outputLink value="http://goldtrading123.com/?homepage">
      <h:outputText value="Home Page"/>
      </h:outputLink>

      </h:panelGroup>
      </f:facet>


      </rich:dropDownMenu>

      <rich:dropDownMenu>

      <f:facet name="label">
      <h:panelGroup>
      <h:outputText value="About Us" />
      </h:panelGroup>

      </f:facet>

      <rich:menuItem submitMode="none"
      onclick="document.location.href='http://goldtrading123.com/'">
      <h:outputLink value="http://goldtrading123.com/">
      <h:outputText value="RichFaces Home Page"></h:outputText>
      </h:outputLink>
      </rich:menuItem>

      <rich:menuItem submitMode="none"
      onclick="document.location.href='http://jboss.com/index.html?module=bb&op=viewforum&f=261'">
      <h:outputLink
      value="http://jboss.com/index.html?module=bb&op=viewforum&f=261">
      <h:outputText value="GoldTrade Forum"></h:outputText>
      </h:outputLink>
      </rich:menuItem>


      </rich:dropDownMenu>

      <rich:toolBarGroup location="right">
      <h:inputText styleClass="barsearch" />
      <h:commandButton styleClass="barsearchbutton" onclick="return false;" value="Search" />
      </rich:toolBarGroup>
      </rich:toolBar>
      </h:form>
      </f:view>







      the MenuLeft.jsp is written by the follow given here :

      <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
      <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>



      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

      .cols{
      vertical-align:top;
      width:50%;
      }

      JSP Page


      <f:view>


      <h:form id="form">
      <h:panelGrid columns="2" columnClasses="cols" width="100%">
      <rich:panelMenu style="width:200px" mode="ajax"
      iconExpandedGroup="disc" iconCollapsedGroup="disc"
      iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
      iconCollapsedTopGroup="chevronDown">
      <rich:panelMenuGroup label="Tradebase Home page">
      <rich:panelMenuItem label="Item 1.1" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 1.1"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="All Positions" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 1.2"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 1.3" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 1.3"/>
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      <rich:panelMenuGroup label="Positions by Account">
      <rich:panelMenuItem label="Item 2.1" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.1"/>
      </rich:panelMenuItem>

      <rich:panelMenuItem label="Item 2.2" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.2"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 2.3" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.3"/>
      </rich:panelMenuItem>
      <rich:panelMenuGroup label="Group 2.4">
      <rich:panelMenuItem label="Item 2.4.1" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.4.1"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 2.4.2" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.4.2"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 2.4.3" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.4.3"/>
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      <rich:panelMenuItem label="Item 2.5" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 2.5"/>
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      <rich:panelMenuGroup label="Show Trade">
      <rich:panelMenuItem label="Item 3.1" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 3.1"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 3.2" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 3.2"/>
      </rich:panelMenuItem>
      <rich:panelMenuItem label="Item 3.3" action="#{panelMenu.updateCurrent}">
      <f:param name="current" value="Item 3.3"/>
      </rich:panelMenuItem>
      </rich:panelMenuGroup>
      </rich:panelMenu>

      </h:panelGrid>

      </h:form>
      </f:view>



      when i run the main page , i only receive the content on the MenuLeft.jsp page display on the main page, so the content of Menu.jsp is disappear even through i set up the path to each files are correctly.

      I did know why it occurs like that.

      i need someone to help me to give advice for my problem.

      if i have trouble with insert other pages into main pages, if you have a good solution , please help me , and share me.

      thank regards.

        • 1. Re: Can not import other pages to main page.
          benziman kirism Newbie

          here is main page :

          <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
          <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
          <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
          <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
          <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          JSP Page






          <jsp:include page="/pages/header.html" flush="true"/>




          <jsp:include page="/pages/Menu.jsp" flush="true"/>




          <c:import url="/pages/hien.jsp" />
















          and MenuLeft.jsp page:

          --%>
          <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
          <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
          <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
          <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
          <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>



          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

          .cols{
          vertical-align:top;
          width:50%;
          }

          JSP Page


          <f:view>


          <h:form id="form">
          <h:panelGrid columns="2" columnClasses="cols" width="100%">
          <rich:panelMenu style="width:200px" mode="ajax"
          iconExpandedGroup="disc" iconCollapsedGroup="disc"
          iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
          iconCollapsedTopGroup="chevronDown">
          <rich:panelMenuGroup label="Tradebase Home page">
          <rich:panelMenuItem label="Item 1.1" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 1.1"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="All Positions" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 1.2"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 1.3" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 1.3"/>
          </rich:panelMenuItem>
          </rich:panelMenuGroup>
          <rich:panelMenuGroup label="Positions by Account">
          <rich:panelMenuItem label="Item 2.1" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.1"/>
          </rich:panelMenuItem>

          <rich:panelMenuItem label="Item 2.2" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.2"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 2.3" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.3"/>
          </rich:panelMenuItem>
          <rich:panelMenuGroup label="Group 2.4">
          <rich:panelMenuItem label="Item 2.4.1" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.4.1"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 2.4.2" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.4.2"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 2.4.3" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.4.3"/>
          </rich:panelMenuItem>
          </rich:panelMenuGroup>
          <rich:panelMenuItem label="Item 2.5" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 2.5"/>
          </rich:panelMenuItem>
          </rich:panelMenuGroup>
          <rich:panelMenuGroup label="Show Trade">
          <rich:panelMenuItem label="Item 3.1" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 3.1"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 3.2" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 3.2"/>
          </rich:panelMenuItem>
          <rich:panelMenuItem label="Item 3.3" action="#{panelMenu.updateCurrent}">
          <f:param name="current" value="Item 3.3"/>
          </rich:panelMenuItem>
          </rich:panelMenuGroup>
          </rich:panelMenu>

          </h:panelGrid>

          </h:form>
          </f:view>



          and the Menu.jsp page:

          <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
          <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
          <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
          <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
          <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

          .pic {
          margin-bottom: -4px;
          margin-right: 2px;
          }
          .barsearch {
          height:14px;
          width:160px;

          }
          .barsearchbutton {
          border-width:1px;
          background-color:transparent;

          }


          Menu frame






          <f:view>
          <h:form>

          <rich:toolBar>

          <rich:dropDownMenu submitMode="none">
          <f:facet name="label">
          <h:panelGroup>
          <h:outputLink value="http://goldtrading123.com/?homepage">
          <h:outputText value="Home Page"/>
          </h:outputLink>

          </h:panelGroup>
          </f:facet>


          </rich:dropDownMenu>

          <rich:dropDownMenu>

          <f:facet name="label">
          <h:panelGroup>
          <h:outputText value="About Us" />
          </h:panelGroup>

          </f:facet>

          <rich:menuItem submitMode="none"
          onclick="document.location.href='http://goldtrading123.com/'">
          <h:outputLink value="http://goldtrading123.com/">
          <h:outputText value="RichFaces Home Page"></h:outputText>
          </h:outputLink>
          </rich:menuItem>

          <rich:menuItem submitMode="none"
          onclick="document.location.href='http://jboss.com/index.html?module=bb&op=viewforum&f=261'">
          <h:outputLink
          value="http://jboss.com/index.html?module=bb&op=viewforum&f=261">
          <h:outputText value="GoldTrade Forum"></h:outputText>
          </h:outputLink>
          </rich:menuItem>


          </rich:dropDownMenu>

          <rich:toolBarGroup location="right">
          <h:inputText styleClass="barsearch" />
          <h:commandButton styleClass="barsearchbutton" onclick="return false;" value="Search" />
          </rich:toolBarGroup>
          </rich:toolBar>
          </h:form>
          </f:view>







          When the program is run .it only show the MenuLeft.jsp page .

          i don't know why ?

          please help me.