Help generate dynamic table in xslt for apache FOP

down vote favorite
For the following xml file, i need to generate an xsl-fo file to be converted into pdf.
I am new to style sheets and struggling to create dynamic table. Please help.
Also, the width for each column varies,based on the column.How would i include this into the code?
The Column Headers and Column Values are dynamically populated in the xml file. Below is a sample.
Can anybody please help in generating xsl-fo or xslt code?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ReportData>
<ColumnHeaders>
<ColumnHeader>
<Name>Col-Header1</Name>
<Width>5</Length>
</ColumnHeader>
<ColumnHeader>
<Name>Col-Header2</Name>
<Width>10</Length>
</ColumnHeader>
<ColumnHeader>
<Name>Col-Header3</Name>
<Width>8</Length>
</ColumnHeader>
</ColumnHeaders>
<Rows>
<Row>
<Column>Row1-Col1</Column>
<Column>Row1-Col2</Column>
<Column>Row1-Col3</Column>
</Row>
<Row>
<Column>Row2-Col1</Column>
<Column>Row2-Col2</Column>
<Column>Row2-Col3</Column>
</Row>
</Rows>
</ReportData>

I did some xsl-fo a few years ago for a project.
It was an invoice generator spawning multiple PDFs out of single XML document generated from the database. Pretty cool stuff but very resource-consuming.
I'm a bit rusty but here's a basic example for a single table, based on your sample data :
XSLT stylesheet :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <xsl:output indent="yes"/>
  <xsl:template match="/ReportData">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="Main" margin="8mm"
          page-width="250mm"
          page-height="100mm">
          <fo:region-body />
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="Main">
        <fo:flow flow-name="xsl-region-body">
          <fo:block>
            <fo:table table-layout="fixed" border-style="solid">
              <xsl:apply-templates select="ColumnHeaders/ColumnHeader" mode="column"/>
              <xsl:apply-templates select="ColumnHeaders"/>
              <fo:table-body>
                   <xsl:apply-templates select="Rows/Row"/>
              </fo:table-body>
            </fo:table>     
          </fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
  <xsl:template match="ColumnHeaders">
    <fo:table-header>
         <fo:table-row background-color="rgb(200,200,200)">
              <xsl:apply-templates select="ColumnHeader" mode="header"/>
         </fo:table-row>
    </fo:table-header>
  </xsl:template>
  <xsl:template match="ColumnHeader" mode="column">
    <fo:table-column column-width="{concat(Width*10,'mm')}"/>
  </xsl:template>
  <xsl:template match="ColumnHeader" mode="header">
    <fo:table-cell border-style="solid">
      <fo:block font-weight="bold"><xsl:value-of select="Name"/></fo:block>
    </fo:table-cell>
  </xsl:template>
  <xsl:template match="Row">
       <fo:table-row>
      <xsl:apply-templates select="Column"/>
    </fo:table-row>
  </xsl:template>
  <xsl:template match="Column">
    <fo:table-cell border-style="solid">
      <fo:block><xsl:value-of select="."/></fo:block>
    </fo:table-cell>
  </xsl:template>
</xsl:stylesheet>
{code}
Calling the XSLT engine and FOP :
{code}
D:\XSLT>gen_pdf_otn.bat
D:\XSLT>java -jar saxon9he.jar -s:in/reportdata.xml -xsl:testfo.xsl -o:out/testfo.xml  2>errors.log
D:\XSLT>java -jar fop.jar org.apache.fop.cli.Main -fo out/testfo.xml -pdf out/testfo.pdf -c morefontsconfig.xml  2>errors.log
D:\XSLT>pause
Appuyez sur une touche pour continuer...
{code}
Ouput :
- The intermediate XSL-FO document :
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
      <fo:simple-page-master master-name="Main" margin="8mm" page-width="250mm" page-height="100mm">
         <fo:region-body/>
      </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence master-reference="Main">
      <fo:flow flow-name="xsl-region-body">
         <fo:block>
            <fo:table table-layout="fixed" border-style="solid">
               <fo:table-column column-width="50mm"/>
               <fo:table-column column-width="100mm"/>
               <fo:table-column column-width="80mm"/>
               <fo:table-header>
                  <fo:table-row background-color="rgb(200,200,200)">
                     <fo:table-cell border-style="solid">
                        <fo:block font-weight="bold">Col-Header1</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block font-weight="bold">Col-Header2</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block font-weight="bold">Col-Header3</fo:block>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-header>
               <fo:table-body>
                  <fo:table-row>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row1-Col1</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row1-Col2</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row1-Col3</fo:block>
                     </fo:table-cell>
                  </fo:table-row>
                  <fo:table-row>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row2-Col1</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row2-Col2</fo:block>
                     </fo:table-cell>
                     <fo:table-cell border-style="solid">
                        <fo:block>Row2-Col3</fo:block>
                     </fo:table-cell>
                  </fo:table-row>
               </fo:table-body>
            </fo:table>
         </fo:block>
      </fo:flow>
   </fo:page-sequence>
