Conditionally inserting tiles

Hello All,
I am using tiles with JSF. In my jsf page, i have the below logic but still the tiles get inserted...
<% if(false){ %>
<tiles:insert definition="NonMember" flush="false"/>
<% } %>
I am not sure whats happening.. does anyone know whats happening here...
Basically,i want to check a condition and if the condition is false, i dont want to insert the tiles..

Make sure nonMember definition is accessible via the jsp page:
<f:verbatim>
<%
String nonMember = ...
if(false)
%>
<tiles:insert name="<%=nonMember%>" flush="false" />
<%
%>
</f:verbatim>
Hope this may help.
BaTien
DBGROUPS

Similar Messages

  • MERGE w/ conditional Insert clause

    Hi--
    Sum Up:Is it possible to run Merge syntax with update and a conditional Insert clauses ?
    Question Details
    Have a base table Emp and staging table New_Emp with a common identifier Emp_id.
    The ideal would be to merge the 2 tables and update Emp using New_Emp values and
    insert only some new emp, not all records.
    Any ideas ? Thks
    Lamine

    Absolutely. See the docs. Use the WHEN and WHERE clauses.
    Tom Best

  • Implementing Conditional Insert

    I use tips in the article "Implementing Conditional Insert, Update, and Delete Allows for View Objects" from "Steve Muench's Radio Weblog".
    At the start all it's ok, but I found this problem:
    1. I have two views (V1 and V2) over the same entity (E1)
    2. V1 permit insert, delete, update, and select.
    3. V2 overwrite method create and don't allow insert.
    4. If you use V1 and try to insert a record all go ok.
    5. If you use V2 and try to insert a record get an exception "It's not allow insert into V2", It's Ok.
    6. If you use V1 again and try to insert a record you get an exception, that say "It's not allow insert into V2".
    I'm investigate the case, and found that when you insert a record in E1 throw V1, the framework (BC4) try to create the record in the views that are instantiated over the entity E1, for this call method "create" on views.
    Do you know some workaround ?
    thank in advice...

    Hi, again, I have question about this...
    I post it in the forum...
    If I use "isAssociationConsistent()" I have to know all views that depend of same entity, and its privileges. I have problem with that because if I add a view a have to remember to put this in the code.
    I need to confirm: is return of method "this.getEntity(0).isInCache()" true when record was inserting in other entity ?
    May I modify your sample like this:
    public class CustomViewRowImpl extends ViewRowImpl {
    protected void create(AttributeList nvp) {
    if ( this.getEntity(0).isInCache() || getVO().isInsertAllowed()) {
    super.create(nvp);
    else {
    throw new JboException("Insert not allowed in this view");
    thank a lot

  • Conditional Insert within Merge???

    can we use conditional insert within the merge statement????
    thanks a lot..
    nantha

    NanthaKumarAR wrote:
    is there is any possible way to do so????
    thanks a alot ....
    nanthaHmmm let's look at the conversation so far...
    You: "is this possible?????"
    Me: "No."
    You: "is there is any possible way to do so????"
    I'm now wondering which part of "No" you failed to understand.
    You cannot perform multiple/conditional inserts within a MERGE statement. The purpose of a MERGE statement is to take data and MERGE it into a single table.
    The only messy way I can think of would be to merge into an intermediate table with triggers on it, that takes the merged data and splits it out into the seperate tables. Messy and not likely the best solution to the initial problem, which would probably be better solved by avoiding the use of MERGE in the first place (though we don't know what problem you are actually trying to solve).

  • Conditional Insert

    Hi,
    Is it possible to do a conditional insert? e.g.
    IF :P2_NAME != (SELECT name from hk.appname where name = :P2_NAME) then
    INSERT....
    END IF;So if the value of :P2_NAME doesn't exist within the table then it will be inserted...its to be an addition to a currently existing APEX process (checks that field values aren't null then enters a record into a different table than hk.appname).
    Thanks for any help.
    Mike

    Dird wrote:
    PLS-00405: subquery not allowed in this context As I said:
    IF :P6_NEW_PROJ IS NOT NULL THEN
    proj := lower(:P6_NEW_PROJ);
    ELSE
    proj := :P6_PROJECT;
    END IF;
    insert into hkadm.applic@XXX (appl_name) select proj from dual
    where 0 = (select count(*) from hkadm.applic@XXX where appl_name = proj and rownum = 1);SY.

  • Conditional insert in plsql

    Hi friends,
    I am a beginner in Oracle PLSQL. I need to insert a row into a table based on a condition. The condition is to check if the value is already there in another table.
    i.e, If the username is already present in the users table then the username should not be added to username table. I have written a stored procedure to insert into the username table but need i do not know how to check for the condition.
    Could you please let me know how to get this. I tried a lot but getting compilation errors.
    Regards,
    Padeep

    Use Control Statements
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/controlstatements.htm
    Such as: IF-THEN-ELSE or CASE
    That documentation is for 11.2. Your Oracle version may be different, but since IF statements have been around for a long time, this will do.
    Alternatively, consider a unique index on the field.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/indexes003.htm#ADMIN11724
    Or even consider using a MERGE statement:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9016.htm#SQLRF01606

  • Conditional Insertion in table based on Field

    Hi all,
      I am having 3 text input fields in my page, Empno, Ename, Sal
      After inserting data in the fields, commission column has to be populate automatically, based on conditions.
      Conditions are : If the salary is less than 5000 the commission 500 has to be insert, salary is greater than 5000 commission 1000 has to be inserted.
    how can I achieve this, and where I have to implement the logic, please help me out.
    Thanks in Advance
    Jagadish

    Hi,
    You can apply PPR on salary field. Then catch the event and based on condition, set the value of commission field.
    Also, you can check this link for PPR:
    http://sushantsharmaa.blogspot.in/2012/12/11-ppr-partial-page-rendering-in-oaf.html
    --Sushant

  • Conditional Insert into staging table by using sqlloader

    Hi,
    In Oracle apps I'm submitting a concurrent program programmatically which will call sqlloader and insert into a staging a table.
    This table consists of 30 columns.Program has one input parameter.If parameter value = REQUIRED Then it should insert into first three columns of staging table.If it's APPROVED then it should insert into first 10 columns of the same table.
    Data file is pipe delimited file which may or may not have all possible values :For Required,I many not have all three column values

    >
    I think you understood the thinks wrongly. OP marked UTL_FILE as the correct answer, which is again a server side solution.
    >
    Perhaps you failed to notice that the answer now marked correct was posted AFTER mine. I'm not clairvoyant and OP did not state whether a server side or client side solution was appropriate.
    I stand by my comments. Using an external table is an alternative to sql loader but, as I said, simply using an external table instead of sql loader doesn't address OPs problem.
    >
    And IMO, external table will be faster than UTL_FILE
    >
    I'd be more concerned with why OP wants to write a procedure to parse flat files, deal with data conversion errors and perform table inserts when Oracle already provides that functionality using either external tables or sql loader.
    I would suggest loading the file into a new staging table that can hold all of the columns that might be contained in the flat file. Then the appropriate data can be moved to OPs staging table according to the required business rules.
    Sounds like we each think OP should reconsider the architecture.

  • Conditional insertion into a table

    Hello:
    I've a base table into which records are inserted from results returned by a query. The query always runs on the current date every hour. There are some preconditions before insertion:
    1) The backdated records will remain as it is;
    2) If query finds a new Number it will be inserted in the table;
    3) If query finds a same number but Count is more, it will also inserted in the table.
    TABLE1-
    Number|PDATE|CATEGORY|MARKED|COUNT
    1|29-APR-2012|C1|Y|2
    3|30-APR-2012|C1|Y|1
    4|30-APR-2012|C1|Y|1
    5|30-APR-2012|C1|Y|3
    Query Result-
    Number|TDATE|COUNT
    1|30-APR-2012|1
    2|30-APR-2012|5
    3|30-APR-2012|1
    4|30-APR-2012|9
    5|30-APR-2012|3
    Output: (Updated Table-1)
    Number|PDATE|CATEGORY|MARKED|COUNT
    1|29-APR-2012|C1|Y|2
    1|30-APR-2012|C1|N|1
    2|30-APR-2012|C1|N|5
    3|30-APR-2012|C1|Y|1
    4|30-APR-2012|C1|Y|1
    4|30-APR-2012|C1|N|9
    5|30-APR-2012|C1|Y|3
    Explain Output: The query is running on 30-Apr-2012
    1|29-APR-2012|C1|Y|2: This is a backdated record. So, remained unchanged.
    1|30-APR-2012|C1|N|1: 1 of today was not in the table. So, it is inserted with Status 'N'
    2|30-APR-2012|C1|N|5: 2 of today was not in the table. So, it is inserted with Status 'N'
    3|30-APR-2012|C1|Y|1: 3 is already in the table. So, unchanged.
    4|30-APR-2012|C1|N|9: 4 will be inserted cause count (9) is more than previous (1). So, it is inserted with Status 'N'
    5|30-APR-2012|C1|Y|3: 5 is already in the table. So, unchanged.
    Can anyone help me with query?
    Thanks/Razin

    Hope below helps you
    CREATE TABLE T
    (  NUM      NUMBER,
       PDATE    DATE,
       CATEGORY VARCHAR2(2),
       MARKED   VARCHAR2(1),
       COUNT    NUMBER
    INSERT INTO T VALUES (1,'29-APR-2012','C1','Y',2);
    INSERT INTO T VALUES (3,'30-APR-2012','C1','Y',1);
    INSERT INTO T VALUES (4,'30-APR-2012','C1','Y',1);
    INSERT INTO T VALUES (5,'30-APR-2012','C1','Y',3);
    INSERT INTO T(NUM, PDATE, CATEGORY, MARKED, COUNT )
    WITH QUERY_RESULT AS
    ( SELECT 1 NUM , TO_DATE('30-APR-2012','DD-MON-YYYY') PDATE,1 CNT FROM DUAL UNION ALL
      SELECT 2     , TO_DATE('30-APR-2012','DD-MON-YYYY'),5 FROM DUAL UNION ALL
      SELECT 3     , TO_DATE('30-APR-2012','DD-MON-YYYY'),1 FROM DUAL UNION ALL
      SELECT 4     , TO_DATE('30-APR-2012','DD-MON-YYYY'),9 FROM DUAL UNION ALL
      SELECT 5     , TO_DATE('30-APR-2012','DD-MON-YYYY'),3 FROM DUAL
    SELECT R.NUM, R.PDATE, 'C1','N', R.CNT
    FROM QUERY_RESULT R
    WHERE NOT EXISTS ( SELECT NULL
                       FROM T
                       WHERE R.NUM = T.NUM AND ( R.PDATE < T.PDATE OR (R.PDATE = T.PDATE AND R.CNT <= T.COUNT ))
    SELECT * FROM T
           NUM PDATE     CATEGORY   MARKED          COUNT
             1 29-APR-12 C1         Y                   2
             1 30-APR-12 C1         N                   1
             2 30-APR-12 C1         N                   5
             3 30-APR-12 C1         Y                   1
             4 30-APR-12 C1         Y                   1
             4 30-APR-12 C1         N                   9
             5 30-APR-12 C1         Y                   3
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Implementing Conditional Insert, Update, and Delete Allows for View Objects

    Steve,
    Thanks for the info in this article it was very helpful. I have one question as I created a test case that used dept & emp tables as master and detail.
    Placing code in the emp detail ViewRowImpl that also tests to see if the master is updateable and it all works fine but I noticed that when you run it in the tester the dept master fields are grayed out but not the emp details and if you bring up the emp detail with out the view link then they are grayed out.
    Just wondering is this just a fact of the detail being shown in a table in the master detail and not a form or is there more to it then that??

    yes as follows:
    isMasterUpdateable checks the Dept table to see if it is updateable before allowing emp to be updated.
    public boolean isAttributeUpdateable(int index)
    if ( isMasterUpdateable() == true )
    return ( super.isAttributeUpdateable(index) );
    return(false);
    When I run this in the tester the results are correct except for the visual where the form is grayed out but the detail in the table is not. Should the table gray out also or is this effect something that must be coded in all Jtables that i may implement? If it needs to be coded to get the effect where does Jtable check for isAttributeUpdateable ?
    thanks,

  • How to insert some records in one table and some records in another table

    Interview question
    how insert records in two tables by using trigger
    CREATE or REPLACE TRIGGER Emp_Ins_Upd_Del_Trig
    BEFORE delete or insert or update on EMP
    FOR EACH ROW
    BEGIN
    if UPDATING then
    UPDATE emp2
    SET
    empno = :new.empno,
    ename = :new.ename
    --, job = :new.job
    --, mgr = :new.mgr
    --, hiredate = :new.hiredate
    , sal = :new.sal
    --, comm = :new.comm
    --, deptno = :new.deptno;
    sdate = :new.sdate,
    edate = :new.edate
    end if;
    if INSERTING then
    INSERT INTO emp2
    VALUES
    ( :new.empno
    , :new.ename
    --, :new.job
    --, :new.mgr
    --, :new.hiredate
    , :new.sal
    --, :new.comm
    --, :new.deptno
    new.sdate,
    new.edate);
    end if;
    if DELETING then
    DELETE FROM emp2
    WHERE empno = emp2.empno;
    end if;
    END;
    it is working fine but he wants to insert some specific litimit on one table and some specified limit of records in one ..
    In this senerio can i insert records by use count of records...
    please help me..

    Can you be more specific on the "Limit"
    Conditional insert can be used in this case.

  • Change the colour of the tile dynamically:

    Hi,
    I have 12 tiles in my application. Depending upon some condition, few tiles colour should be changed and also to the same tiles image should be added. (I'm creating tiles using Border)
    Can anybody suggest how can I achieve this?
    Thanks,
    Santosh

    Please close your previous threads before you start a new one.
    Also, you have asked this very same question before here:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b3752b09-2ee2-46ac-a941-dc7baad78110/change-the-colour-of-the-rectangle-dynamically?forum=wpf#b3752b09-2ee2-46ac-a941-dc7baad78110.
    Please don't ask the same question twice.
    You could use DataTriggers and/or converters to change the property of some UI element based on some condition as already suggested in the previous thread.
    Of course you must post your code, or even better upload a reproducable sample of your issue to OneDrive and post the link to it here, for anyone to be able to provide a specific solution.
    But note that the forums are not for anyone else to do the entire work for you. You were given code samples of how to use data triggers and converters in the previous thread. That should certainly give you the idea.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • Use of insert in case

    Hi,
    Is it possible to use insert statement in CASE.
    For example as follows:
    let create a table as
    create table DECOMPENSATED_BALANCE_TMP (ENDING_ENTERED_BALANCE_DR number, ENDING_ENTERED_BALANCE_CR number);
    select
    CASE
    WHEN (PERIOD_NET_DR+BEGIN_BALANCE_DR-PERIOD_NET_CR-BEGIN_BALANCE_CR) total > 0
    THEN
    INSERT INTO XXGL_DECOMPENSATED_BALANCE_TMP (ENDING_ENTERED_BALANCE_DR) values (total)
    WHEN (PERIOD_NET_DR+BEGIN_BALANCE_DR-PERIOD_NET_CR-BEGIN_BALANCE_CR) <= 0
    THEN
    INSERT INTO XXGL_DECOMPENSATED_BALANCE_TMP (ENDING_ENTERED_BALANCE_CR) values (total)
    else
    NULL
    end
    from gl_balances
    where code_combination_id=109940 and currency_code='GBP';
    Any answers will be highly appreciated ....
    Thanks,
    zaheer

    I don't think that a conditional insert is really needed in this case. THe only part where the insert differse is the else part of your case statment where no insert should be done. THis can be made into a where clause.
    An easy way would be to use a simple INSERT + SELECT statement. Where the value for the dr and cr columns are created by a case or a decode statement.
    untested example
    insert into XXGL_DECOMPENSATED_BALANCE_TMP
      (ENDING_ENTERED_BALANCE_DR, ENDING_ENTERED_BALANCE_CR)
    select case WHEN (PERIOD_NET_DR+BEGIN_BALANCE_DR-PERIOD_NET_CR-BEGIN_BALANCE_CR) > 0  then total
              else null
              end as DR
             ,case WHEN (PERIOD_NET_DR+BEGIN_BALANCE_DR-PERIOD_NET_CR-BEGIN_BALANCE_CR) <= 0  then total
              else null
              end as CR
    from gl_balances
    where code_combination_id=109940
    and currency_code='GBP'
    and (PERIOD_NET_DR+BEGIN_BALANCE_DR-PERIOD_NET_CR-BEGIN_BALANCE_CR) is not null -- else part
    ;The good thing is you could run this insert statement for several code_combination_ids directly in SQL without any pL-loop.
    Just noticed that leonard aready posted almost the same solution.
    Edited by: Sven W. on Aug 24, 2011 3:22 PM

  • JSP : Tiles Error �tag.getAsString� : component context is not defined

    JSP : Tiles Error �tag.getAsString� : component context is not defined
    I�m working with Struts 1.1 and Tiles, under Tomcat 5.0.16
    My application works fine using Struts 1.1 alone, however, when attempting to run the application in a �Tiles� environment, I get an error:

    javax.servlet.jsp.JspException: Error - tag.getAsString : component context is not defined. Check tag syntax

    I have �defined� this in my �tiles-defs.xml� file, and as far as I can tell, everything else is configured properly (I have looked over the included Struts document examples, and others on the web, and I seem to have everything configured identically).
    What am I missing???
    I have created a series of �mostly� empty JSP files, for simplicity sake.
    JSP FILES:
    -     header.jsp
    -     footer.jsp
    -     menu.jsp
    -     rootLayout.jsp
    -     user.jsp
    -     show_user.jsp
    -     error.jsp
    -     defaultContentPage.jsp
    All JSP files contain:
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    and

    <title>
    <tiles:getAsString name="title"/>
    </title>

    My �tiles-defs.xml�: =================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <!-- ================ RootLayout ======================= -->
    <definition name=".root.layout" path="/jsp/rootLayout.jsp" >
    <put name="title" value="Default title"/>
    <put name="header" value="/jsp/header.jsp"/>
    <put name="menu" value="/jsp/menu.jsp"/>
    <put name="content" value="/jsp/defaultContentPage.jsp"/>
    <put name="footer" value="/jsp/footer.jsp"/>
    </definition>
    <!-- ================ Extentions ======================= -->
    <!-- User -->
    <definition name=".view.user" extends=".root.layout">
    <put name="title" value="Welcome to the User Form."/>
    <put name="content" value="/jsp/user.jsp"/>
    </definition >
    <!-- Save -->
    <definition name=".view.save" extends=".root.layout">
    <put name="title" value="Welcome to the Show User Form."/>
    <put name="content" value="/jsp/show_user.jsp"/>
    </definition >
    <!-- Error -->
    <definition name=".view.error" extends=".root.layout">
    <put name="title" value="Error Message."/>
    <put name="content" value="/jsp/error.jsp"/>
    </definition >
    </tiles-definitions>
    My �struts-config.xml�: ==============================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- ========== FormBeans =================================== -->
    <form-beans>
    <form-bean name="userForm" type="biz.seamrog.strutstest.model.state.UserForm"/>
    </form-beans>
    <!-- ========== Action Mapping Definitions=================== -->
    <action-mappings>
    <!-- Action using normal forward syntax...
    <action path="/user"
    forward="/jsp/user.jsp">
    </action>
    -->
    <!-- Action using a "Tiles" forward syntax...
    The "forward" path mappings are defined in a file named
    "../WEB-INF/tiles-defs.xml
    -->
    <action path="/user"
    forward=".view.user">
    </action>
    <!-- Action using normal forward syntax...
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path="/jsp/show_user.jsp"/>
    <forward name="failure" path="/jsp/error.jsp"/>
    </action>
    -->
    <!-- Tiles syntax -->
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path=".view.show_user"/>
    <forward name="failure" path=".view.error"/>
    </action>
    </action-mappings>
    <!-- ============== Global Forwards ======================== -->
    <global-forwards>
    <!-- NOTE: paths with "." syntax are Tiles defined paths,
    all other paths follow conventional "/path/to/file.jsp syntax
    -->
    <forward name="user" path=".view.user"/>
    <forward name="show_user" path=".view.show_user"/>
    <forward name="error" path=".view.error"/>
    <forward name="cssBase" path="/stylesheets/common.css"/>
    </global-forwards>
    <!-- ============= Plug-ins =============== -->
    <!-- Tiles Plug-in -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
    <set-property property="definitions-parser-validate" value="true" />
    <set-property property="moduleAware" value="true" />
    </plug-in>
    </struts-config>
    My �web.xml�: =====================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
    <servlet>
    <!--
    MyController extends org.apache.struts.action.ActionServlet
    NOTE: The servlet could also be specified specifying the
    default Struts ActonServlet...
    <servlet-name>controller</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    ...I have chosen to extend here just for practice sake.
    -->
    <!--
    <servlet-name>MyController</servlet-name>
    <servlet-class>biz.seamrog.strutstest.controller.MyController</servlet-class>
    -->
    <servlet-name>MyController</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <!--
    Point to Struts configuration file(s)
    -->
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <!-- Tiles config -->
    <init-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <!-- This is the added Application parameter: -->
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResource</param-value>
    </init-param>
    <!-- end -->
    <load-on-startup>5</load-on-startup>
    </servlet>
    <!--
    All incoming requests that end in .do, send to MyController.
    -->
    <servlet-mapping>
    <servlet-name>MyController</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!--
    Send initial requests to the login page for this application
    -->
    <welcome-file-list>
    <welcome-file>/jsp/user.jsp</welcome-file>
    </welcome-file-list>
    <!--
    Make all of the necessary related Struts JSP custom tag libraries
    available and define where to find them.
    -->
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-tiles.tld</taglib-location>
    </taglib>
    </web-app>
    My �rootLayout.jsp�: ================================================
    <%@page contentType="text/html"%>
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    <html>
    <header>
    <title>
    <tiles:getAsString name="title" />
    </title>
    <body>
    <tiles:get name="header"/>
    <tiles:get name="menu"/> <tiles:get name="content"/>
    <tiles:get name="footer"/>
    </body>
    </html>

    I found an entry in the Mail Archive for Struts. I got it working. My working code is below. You need to in the base JSP import the header and put the 'title' out to it.
    tiles:def file:
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <definition name=".petstore.Base" path="/common/petstorecommon.jsp">
    <put name="title" value ="${title}"/>
    <put name="header" value="/common/header.jsp"/>
    <put name="message" value="/common/message.jsp"/>
    <put name="content" value="${content}"/>
    <put name="navbar" value="/common/navbar.jsp"/>
    </definition>
    <definition name="petstore.Login" extends=".petstore.Base" >
    <put name="title" value="Login Page" />
    <put name="content" value="/Logon.jsp"/>
    <put name="test1" value="test1value"/>
    </definition>
    base tile def:
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html:html>
    <head>
    <html:base/>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>pet store common (jsp)</title>
    </head>
    <body>
    <tiles:insert attribute="header">
    <%-- both of these attributes are accessible from header.jsp It works!!! --%>
    <tiles:put name="title" beanName="title" beanScope="tile" />
    <tiles:put name="test1" beanName="test1" beanScope="tile" />
    </tiles:insert>
    <%-- <tiles:get name="header" /> --%>
    <tiles:get name="message" />
    <tiles:get name="content" />
    <tiles:get name="navbar" />
    </body>
    </html:html>
    Getting access to the title value in the header.jsp file:
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <html>
    <head>
    <tiles:getAsString name="title" />
    <tiles:getAsString name="test1" />
    </head>
    <body>
    </body>
    </html>

  • Tiles:put with beanName and JSF object doesn't work

    I got some recent (good) advice for using tiles:put and in the inserted tile getting access to the string in a JSF tag, as long as it is a static string. For example, if I do this in the page including the tile:
    <tiles:insert page="includedPage.jsp">
    <tiles:put name="somevar" value="something" />
    </tiles:insert>
    Then in includedPage.jsp:
    <tiles:importAttribute name="somevar" scope="request"/>
    <h:outputText value="#{requestScope.somevar}"
    That works fine. But now I'm trying to use this:
    <tiles:insert page="includedPage.jsp">
    <tiles:put name="somevar" beanName="varFromDataTable" />
    </tiles:insert>
    I can't get it in the includedPage.jsp - I think because the tiles tag can't find the JSF variable (created using the var= attribute of dataTable).
    Does anyone know how I would do this? I need the whole object, not just a string from the object, since the includedPage.jsp will be using many attributes from the bean.

    Hi Greg,
    What kind of error/issue you are facing.
    Thanks,
    Rohit

Maybe you are looking for