2 Replies Latest reply on May 18, 2010 1:17 AM by pankaj jain

    problem with navigation

    pankaj jain Newbie



      i have developed a jsp as following its name is menu.jsp


      <rich:dropDownMenu  submitMode="server">
                          <f:facet  name="label">
                                   <h:outputText value="Inventory Control" />
                           <rich:menuGroup value="Inventory Maintainces"  >
                               <rich:menuItem submitMode="Server" value="Finished Item"
                                   action="finisheditem" />
                               <rich:menuItem submitMode="Server" value="Labor code and charges "
                                   action="labor_code_charges" >
                              <rich:menuItem  submitMode="server" value="Metal code and prices"
                              <rich:menuItem  submitMode="server" value="Diamond codes and prices"



      my home  page is above one. and it shows the menu correctly .




      Now when user select "finisheditem"  for navigation its mapping is written in faces-config.xml as follows



      <?xml  version="1.0" encoding="UTF-8"?>


      <!DOCTYPE  faces-config PUBLIC
          "-//Sun Microsystems, Inc.//DTD JavaServer  Faces Config 1.1//EN"


                   <to-view-id>/jsp/inventory/metal_codes_prices/metal_ code  _prices.jsp</to-view-id>
                   <to-view-id>/jsp/inventory/labor_ code _charges/labor_ code  _charges.jsp</to-view-id>
                   <to-view-id>/jsp/inventory/diamond_codes_prices/diamond_ code  _prices.jsp</to-view-id>




      menu.jsp  is a file which must present in each jsp as it contain menu. and i have  include it in following way say finisheitem.jsp


      but i  am getting the following error





      javax.servlet.ServletException:  javax.servlet.jsp.JspException: Exception attemtping to write content  above the <f:view> tag.


      plz tell me what is the exact problem is ...

        • 1. Re: problem with navigation
          praveen jain Novice

          as you are inlcuding the menu.jsp to each page, check out the f:view tag it must not be nested.

          it should solve your problem , otherwise u need to send code of your page in which you are including your menu.jsp

          • 2. Re: problem with navigation
            pankaj jain Newbie

            following is my jsp file in which i included menu.jsp



                <%@ page language="java" contentType="text/html; charset=ISO-8859-1"


            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">






            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

            <!-- RichFaces tag library declaration -->

            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>




            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


            <style type="text/css">

            .right {

                position: absolute;

                right: 25px;

                width: 270px;

                top: 280px;

                background-color: #b0e0e6;



            .right_itemtable {

                position: absolute;

                right: 40px;

                top: 790px;

                background-color: #b0e0e6;







                <jsp:include page="/jsp/common/menu.jsp" />  //as per your instruction i put it above <f:view>

                                                                                    // but let me tell you how it is working now , described below  










                        <!-- Functional Buttons -->




                        <!-- Common information  -->




                            <h:panelGrid columns="4">


                                <h:panelGrid columns="2">


                                    <h:outputText value="Item No:" />


                                    <h:outputText value="PCL649/W" />


                                    <h:outputText value="  Description:" />


                                    <h:inputText value="2.00CT-DIA INVISIBLE RING" id="description"  style="width:180px"/>




                                <h:panelGrid columns="2">

                                    <h:outputText value="Item Type:" />

                                    <rich:comboBox defaultLabel="CAT09-CATALOG2009">

                                        <f:selectItem itemValue="CAT09-CATALOG2009" />

                                        <f:selectItem itemValue="BRIDO8PO4-Bridal Flyer 2009" />



                                    <h:outputText value="Item Class:        " />

                                    <rich:comboBox defaultLabel="Bangle-Ladies Bangle">

                                        <f:selectItem itemValue="Bangle-Ladies Bangle" />

                                        <f:selectItem itemValue="DIA-Loose Diamond" />




                                <h:panelGrid columns="2">

                                    <h:outputText value="Product Line:      " />


                                        defaultLabel="3SPPC-3 Stone Princess Pendant 1.00ct">

                                        <f:selectItem itemValue="3SPPC-3 Stone Princess Pendant 1.00ct" />

                                        <f:selectItem itemValue="3SPPH-3 Stone Princess 9Pendant 0.50ct" />


                                    <h:outputText value="Price group:      " />

                                    <rich:comboBox defaultLabel="Val091P">

                                        <f:selectItem itemValue="Val0901P" />



                                <h:panelGrid columns="2">

                                <h:outputText value="Diamond Type:      " />

                                    <rich:comboBox defaultLabel="BlackPR">

                                        <f:selectItem itemValue="BlackPR" />

                                        <f:selectItem itemValue="BlackRD" />


                                <h:outputText value="Warehouse:" />

                                    <rich:comboBox defaultLabel="Main">

                                        <f:selectItem itemValue="Main" />

                                        <f:selectItem itemValue="W-REP" />

                                        <f:selectItem itemValue="Remote" />

                                        <f:selectItem itemValue="Metal" />

















                <jsp:include page="/jsp/common/footer.jsp" />











            first is displayed menu.jsp as a home page. when i click on finished item , it goes to finisheditem.jsp but it shows the content of footer.jsp(dynamically included in above code) only . It skips the content of menu.jsp and content of finisheditem.jsp as well.