</fo:root>
{code}
- and the PDF document :
http://mbperso.pagesperso-orange.fr/oracle/testfo.pdf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • VLD-1119: Unable to generate Multi-table Insert statement for some or all t

    Hi All -
    I have a map in OWB 10.2.0.4 which is ending with following error: -
    VLD-1119: Unable to generate Multi-table Insert statement for some or all targets.*
    Multi-table insert statement cannot be generated for some or all of the targets due to upstream graphs of those targets are not identical on "active operators" such as "join".*
    The map is created with following logic in mind. Let me know if you need more info. Any directions are highly appreciated and many thanks for your inputs in advance: -
    I have two source tables say T1 and T2. There are full outer joined in a joiner and output of this joined is passed to an expression to evaluate values of columns based on
    business logic i.e. If T1 is available than take T1.C1 else take T2.C1 so on.
    A flag is also evaluated in the expression because these intermediate results needs to be joined to third source table say T3 with different condition.
    Based on value taken a flag is being set in the expression which is used in a splitter to get results in three intermediate tables based on flag value evaluated earlier.
    These three intermediate tables are all truncate insert and these are unioned to fill a final target table.
    Visually it is something like this: -
    T1 -- T3 -- JOINER1
    | -->Join1 (FULL OUTER) --> Expression -->SPLITTER -- JOINER2 UNION --> Target Table
    | JOINER3
    T2 --
    Please suggest.

    I verified that their is a limitation with the splitter operator which will not let you generate a multi split having more than 999 columns in all.
    I had to use two separate splitters to achieve what I was trying to do.
    So the situation is now: -
    Siource -> Split -> Split 1 -> Insert into table -> Union1---------Final tableA
    Siource -> Split -> Split 2 -> Insert into table -> Union1

  • Value of cell is not displayed while trying to generate dynamic table rows

    I am creating dynamic table with CoreTable, CoreColumn. I want to place CoreOutputText in the cells of the column. The header of the column is rendered properly, but not the cell value. Below is the code snippet,
              dynamicTable = new CoreTable();
              CoreColumn dynamicCol1 = new CoreColumn();
              dynamicCol1.setHeaderText("First");
              dynamicCol1.setParent(dynamicTable);
              dynamicTable.getChildren().add(dynamicCol1);
              CoreOutputText dynamicCell1 = new CoreOutputText();     
              dynamicCell1.setValue("Hello");
              dynamicCell1.setParent(dynamicCol1);
              dynamicCol1.getChildren().add(dynamicCell1);
    I want "Hello" to be printed on the cell (which is not happening now). Any idea why is not getting displayed?

    I am creating dynamic table with CoreTable, CoreColumn. I want to place CoreOutputText in the cells of the column. The header of the column is rendered properly, but not the cell value. Below is the code snippet,
              dynamicTable = new CoreTable();
              CoreColumn dynamicCol1 = new CoreColumn();
              dynamicCol1.setHeaderText("First");
              dynamicCol1.setParent(dynamicTable);
              dynamicTable.getChildren().add(dynamicCol1);
              CoreOutputText dynamicCell1 = new CoreOutputText();     
              dynamicCell1.setValue("Hello");
              dynamicCell1.setParent(dynamicCol1);
              dynamicCol1.getChildren().add(dynamicCell1);
    I want "Hello" to be printed on the cell (which is not happening now). Any idea why is not getting displayed?

  • Urgent Help on Dynamic Table name change in query !!!!!!!!

    Hi Everyone,
    I'm having a repeating frame which displays table_name, count_validate and count_error. How can i dynamically change my table_name in formula column apllied on count_validate and count_error. I can do this with multiple elsif statement, which makes my report slow at runtime. Select statement is same , only change is table_name ?
    Kindly let me know......

    Try to use dynamic ref cursors (defined in a database package).
    This is not exactly what you need, but see:
    "Dynamic Table in the Second Query with Oracle Reports"
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#JULY
    Regards,
    Zlatko Sirotic

  • Substituting RenderX's XEP for Apache FOP in Serializer

    All,
    I currently use Apache's FOP 20.5 in a serializer to generate PDF on the fly through XSQL.
    However, I'd like to substitute RenderX's XEP engine for the Apache FOP. RenderX has instructions on how to use XEP as a serializer in Cocoon but not for XSQL.
    Anyone out there have any experience accomplishing this?
    Thanks in advance,
    Michael

    Thank you both for your replies.
    I was hoping for a drop-in replacement for the Apache FOP serializer or some sample code to create one myself. The Oracle code in the RenderX link may help.
    If I get this working I'll be sure to post my code.
    Thanks again,
    Michael

  • How to generate dynamic table in JSPX page?(Use ADF to realize OAF)

    Dear all,
    My requirment is to realized the a EBS standard OAF page(PDH module) function by ADF technique. The key point is to realize Dynamic Search Layout and Dynamic Result Table Layout by ADF.
    If anyone who is skill at OAF and ADF, proficient in PDH module is prefered, your question will be highly appreciated.
    Because it is hard to paste image into this thread, so I will appreciate it very much if you can refer the attachment ifile of SR 3-1397372841 for detail information. Sorry for the trouble, I really thanks for your help.
    Edited by: user12264776 on 2010/02/22 17:32

    Hi,
    Thanks for the quick reply. I am using JSF for my ADF application.Could u please elaborate how to use the PhaseListener for Auditing user navigation?
    Arijit

  • Dynamic Table of Content (For specific String)

    Dear Experts,
    I want to table of content ( Index page).
    Create index page at beginning of page or at last of the page with only three contents.
    1. Record Number
    2. Title
    3. Page No.
    For Example,
    No.                   Title                         PageNo
    1                    Technical Specs             2
    2                    Technical Details            4
    3                    Types of Machine           7
    4                    Price of Machine            8
    Here all Title is in different  Group Header, Sub Report-Group Header, Details and Footer as a TEXT OBJECT.
    So How Can I can prepare Index Page?
    i hope you understand all my requirements.
    Thanks & Regards,
    Nishit Makadia

    Sheri,
    This isn't possible at the moment. Pages for iPad can only handle external links.

  • Help with dynamic table

    Hello,
    I need to create a 3 column table from three database tables.
    when any column is missing from the database, I need to display "missing"
    I cannot just bind the tables as all rows need to be processed.
    How can I do this in creator?
    Thanks
    Frank

    Hi Yogesh,
    Create and fill your itab and show it with FM F4IF_INT_TABLE_VALUE_REQUEST
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'field to return from itab'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'field on your screen to be filled'
          stepl           = sy-stepl
          window_title    = 'some text'
          value_org       = 'S'
        TABLES
          value_tab       = itab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    Darley

  • Help Generator is not working for sub-components

    We are using modules with sub-components. The help generator is working fine, except for sub-components.
    The HTML-generator does not generate bookmarks and html for the sub-components and their items.

    So your report sends a email to the mailing list and the list knows what to do with the attached file??
    Just confirming it is NOT a mailing list issue..
    Thank you,
    Tony Miller
    Webster, TX

  • Dynamic Table Columns in UIX

    I have searched for a bit in the forums and documentation for something like this, and have found nothing.
    I would like to be able to have Dynamic table columns, with dynamic content in the table.
    I would like the ability to add non-dynamic rows to the table, placed where I like them.
    Does anyone know how to do this?

    I am creating a report that counts a number of events per hour, each day.
    the layout will look like this:
    0 1 2 3 4 5 6 7 total
    day1 3 3 4 5 4 3 2 3 230
    day2 4 3 2 3 4 2 3 4 235
    day3 3 2 2 2 2 3 2 1 310
    total 9 9 9 9 9 9 9 9 1393
    The user must be able to select the range of days they can see (might be a week, might be a month, might be a year).
    Also, the user can select the range of hours that they want visibile.
    becaus they can select the number of hours, I need to be able to dynamically create the columns to the table, according to the user's selection.
    The report is a very processor consuming report, as there are thousands of events per hour, so I want to trim the atcual data crunching to a minimum.
    can anyone help with dynamic tables?

  • Dynamic Java bean classes for XSD using JAVA (not any external batch or sh)

    Hi,
    How can we generate dynamic Java bean classes for XSD (dynamically support All XSD at runtime)?
    Note: - Through java code via only needs to generate this process. (Not using any xjc.bat or xjc.sh from JAXB).
    Thanks

    Muthu wrote:
    How can we generate dynamic Java bean classes for XSD (dynamically support All XSD at runtime)?
    Pretty sure you can't. Probably can do a lot of them with years of work.
    And can probably can do a resonable subset suitable for the business at hand with only a moderate effort.
    Note: - Through java code via only needs to generate this process. (Not using any xjc.bat or xjc.sh from JAXB).The Sun jdk, not jre, comes with the java compiler as part of it. You can create in memory class (I believe in memory) based on java code you create.
    I believe BCEL alllows the same thing (in memory) but you start with byte codes.
    You could just create a dynamic meta data solution as well, via maps and generic methods. Not as fast though.

  • Dynamic table editable?

    Hi,
    I've created a dynamic table with buttons for adding/removing/moving rows. When I create the PDF, its not possible to enter data. When I'm trying to configure the table/ cells (or any part of the table) to be editable, there is no option to enable editing (select table, Tab Object, Value, disable write protection).
    Thanks in advance,
    Martin

    ideas:
    the cells exist, but fields have not been created? try dragging fields into the cells and try again..
    the form is not saved/previewed as an interactive form? (File -> Form Properties -> Defaults -> Preview Type...
    if you don't manage to work it out, send the form to mashdown45 AT gmail DOT com & I'll have a look at it (but can't promise anything :D)

  • FOR XML to generate dynamic script to drop multiple tables

    Log_Table has a column named Col1 where we have table names
    Col1
    TableA1
    TableA2
    TableA3
    TableB1
    TableC1
    TableC2
    Generate dynamic script to drop tables that are in Log_Table and starts with TableA.
    Instead of using the loop, use For XML

    Thanks Visakh16 [+1],
    you are right there was typo mistake :-) I forgot the variable in the end, and Thanks Naomi [+1],
    this is true and better to use quotename or just add brackets. Actually I will not choose this approach since we chould use schema as well. the DDL in the OP is not something that I will create probably.
    In any case, here is the fixed query (current approach):
    declare @SQLString NVARCHAR(MAX)
    SELECT
    @SQLString = (select
    N'IF OBJECT_ID (N''' + CAST([Col1] AS VARCHAR(MAX)) + N''') IS NOT NULL drop table [' + CAST([Col1] AS VARCHAR(MAX)) + N']; '
    FROM Log_Table
    WHERE (Col1 like 'TableA%')
    FOR XML PATH (''))
    --print @SQLString
    EXECUTE sp_executesql @SQLString
    GO
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Why dynamic table creation with struts working only for JDK1.3.1_02 version

    Row
    import java.util.Vector;
    public class Row
    private static int colsize;
    private Column[] columns;
    public void setColumns(Column[] columns)
    System.out.println("SetColumns");
    this.columns = columns;
    public void setColumn(int i, Column column)
         System.out.println("setting"+ i+"th column"+column);
    public Column[] getColumns()
    return null;
    public Column getColumns(int i)
    System.out.println("Column"+i);
    System.out.println("Colsize"+colsize);
    if(columns == null)
    columns= new Column[colsize];
    if(columns[i] == null)
    columns[i] = new Column();
    return columns;
    public int getColsize()
         return colsize;
    public static void setColsize(int size)
         colsize = size;
    Column:
    public class Column
    private String value;
    public void setValue(String value)
    System.out.println("Value="+value);
    this.value = value;
    public String getValue()
    return value;
    ApplicationResources:
    button.cancel=Cancel
    button.confirm=Confirm
    button.reset=Reset
    button.save=Save
    database.load=Cannot load database from {0}
    error.database.missing=<li>User database is missing, cannot validate logon credentials</li>
    error.fromAddress.format=<li>Invalid format for From Address</li>
    error.fromAddress.required=<li>From Address is required</li>
    error.fullName.required=<li>Full Name is required</li>
    error.host.required=<li>Mail Server is required</li>
    error.noSubscription=<li>No Subscription bean in user session</li>
    error.password.required=<li>Password is required</li>
    error.password2.required=<li>Confirmation password is required</li>
    error.password.match=<li>Password and confirmation password must match</li>
    error.password.mismatch=<li>Invalid username and/or password, please try again</li>
    error.replyToAddress.format=<li>Invalid format for Reply To Address</li>
    error.transaction.token=<li>Cannot submit this form out of order</li>
    error.type.invalid=<li>Server Type must be 'imap' or 'pop3'</li>
    error.type.required=<li>Server Type is required</li>
    error.username.required=<li>Username is required</li>
    error.username.unique=<li>That username is already in use - please select another</li>
    errors.footer=</ul><hr>
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.ioException=I/O exception rendering error messages: {0}
    heading.autoConnect=Auto
    heading.subscriptions=Current Subscriptions
    heading.host=Host Name
    heading.user=User Name
    heading.type=Server Type
    heading.action=Action
    index.heading=MailReader Demonstration Application Options
    index.logon=Log on to the MailReader Demonstration Application
    index.registration=Register with the MailReader Demonstration Application
    index.title=MailReader Demonstration Application (Struts 1.0-b1)
    index.tour=A Walking Tour of the Example Application
    linkSubscription.io=I/O Error: {0}
    linkSubscription.noSubscription=No subscription under attribute {0}
    linkUser.io=I/O Error: {0}
    linkUser.noUser=No user under attribute {0}
    logon.title=MailReader Demonstration Application - Logon
    mainMenu.heading=Main Menu Options for
    mainMenu.logoff=Log off MailReader Demonstration Application
    mainMenu.registration=Edit your user registration profile
    mainMenu.title=MailReader Demonstration Application - Main Menu
    option.imap=IMAP Protocol
    option.pop3=POP3 Protocol
    prompt.autoConnect=Auto Connect:
    prompt.fromAddress=From Address:
    prompt.fullName=Full Name:
    prompt.mailHostname=Mail Server:
    prompt.mailPassword=Mail Password:
    prompt.mailServerType=Server Type:
    prompt.mailUsername=Mail Username:
    prompt.password=Password:
    prompt.password2=(Repeat) Password:
    prompt.replyToAddress=Reply To Address:
    prompt.username=Username:
    registration.addSubscription=Add
    registration.deleteSubscription=Delete
    registration.editSubscription=Edit
    registration.title.create=Register for the MailReader Demostration Application
    registration.title.edit=Edit Registration for the MailReader Demonstration Application
    subscription.title.create=Create New Mail Subscription
    subscription.title.delete=Delete Existing Mail Subscription
    subscription.title.edit=Edit Existing Mail Subscription
    LogonForm
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    public class LogonForm extends ActionForm
    private String username;
    private String password;
    private String errors;
    public String getUsername()
    return username;
    public void setUsername(String username)
    this.username = username;
    public void setPassword(String password)
    this.password = password;
    public String getPassword()
    return password;
    public String getErrors()
         return errors;
    public void setErrors(String errors)
         this.errors = errors;
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    ActionErrors errors = new ActionErrors();
    if ((username == null) || (username.length() < 1))
    errors.add("username", new ActionError("error.username.required"));
    if ((password == null) || (password.length() < 1))
    errors.add("password", new ActionError("error.password.required"));
    return errors;
    TableForm
    import org.apache.struts.action.ActionForm;
    import java.util.Vector;
    public class TableForm extends ActionForm
    private static int rowsize;
    private Row[] rows;
    public Row getRows(int i)
    System.out.println("Row"+i);
    System.out.println("Rowsize"+rowsize);
    if(rows == null)
    rows = new Row[rowsize];
    if(rows[i] == null)
    rows[i] = new Row();
    return rows[i];
    public Row[] getRows()
         return null;
    public void setRows(Row[] rows)
         System.out.println("SetRows");
         // this.rows=rows;
    public static void setRowsize(int size)
         rowsize = size;
    public int getRowSize()
         return rowsize;
    LogonAction
    import java.io.IOException;
    import java.util.Hashtable;
    import java.util.Locale;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionServlet;
    import org.apache.struts.util.MessageResources;
    public class LogonAction extends Action
    public ActionForward execute(ActionMapping mapping,
                        ActionForm form,
                        HttpServletRequest request,
                        HttpServletResponse response)
         throws IOException, ServletException {
    LogonForm logonForm = (LogonForm) form;
    System.out.println(logonForm);
    System.out.println(logonForm.getUsername());
    System.out.println(logonForm.getPassword());
    if(logonForm.getUsername().equals("test") && logonForm.getPassword().equals("test"))
    //TableForm tform = new TableForm();
    //tform.setRowsize(2);
    //tform.getRows(0).setColsize(2);
    //tform.getRows(1).setColsize(2);
    //request.getSession().setAttribute("tableForm",tform);
         System.out.println("Table Form setRowSize");
    TableForm.setRowsize(2);
         System.out.println("Table Form set ColSize");
    Row.setColsize(2);
         System.out.println("Returning success");
    return mapping.findForward("success");
    else
              ActionErrors errors = new ActionErrors();
              errors.add("password",
    new ActionError("error.password.mismatch"));
    saveErrors(request, errors);
    //logonForm.setErrors("LoginError");
    return mapping.findForward("failure");
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <!--
    This is the Struts configuration file for the example application,
    using the proposed new syntax.
    NOTE: You would only flesh out the details in the "form-bean"
    declarations if you had a generator tool that used them to create
    the corresponding Java classes for you. Otherwise, you would
    need only the "form-bean" element itself, with the corresponding
    "name" and "type" attributes.
    -->
    <struts-config>
    <form-beans>
    <!-- Logon form bean -->
    <form-bean name="logonForm"
    type="LogonForm"/>
    <form-bean name="tableForm"
    type="TableForm"/>
    <form-bean name="profileForm"
    type="ProfileForm"/>
    </form-beans>
    <global-forwards>
    <forward name="success" path="/Profile.jsp"/>
    </global-forwards>
    <!-- ========== Action Mapping Definitions ============================== -->
    <action-mappings>
    <!-- Edit user registration -->
    <action path="/logon"
    type="LogonAction"
    name="logonForm"
    scope="request"
    validate="false"
    input="/Test.jsp">
    <forward name="success" path="/Table.jsp"/>
    <forward name="failure" path="/Test.jsp"/>
    </action>
    <action path="/table"
    type="TableAction"
    name="tableForm"
    scope="request"
    validate="false">
    <forward name="success" path="/Bean.jsp"/>
    <forward name="failure" path="/Table.jsp"/>
    </action>
    <action path="/profile"
    type="ProfileAction"
    name="profileForm"
    scope="request"
    validate="false"
    parameter="method">
    <forward name="edit" path="/EditProfile.jsp"/>
    <forward name="show" path="/Profile.jsp"/>
    </action>
    </action-mappings>
    </struts-config>
    Test.jsp
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <html:form action="/logon" >
    <center>
    <table>
    <tr>
    <td> Username </td>
    <td> <html:text property="username" size="16" maxlength="16"/> </td>
    <td> <html:errors property="username" /> </td>
    </tr>
    <tr>
    <td> Password </td>
    <td> <html:password property="password" size="16" maxlength="16"
    redisplay="false"/> </td>
    <td><html:errors property="password" /> </td>
    </tr>
    </table>
    </center>
    <center> <html:submit property="submit" value="Submit"/> </center>
    </html:form>
    </html:html>
    Table.jsp
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <html:form action="/table" >
    <center>
    <table>
    <tr>
    <td> <html:text property="rows[0].columns[0].value" /> </td>
    <td> <html:text property="rows[0].columns[1].value" /></td>
    </tr>
    <tr>
    <td> <html:text property="rows[1].columns[0].value" /> </td>
    <td> <html:text property="rows[1].columns[1].value" /></td>
    </tr>
    </table>
    </center>
    <center> <html:submit property="submit" value="Submit"/> </center>
    </html:form>
    </html:html>

    The above application runs only with JDK1.3.1_02 and not with any other version. This application is creating dynamic table using struts.
    Can anybody help me on the same
    also appending web.xml contents:
    <?xml version="1.0" ?>
    <!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>
    <!-- Action Servlet Configuration -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResources</param-value>
    </init-param>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>validate</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!--Welcome file list starts here -->
    <welcome-file-list>
    <welcome-file>
    /test.jsp
    </welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    </web-app>
    validate-rules.xml
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    <!--
    This file contains the default Struts Validator pluggable validator
    definitions. It should be placed somewhere under /WEB-INF and
    referenced in the struts-config.xml under the plug-in element
    for the ValidatorPlugIn.
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    </plug-in>
    These are the default error messages associated with
    each validator defined in this file. They should be
    added to your projects ApplicationResources.properties
    file or you can associate new ones by modifying the
    pluggable validators msg attributes in this file.
    # Struts Validator Error Messages
    errors.required={0} is required.
    errors.minlength={0} can not be less than {1} characters.
    errors.maxlength={0} can not be greater than {1} characters.
    errors.invalid={0} is invalid.
    errors.byte={0} must be a byte.
    errors.short={0} must be a short.
    errors.integer={0} must be an integer.
    errors.long={0} must be a long.
    errors.float={0} must be a float.
    errors.double={0} must be a double.
    errors.date={0} is not a date.
    errors.range={0} is not in the range {1} through {2}.
    errors.creditcard={0} is an invalid credit card number.
    errors.email={0} is an invalid e-mail address.
    -->
    <form-validation>
    <global>
    <validator name="required"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequired"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    <javascript><![CDATA[
    function validateRequired(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oRequired = new required();
    for (x in oRequired) {
         var field = form[oRequired[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'file' ||
    field.type == 'select-one' ||
    field.type == 'radio' ||
    field.type == 'password') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (trim(value).length == 0) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oRequired[x][1];
         isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    // Trim whitespace from left and right sides of s.
    function trim(s) {
    return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
    ]]>
    </javascript>
    </validator>
    <validator name="requiredif"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequiredIf"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    org.apache.commons.validator.Validator,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required">
    </validator>
    <validator name="minlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMinLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.minlength">
    <javascript><![CDATA[
    function validateMinLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMinLength = new minlength();
    for (x in oMinLength) {
    var field = form[oMinLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMin = parseInt(oMinLength[x][2]("minlength"));
    if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMinLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="maxlength"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMaxLength"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.maxlength">
    <javascript><![CDATA[
    function validateMaxLength(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMaxLength = new maxlength();
    for (x in oMaxLength) {
    var field = form[oMaxLength[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea') {
    var iMax = parseInt(oMaxLength[x][2]("maxlength"));
    if (field.value.length > iMax) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMaxLength[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    }]]>
    </javascript>
    </validator>
    <validator name="mask"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateMask"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.invalid">
    <javascript><![CDATA[
    function validateMask(form) {
    var isValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oMasked = new mask();
    for (x in oMasked) {
    var field = form[oMasked[x][0]];
    if ((field.type == 'text' ||
    field.type == 'textarea') &&
    (field.value.length > 0)) {
    if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
    if (i == 0) {
    focusField = field;
    fields[i++] = oMasked[x][1];
    isValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return isValid;
    function matchPattern(value, mask) {
    return mask.exec(value);
    }]]>
    </javascript>
    </validator>
    <validator name="byte"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateByte"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.byte"
    jsFunctionName="ByteValidations">
    <javascript><![CDATA[
    function validateByte(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oByte = new ByteValidations();
    for (x in oByte) {
         var field = form[oByte[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
                                  field.type == 'radio') {
                                  var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oByte[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oByte[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="short"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateShort"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.short"
    jsFunctionName="ShortValidations">
    <javascript><![CDATA[
    function validateShort(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oShort = new ShortValidations();
    for (x in oShort) {
         var field = form[oShort[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oShort[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oShort[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="integer"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateInteger"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.integer"
    jsFunctionName="IntegerValidations">
    <javascript><![CDATA[
    function validateInteger(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oInteger = new IntegerValidations();
    for (x in oInteger) {
         var field = form[oInteger[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
    var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                  if (si >= 0) {
                                       value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    if (!isAllDigits(value)) {
    bValid = false;
    if (i == 0) {
         focusField = field;
                                  fields[i++] = oInteger[x][1];
    } else {
         var iValue = parseInt(value);
         if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oInteger[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    function isAllDigits(argvalue) {
    argvalue = argvalue.toString();
    var validChars = "0123456789";
    var startFrom = 0;
    if (argvalue.substring(0, 2) == "0x") {
    validChars = "0123456789abcdefABCDEF";
    startFrom = 2;
    } else if (argvalue.charAt(0) == "0") {
    validChars = "01234567";
    startFrom = 1;
    } else if (argvalue.charAt(0) == "-") {
    startFrom = 1;
    for (var n = startFrom; n < argvalue.length; n++) {
    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
    return true;
    }]]>
    </javascript>
    </validator>
    <validator name="long"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateLong"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.long"/>
    <validator name="float"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateFloat"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.float"
    jsFunctionName="FloatValidations">
    <javascript><![CDATA[
    function validateFloat(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oFloat = new FloatValidations();
    for (x in oFloat) {
         var field = form[oFloat[x][0]];
    if (field.type == 'text' ||
    field.type == 'textarea' ||
    field.type == 'select-one' ||
    field.type == 'radio') {
         var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                       value = field.options[si].value;
                                  } else {
                                       value = field.value;
    if (value.length > 0) {
    // remove '.' before checking digits
    var tempArray = value.split('.');
    var joinedString= tempArray.join('');
    if (!isAllDigits(joinedString)) {
    bValid = false;
    if (i == 0) {
    focusField = field;
    fields[i++] = oFloat[x][1];
    } else {
         var iValue = parseFloat(value);
         if (isNaN(iValue)) {
         if (i == 0) {
         focusField = field;
         fields[i++] = oFloat[x][1];
         bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    }]]>
    </javascript>
    </validator>
    <validator name="double"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDouble"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.double"/>
    <validator name="date"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateDate"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.date"
    jsFunctionName="DateValidations">
    <javascript><![CDATA[
    function validateDate(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oDate = new DateValidations();
    for (x in oDate) {
    var value = form[oDate[x][0]].value;
    var datePattern = oDate[x][2]("datePatternStrict");
    if ((form[oDate[x][0]].type == 'text' ||
    form[oDate[x][0]].type == 'textarea') &&
    (value.length > 0) &&
    (datePattern.length > 0)) {
    var MONTH = "MM";
    var DAY = "dd";
    var YEAR = "yyyy";
    var orderMonth = datePattern.indexOf(MONTH);
    var orderDay = datePattern.indexOf(DAY);
    var orderYear = datePattern.indexOf(YEAR);
    if ((orderDay < orderYear && orderDay > orderMonth)) {
    var iDelim1 = orderMonth + MONTH.length;
    var iDelim2 = orderDay + DAY.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderDay && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderDay) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
    var matched = dateRegexp.exec(value);
    if(matched != null) {
    if (!isValidDate(matched[2], matched[1], matched[3])) {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
    var iDelim1 = orderDay + DAY.length;
    var iDelim2 = orderMonth + MONTH.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderMonth && iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
    } else if (iDelim1 == orderMonth) {
    dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
    } else if (iDelim2 == orderYear) {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
    } else {
    dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
    var matched = dateRegexp.exec(value);
    if(matched != null) {
    if (!isValidDate(matched[1], matched[2], matched[3])) {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else {
    if (i == 0) {
    focusField = form[oDate[x][0]];
    fields[i++] = oDate[x][1];
    bValid = false;
    } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
    var iDelim1 = orderYear + YEAR.length;
    var iDelim2 = orderMonth + MONTH.length;
    var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
    var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
    if (iDelim1 == orderMonth && iDelim2 == orderDay) {
    dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
    } else if (iDelim1 == orderMonth) {
    dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
    } else if (iDelim2 == orderDay) {
    dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
    } else {
    dateRegexp = new Reg

  • Generating dynamic command links in data table

    Hi,
    I have a requirement to generate dynamic number of columns in a datatable. Also these columns should contain a command link.
    I have written following piece of code to do so...
    public UIData getDataTableBinding()
         UICommand comm = null;
         UIColumn col;
         UIOutput out = null;
         Application app = app = FacesContext.getCurrentInstance().getApplication();
    // Suppose I want to generate 7 columns
         for(int j = 0; j < 7; ++j) {
         out = new UIOutput();
         col = new UIColumn();
         comm = new UICommand();
         ValueBinding vb = app.createValueBinding("#{" + j + "}");
         out.setValueBinding("value", vb);
         out.setRendererType("javax.faces.Text");
         comm.setRendererType("javax.faces.Link");
    comm.getChildren().add(out);
         MethodBinding mbButton = app.createMethodBinding("#{pc_File1.doLink1Action}",
    null);
         comm.setAction(mbButton);
         col.getChildren().add(comm);
         dataTableTemp.getChildren().add(col);
         return dataTableTemp;
    I have bound the "binding" attribute of the data table to getDataTableBinding()
    method.
    If I remove all the references to UICommand i.e comm variable, table is displayed properly, but if
    I try to include a command link component as mentioned above I get "Assertion failed error"
    SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown :
    javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property
    'dataTableBinding' from bean of type pagecode.File1: javax.faces.FacesException: Assertion Failed
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:638)
         at com.ibm._jsp._File1._jspService(_File1.java:92)
         at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    Any kind of help on this issue would be appreciated,
    Thanks in advance,
    Raina

    Hi,
    I solved my problem just by replacing UIOutput component with HtmlOutputText component and then making it as a child component of UICommand component.
    Now I am facing a new problem. Whenever I try to refresh the page I get following exception
    "SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Duplicate component ID 'form1:table1:cmd0' found in view."
    I am explicitly setting the component id of the UICommand component using the setViewId() method.
    This problem is observed only when I refresh the page. In case I navigate to another page and then again come back to this current page, then I don't get this exception.
    Your help would be appreciated,
    Raina

Maybe you are looking for

  • ITunes Match on a Synology Nas - many exclamation marks in the first row

    Hi, I transfared my entire iTunes Libary of roughly 26.000 Songs (1.000 plus bought on iTunes) to my Synology NAS.  Now when I start iTunes on my MacBook via WiFi it takes quite some time to be ready to play. Each time I open the Library on my NAS iT

  • Epson CX4800 won't print everything from Internet

    I've had an Epson Stylus CX4800 working for me long before I got my iMac. Although it could possibly benefit from a mechanical tune-up, something is happening that seems more like a potential software issue to me. Whenever I print a fairly large docu

  • Playback on

    Ok well I have a Creative Labs Nomad Jukebox Zen Xtra with 40GB of space. Now I know you can put all the songs that are on the MP3 player onto your PC but what about just playing the songs from your MP3 to your pc? I have it all hooked up to my USB p

  • Export graphs from Web report

    Hi. I need to copy graphs from web reports in 3.5.To do this, i have followed a roundabout: 1. Save the page as mht (web archive file) 2.Copy the image from there and paste into Powerpoint or wherever required. Is there any better way to do it? Or ca

  • Updating the iphone fails.. hard

    Heyas, I tried to update to the latest OS for the iPhone today, and while it was installing and doing it's thing, the itunes program crashed, leaving the iphone stuck in the "plug me into itunes" mode, and has been ever since. So my questions is clea