Developing a dynamic table in jsp

I am developing a jsp page which has requirement something link this.
User enters parameter name and parameter value and clicks on add button the details should get displayed in the table in the jsp.user should be able to select the row which he/she wanted to delete and on click of delete the row should get deleted. Please help me in designing this page.All the details will be stored in the data base when the user clicks on submit button.

That is indeed a lot of code, but is basically relativeley easy. Just understand how passing HTTP query parameters works and make use of JSTL/EL as much as possible.
Though there are tag libraries out which minimizes the code effort. Such as the 'displaytag' taglib. [Google it|http://google.com/search?q=displaytag].

Similar Messages

  • Dynamic table in JSP

    Hi,
    We need some help regarding an unusual problem we are facing in our web application.
    The background:-
    We have a web page (JSP) for updating (adding, modifying, deleting) data from a single table. This page has been designed in such a way that when ever it is invoked, it displays content of the entire table on the page. Also there is a facility of filtering this content. The entire table content is displayed in a dynamic table without paging. There is one java script which is used to manage the scrolling of this table (300 rows at a time). Please not that it is just scrolling that is controlled by the Java Script, that is the entire table is displayed in a specific area with vertical scroll. Each row in this table has a radio button associated with it which is used to select a particular row for modifying it. User can select a single row at a time.
    The problem:-
    This page was working fine, until the number of rows in the table were under 70,000 records. Currently there are more than 72,000 records and the page doesn�t get displayed at all. It is not giving timeout error and also it is not going in to �Not Responding� state. It is simply showing a blank result page without the result table. Initially we thought that because we are fetching so much data in one go this would have been happening. But this problem arises only when we access this page from PC having Windows-XP operating system. If we access this page through a PC having Windows 2003 Server OS then it displays the entire table in a normal fashion.
    We are in the process of redesigning the page, but still want to know why this is happening. It will be a great help if anybody can give any pointer on this issue. And also what should be a better option of displaying such a huge table for modification of rows.
    Thanks and Regards,
    Jagdish.

    Thanks a lot masoodmjan.
    Lets assume that this problem is due to huge data being desplayed at once. Now if I decide to provide pagination to browse this entire recordset, which now has grown to 90000+ records, how many rows should I desplay on 1 page? Is there any thumb rule to decide this number?
    Just now I tried with 10,000 records per page & it took more than 25minutes to display single page. :(

  • Need Dynamic Table in JSP page

    Hi Friends,
    I need to build table dynamically in my JSP page.
    My requirement like:
    I have a Button in my JSP page when i click that it should go to another jsp where it will ask me the row and column counts, after i entered some values then i have a button to say OK it should go to the first page again there i want the table for the rows and columns dynamically.
    (like MS- Word when u create table it will ask the row count and column count after that its building a table)
    Please help me....

    Make use of JSTL's c:forEach.

  • How to create dynamic tables in jsp page

    Hi,
    Iwant to create a table with 8 rows.each row will have two select boxes and one text box.besides i have add button.intially the screen shows only one row.if user clicks on add button then another row is added.like this upto 8 rows.
    how can solve this problem..
    regards,

    Hi I am not a big programmer but i can suggest a method to u
    try something like this..
    this could be quite adjusted in html page itself.....
    <html>
    <head>
    <script language="javascript">
    var count=1
    fucntion addRow(){
    if(count<8){
    count=count+1
    row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr>"
    else if(count==8){
    row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td></td></tr>"
    </script >
    </head>
    <body>
    <form action='Myservlet" method='post'>
    <table>
    <div name='row' name='row'><tr><td><input type='text' name=1></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr></div>
    </table>
    </form>
    </body>
    </html>
    I believe it could be quite adjusted @ client side itself.... as per your description...

  • Dynamic table on specific height of JSP page

    I have large data.
    I have to show this data in dynamic table on jsp page.
    the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
    I can only display atmost 12 single rows on one page
    but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
    becoz of this i cant implement this check (only show 12 rows on a page).
    so what can i do to show specified height of table on one page and remaining move to next page.

    This is an impossible requirement. Page, font and element height is not only browser dependend, but also depending on the settings of the user. Some users will override the font size to be smaller or bigger using a browser option, resizing your table accordingly. Mac fonts might have different sizes if the fonts are antialiased, etc.
    You'd have more success if you could output the table as PDF, there are far more table spacing options available, it's portable and you have 100% control over the output. Check out the iText API for example. The only problem with this is that the PDF will be opened by a PDF viewer which you cannot control, so you cannot make it automatically print.

  • Help Required  !!! -- Dynamic table on specific height of JSP page

    I have large data.
    I have to show this data in dynamic table on jsp page.
    the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
    I can only display atmost 12 single rows on one page
    but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
    becoz of this i cant implement this check (only show 12 rows on a page).
    so what can i do to show specified height of table on one page and remaining move to next page.

    This is an impossible requirement. Page, font and element height is not only browser dependend, but also depending on the settings of the user. Some users will override the font size to be smaller or bigger using a browser option, resizing your table accordingly. Mac fonts might have different sizes if the fonts are antialiased, etc.
    You'd have more success if you could output the table as PDF, there are far more table spacing options available, it's portable and you have 100% control over the output. Check out the iText API for example. The only problem with this is that the PDF will be opened by a PDF viewer which you cannot control, so you cannot make it automatically print.

  • Have to display a dynamic table on specific height of JSP page

    I have large data.
    I have to show this data in dynamic table on jsp page.
    the JSP page is logically divided in different pages (as this page is used for printing on specified size of page)
    I can only display atmost 12 single rows on one page
    but some times text of one column of row become so large that rows expands vertically and occupies space of 2 or 3 rows (thats why now i have to display 8 or 9 rows on first page and then remaining on next )
    becoz of this i cant implement this check (only show 12 rows on a page).
    so what can i do to show specified height of table on one page and remaining move to next page.

    hi,
    its not so easy ...i had this problem once befor 2 months in the work
    i think u have to implement a Controller.java class that controll the iterating between pages ...
    u should have an pageIndex and just play with this index (increment and decrement)

  • DYNAMIC TABLE CREATION USING JSP

    I WANT TO CREATE A DATABASE TABLE IN AN INTERACTIVE WAY ie MY QUESTION IS: HOW TO CREATE A TABLE USING JSP WITH TWO ARRAYS(FIRST ARRAY CONTAINS FIELD(COLUMN) NAMES AND THE SECOND ARRAY CONTAINS ITS CORRESPONDING DATATYPE)BOTH ARRAYS ARE OF VARYING SIZE.IF THE USER ENTERS SUPPOSE '6' AS THE INPUT TO FORM A TABLE OF 6 FIELDS SO, THE QUERY SHOULD BE DYNAMICALLY FORME USING THE ARRAY NAME FOR FIELD AND THE ARRANAME FOR ITS CORRESPONDING DATATYPE.HAVE ANY IDEA ON THIS PLEASE LET ME KNOW.
    THANKS

    u need to know quite a few java technologies to make archieve your dream.
    JDBC, dynamic array and JSP.
    after reading tutorial regarding to these 3 materials, you should be able to get your job done.

  • Send multiple rows to database from a dynamic table.

    I'm using JSP for my application. I have a table that changes
    in size depending on a value a user selects in a drop down list.
    They can then enter some values into the table and click the submit
    button. I know for whatever reason Dreamweaver only sends the first
    row to the database and I've had a hard time finding good
    examples/tutorials showing how I could make it send all the rows to
    the database.
    Is there a way for me to just do a while/for loop taking into
    account the number of rows in the table? That would be ideal for me
    as it sounds like the simplest method and I'm very new to web
    development.
    Should I be using the Server Behavior Builder or a Stored
    Procedure and if so is there any good examples for those as I've
    had a hard time working with any documentation/tutorials I've found
    regarding them.
    Any help would be greatly appreciated.

    Hey Baxter, thanks for the response. I guess I should have
    been more specific when I said I was new to Web Development. I am
    actually in Software Development where I primarily code in Java and
    other OO languages. I have worked with a database before in java by
    writing my own servlet. I have also done some HTML so jsp is very
    good for me as it is mostly java with the odd bit of html
    structuring with tables and such.
    Languages like PHP and ASP I am not very familiar with and
    most of the solutions I find for this very problem revolve around
    ASP. I have just found it very hard to find a solution to this
    problem. It seems like it isn't talked about very much even in
    Dreamweaver's own documentation. If a stored procedure is the only
    way to go then I think I can handle it with some guidance if anyone
    knows of some tutorials/examples available.
    Also is it really not possible to just go into the code and
    somehow make it loop through each row in the table and execute a
    prepared statement for each row? I've included some code of the
    dynamic table I have and as you can see I have a Submit button on
    its own outside of the table. If i had it inside then the user
    would have to submit each row individually which isn't realistic
    when there are many rows of data. Since the Submit is outside of
    the while it only gets called once after the table is populated
    thus sending only one row of data.
    You might want to copy paste the code into a text editor as
    some of the lines are long and may be hard to read here. If you
    notice any errors in the table itself like mismatching column
    headers it is because I changed some column names before attaching
    it here so just assume that the table is all built correctly.
    PS: I am going to be out of town for five days or so, so if I
    don't reply to you right away don't think I disappeared from this
    thread. Thanks again.
    <div>
    <h2>TableData</h2>
    <form ACTION="<%=MM_editAction%>" METHOD="POST"
    name="tabledata">
    <table>
    <% if (!Recordset1_isEmpty ) { %>
    <tr>
    <td class="head">Name1</td>
    <td class="head">Name2</td>
    <td class="head">Name3</td>
    <td class="head">Code1</td>
    <td class="head">Code2</td>
    <td class="head">Old Status1</td>
    <td class="head">New Status1</td>
    <td class="head">Old Status2</td>
    <td class="head">New Status2</td>
    <td class="head">Year</td>
    </tr>
    <% } /* end !Recordset1_isEmpty */ %>
    <% while
    ((Recordset1_hasData)&&(Repeat1__numRows-- != 0)) { %>
    <% if (szin11 ==2) {color11 = "#ECECEC" ;szin11=(0);}
    %><tr>
    <td><input type="hidden"
    value="<%=((((Recordset1_data =
    Recordset1.getObject("Name1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Name1"
    /><%=(((Recordset1_data =
    Recordset1.getObject("Name1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input value="<%=((((Recordset1_data =
    Recordset1.getObject("Name2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Name2"
    type="hidden" /><%=(((Recordset1_data =
    Recordset1.getObject("Name2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input value="<%=((((Recordset1_data =
    Recordset1.getObject("Name3"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Name3"
    type="hidden" /><%=(((Recordset1_data =
    Recordset1.getObject("Name3"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <input name="Code1" type="hidden"
    value="<%=(((Recordset1_data =
    Recordset1.getObject("Code1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>" />
    <td><input value="<%=((((Recordset1_data =
    Recordset1.getObject("Code2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Code2"
    type="hidden" /><%=(((Recordset1_data =
    Recordset1.getObject("Code2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input value="<%=((((Recordset1_data =
    Recordset1.getObject("Old Status1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Old Status1"
    type="hidden" /><%=(((Recordset1_data =
    Recordset1.getObject("Old Status1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input size="10"
    value="<%=((((Recordset1_data = Recordset1.getObject("New
    Status1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="New Status1"
    type="hidden" />
    <%=(((Recordset1_data = Recordset1.getObject("New
    Status1"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input name="New Status1" type="text" size="5"
    /></td>
    <td><input size="10"
    value="<%=((((Recordset1_data = Recordset1.getObject("Old
    Status2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data))%>" name="Old Status2"
    type="hidden" />
    <%=(((Recordset1_data = Recordset1.getObject("New
    Status2"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></td>
    <td><input name="New Status2" type="text" size="5"
    /></td>
    <td><%=(((Recordset1_data =
    Recordset1.getObject("Year"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>
    <input name="Year" type="hidden"
    value="<%=(((Recordset1_data =
    Recordset1.getObject("Year"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>"
    /></td></tr>
    <% if (szin11 ==0) {color11 = "#FFFFFF"; szin11=(0);}
    %>
    <% szin11++; %>
    <%
    Repeat1__index++;
    Recordset1_hasData = Recordset1.next();
    %>
    </table>
    <p>
    Comments<br />
    <textarea name="comments" cols="40"
    rows="4"></textarea>
    </p>
    <p>
    <input type="submit" value="Submit" />
    </p>
    <input type="hidden" name="MM_insert" value="tabledata"
    />
    </form>
    </div>

  • HR Logical database PNP. OO to fill table dynamic table  from PNP  ?

    Hi all
    I want to get some stuff from the HR logical database into a dynamic table
    Here's a real simple example that writes info out to a normal list.
    (report is based on using Logical DB PNP)
    tables: pernr.
    INFOTYPES: 0001,                     "Organizational Assignment
               0002.                     "Personal Data
    SELECT-OPTIONS: language FOR p0002-sprsl.
    INITIALIZATION.
      pnptimed = 'D'.
    GET pernr.
      PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda.
        CHECK language.
        WRITE: / p0002-pernr,
                 sy-vline,
                 p0001-ename,
                 sy-vline,
                 p0002-sprsl,
                 sy-vline,
                 p0002-gbdat.
      ENDPROVIDE.
    endform.
    Now what I want to do is replace the write stuff by appending the entries into a dynamic table which I will display as an ALV Grid.
    so I add my structure in the data declarations
    types:  begin of s_elements,
       pernr  type  p0002-pernr,
       ename  type p0001-ename,
       sprsl  type p0002-sprsl,
       gbdat   type p0002-gbdat.
      drop_down_handle  type int4.
    types: end of    s_elements.
    include zz_jimbo_incl.
    build the dynamic table
    create data dref type s_elements.
      assign dref->* to <fs>.
      i_routine = 'POPULATE_DYNAMIC_ITAB'.*
    i_names   = 'NAME_COLUMNS'.
      i_gridtitle = 'HR  TEST'.
    invoker = sy-repid.
    i_zebra = 'X '.
    i_edit = '  '.
    call function 'ZZ_CALL_SCREEN'
         exporting
              invoker     = invoker
              my_line     = <fs>
              i_gridtitle = i_gridtitle
              i_edit      = i_edit
              i_zebra     = i_zebra
              i_names     = i_names
              i_routine   = i_routine
         importing
              z_object    = z_object
              dy_table    = dy_table.
    Now to populate the dynamic Itab the routine below is entered.
    form populate_dynamic_itab changing dy_table.
      assign dy_table->* to <dyn_table>.
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    However I can't use GET / PROVIDE / ENDPROVIDE in a Form.
    Anyway round this ---seems HR has an aversion to OO.
    Cheers
    jimbo

    Hi,
    well, GET_PERNR is a so called event_statement. It has nothing to do with ABAP 00.
    Normally it will be like this:
    START-OF-SELECTION.
    GET_PERNR.
    PROVIDE ....
    END-OF-SELECTION.
    -> and here the CALL SCREEN NNNN for ALV-Display.
    Provide-statements you can use in forms of course, and as many times you want during GET and END-OF-SELECTION.
    But as I understood : you just want to save the write-statements?
    I always develop a DDIC-Structure, declarate the data objects in the programm, read the data via Provide into the infotypes, and then make a move-corresponding to my structure. and display it.
    Normally no problem.
    kind regards
    maik

  • 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

  • How to populate a dynamic table according to the choice of the viewer

    Hi there,
    I ran into a dead-end on my  "Events" page.
    There is a dynamic table getting the info from a database. It will initially show the Upcoming Events.
    At this point my question is this:
    *Can I populate the dynamic table based on a condition where the current date and the event date (as in the db) will be compared and if the event date is later than the current date, it will be displayed in the table. Otherwise, it won't.
    If I can do that, can someone please help me out with the code?
    Besides that, on the right side of the page there are 3 options for the viewer:
    1. View upcoming events
    2. View past events
    3. Search events by month and year
    What I want to do is that when the viewer clicks on 'past events', the table will be reset and populated with those events whose date has passed.
    When the viewer clicks on "upcoming events", the table is reset again and populated with the relevant events.
    When the viewer selects a month and a year, search the database to find the relevant records.
    Can all of this be written in php? Since I read smwhere that php doesn't work with onclick functions... i got confused. Cuz the data in my table will have to vary depending on what the viewer is clicking (upcoming events/past events/search events). I do not wish to create separate pages for each type of event.
    If anybody has a better suggestion to carry out this task, please share!
    Thanks!

    >Can I populate the dynamic table based on a condition where the current date and the event date (as in the db)
    >will be compared and if the event date is later than the current date, it will be displayed in the table. Otherwise, it won't.
    Of course. You just need to compare the date field in your database with the current date as returned by your DBMS date function. Assuming you are using MySQL, you would compare your column with the currdate() function and use the appropriate greater than/ less than operators in the SQL WHERE clause. If you don't know what a WHERE clause is then I would urge you to learn SQL as soon as possible. You can't build data driven sites without a basic understanding of SQL.
    >Since I read smwhere that php doesn't work with onclick functions..
    What this means is that php is a server side language, where user interactions always occur at the client site. But that does not mean you can't invoke a server side action from a client side event. You most certainly can and would.
    You might consider adding links to the dynamic table page that pass a querystring to the php script which determine what filter to add in the WHERE clause- greater than the current date, less than, etc.
    Also, in the future, please post these questions to the application development forum.

  • Dynamic Table with two columns

    Hi!
    i have to create a Dynamic Table with two columns having 5-5 links each with some text...... three links r based on certain conditions....they r visible only if condition is true...
    if the links r not visible in this case another links take it's place & fill the cell.
    links/text is coming from database.
    i am using Struts with JSP IDE netbeans
    Please help me
    BuntyIndia

    i wanna do something like this
    <div class="box_d box_margin_right">
              <ul class="anchor-bullet">
              <c:forEach items="${data.faqList}" var="item" varStatus="status"
                        begin="0" end="${data.faqListSize/2-1}">
                        <li>${item}</li>
                   </c:forEach>
              </ul>
              </div>
              <div class="box_d">
              <ul class="anchor-bullet">
              <c:forEach items="${data.faqList}" var="item" varStatus="status"
                        begin="${data.faqListSize/2}" end="${data.faqListSize}">
                        <li>${item}</li>
                   </c:forEach>
              </ul>
              </div>
    wanna divide table in two columns....if one link got off due to condition other one take it's position...
    I have created a textorderedlist
    Bunty

  • About using dynamic sql in jsp

    I make a jsp file with "CreateViewObjec".I can get the message from db ,but I get the same message when I push the button "next" .Please help me!
    my jsp file is:
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <%@ page contentType="text/html;charset=MS936"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=MS936">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    </P>
    <jbo:ApplicationModule id="MypackageModule" configname="mypackage.MypackageModule.MypackageModuleLocal" releasemode="Stateful" />
    <jbo:CreateViewObject appid="MypackageModule" name="dyname" rangesize="10" >
    select PRODUCT_NAME from product_information
    </jbo:CreateViewObject>
    <jbo:DataSource id="id" rangesize="20" appid="MypackageModule" viewobject="dyname" />
    <table border="0">
    <tr>
    <td ALIGN="right"><jbo:DataScroller datasource="id" /></td>
    </tr>
    <tr><td>
    <jbo:DataTable datasource="id" />
    </td>
    </tr>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources />

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • Dynamic table generation for Employee Schedule Project

    Hi,
    I am new to Jave programming and attempting to teach myself Java using the Sun tutorials & these forums. As a first step of learning, I want to do a Automated Employee Schedule Project in Java. (JSP)
    There are two main parts of the project. The first part will be a table with the employees listed down the left, the days of the week across the top, and with each cell being that employee's shift for the day. There are four different types of shift in a day ( M- Morning, R- Regular, A- Afternoon and N- Night).
    The second part will allows the user to enter in a new employee or display/edit an existing employee's information, including a list of scheduling constraints, like can?t work in Morning shift / Night shift. Apart from that number of employee in a shift may vary based on situation.
    Could you please help me to understand the flow for creating this Automated Employee Schedule project?
    Thanks in advance.
    Amitava

    I need the logic as to how to generate the shift plan. Could you tell me how to get about creating this dynamic table and any idea what i should take as baseline? I was thinking to read the employees from the database and take them as input for the first column. and the number of days as the column list. Can you tell me if this is the correct approach?

Maybe you are looking for

  • Problem with sender name CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

    Hi All , I am using below function module to send a mail to external email Id's  , Everything is working perfectly  . But  in the sender address I have passed text as 'infomation '  , In email which i am recieving sender address is like text and '@xy

  • I am totally confused

    I subscripbed for a 210 area code number so my friends from the US could call me in and it roll over to me in  latin america, free!  only using their cell min. and no international call. They called this a subscription, but now it is no where to be f

  • Ubd was eating up all network bandwidth after latest upgrade.

    Hello, When the OS X 10.8.2-update (2.0) was installed on my MacBook Air, Dec  3 20:49:53 MacBookAirPatrick.local installd[914]: Installed "Aanvullende OS X 10.8.2-update" (2.0) My MacBook Air start to use all my bandwidth. The reason seems to be the

  • Unity 7.x Unified Exchange 2007

    customer deleted mailbox from exchange then recreated mailbox.  Is there a way to resync Unity so that recordings and personal settings for the user are not lost. Again  thx

  • How to turn of color management in epson r1800 driver 6.12

    I have an Epson R1800 with Epsons driver 6.12. What I wonder is how I turn off the color management in the driver, as I do that (color management) in Adobe Photoshop CS3 (when I choose to print). In the version 3 driver I was able to choose that in E