Grid defining in jsp

i have to make a grid of 50 * 50 ....and the cells should be defined in such a manner that i can call them individually (something like
[j]).
I dont know if i can use arrays to form the grid and output it in the form of a table.
Please suggest.

Try to use a two dimension array:
private String[][] strArray;
strArray = new String[50][50];
Loop through the array to form a table.
Kev.
http://www.powerobj.com/JSPGridPro

Similar Messages

  • Grid Control in JSP

    Support me, to create Grid Control through jsp coding
    should able to add, delete, update the rows in grid and also if possible change the colors.

    i am create one grid contro in jsp.
    grid control features dynamic edit,add records.
    so plz help me in your ideas sent my mail id
    [email protected]

  • Grid Format in JSP

    I just wanted to know whether any Grid form is available in JSP to display the result from the database as we do in VB.

    This is the code for database grid control
    <PRE lang=jsp id=pre2 style="MARGIN-TOP: 0px" nd="109"><%@ taglib uri="/WEB-INF/tags/datagrid.tld" prefix="grd" %>
    <%@ page import="java.sql.Connection" %>
    <%@ page import="java.sql.DriverManager" %>
    <%@ page import="java.sql.SQLException" %>
    <%@ page import="com.freeware.gridtag.*" %>
    <%
    int intCurr = 1;
    int intSortOrd = 0;
    String strTmp = null;
    String strSQL = null;
    String strSortCol = null;
    String strSortOrd = "ASC";
    boolean blnSortAsc = true;
    strSQL = "SELECT CLICORPORATION, CLICLIENT, CLIDESCRIPTION, " +
             "CLIENABLED, CLIUPDSTAMP FROM CLIENTMASTER ";
    Connection objCnn    = null;
    Class      objDrvCls = null;
    objDrvCls = Class.forName("oracle.jdbc.driver.OracleDriver");
    objCnn = DriverManager.getConnection("<A class=iAs style="FONT-WEIGHT: normal; FONT-SIZE: 100%; PADDING-BOTTOM: 1px; COLOR: darkgreen; BORDER-BOTTOM: darkgreen 0.07em solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" href="#" target=_blank itxtdid="3346226">jdbc</A>:oracle:thin:@Host:port:sid",
                                         "cashincpri", "cashincpri");
    if (objDrvCls != null) objDrvCls = null;
    strTmp = request.getParameter("txtCurr");
    try
      if (strTmp != null)
      intCurr = Integer.parseInt(strTmp);
    catch (NumberFormatException NFEx)
    strSortCol = request.getParameter("txtSortCol");
    strSortOrd = request.getParameter("txtSortAsc");
    if (strSortCol == null) strSortCol = "CLICLIENT";
    if (strSortOrd == null) strSortOrd = "ASC";
    blnSortAsc = (strSortOrd.equals("ASC"));
    %>
    <html>
    <head>
    <title>Grid Tag Demonstration</title>
    <link REL="StyleSheet" HREF="css/GridStyle.css">
    <script LANGUAGE="javascript">
    function doNavigate(pstrWhere, pintTot)
      var strTmp;
      var intPg;
      strTmp = document.frmMain.txtCurr.value;
      intPg = parseInt(strTmp);
      if (isNaN(intPg)) intPg = 1;
      if ((pstrWhere == 'F' || pstrWhere == 'P') && intPg == 1)
        alert("You are already viewing first page!");
        return;
      else if ((pstrWhere == 'N' || pstrWhere == 'L') && intPg == pintTot)
        alert("You are already viewing last page!");
        return;
      if (pstrWhere == 'F')
        intPg = 1;
      else if (pstrWhere == 'P')
        intPg = intPg - 1;
      else if (pstrWhere == 'N')
        intPg = intPg + 1;
      else if (pstrWhere == 'L')
        intPg = pintTot;
      if (intPg < 1) intPg = 1;
      if (intPg > pintTot) intPg = pintTot;
      document.frmMain.txtCurr.value = intPg;
      document.frmMain.submit();
    function doSort(pstrFld, pstrOrd)
      document.frmMain.txtSortCol.value = pstrFld;
      document.frmMain.txtSortAsc.value = pstrOrd;
      document.frmMain.submit();
    </script>
    </head>
    <body>
    <h2>Grid Example</h2>
    <form NAME="frmMain" METHOD="post">
    <grd:dbgrid id="tblStat" name="tblStat" width="100" pageSize="10"
        currentPage="<%=intCurr%>" border="0" cellSpacing="1" cellPadding="2"
        dataMember="<%=strSQL%>" dataSource="<%=objCnn%>" cssClass="gridTable">
    <grd:gridpager imgFirst="images/First.gif" imgPrevious="images/Previous.gif"
          imgNext="images/Next.gif" imgLast="images/Last.gif"/>
    <grd:gridsorter sortColumn="<%=strSortCol%>" sortAscending="<%=blnSortAsc%>"/>
    <grd:rownumcolumn headerText="#" width="5" HAlign="right"/>
    <grd:imagecolumn headerText="" width="5" HAlign="center"
          imageSrc="images/Edit.gif"
          linkUrl="javascript:doEdit('{CLICORPORATION}', '{CLICLIENT}')"
          imageBorder="0" imageWidth="16" imageHeight="16"
          alterText="Click to edit"/>
    <grd:textcolumn dataField="CLICLIENT" headerText="Client"
          width="10" sortable="true"/>
    <grd:textcolumn dataField="CLIDESCRIPTION" headerText="Description"
          width="50" sortable="true"/>
    <grd:decodecolumn dataField="CLIENABLED" headerText="Enabled" width="10"
          decodeValues="Y,N" displayValues="Yes,No" valueSeperator=","/>
    <grd:datecolumn dataField="CLIUPDSTAMP" headerText="Last Updated"
          dataFormat="dd/MM/yyyy HH:mm:ss" width="20"/>
    </grd:dbgrid>
    <input TYPE="hidden" NAME="txtCurr" VALUE="<%=intCurr%>">
    <input TYPE="hidden" NAME="txtSortCol" VALUE="<%=strSortCol%>">
    <input TYPE="hidden" NAME="txtSortAsc" VALUE="<%=strSortOrd%>">
    </form>
    </body>
    </html>
    <%
    try
        if (objCnn != null)
            objCnn.close();
    catch (SQLException SQLExIgnore)
    if (objCnn != null) objCnn = null;
    %>
    </PRE>

  • Variables defined in JSP include files.

    hi..
    i was wondering how to access the variable defined in a JSP include file from the page where it is included.

    If you are thinking of scriptlets, then you would do it in the same manner that you would access variables local to your jsp. A word of caution - jsp pre-compilation may not work.
    A neater solution would be store it as an attribute in 'page' scope.
    cheers,
    ram.

  • How do i place a grid into my JSP page

    Hi All
    I have a requirement to place the result set from a query to be placed into a grid like structure onto my JSP page, If anyone has done such a thing please help me with this, a good code sample would be better.
    Thanks
    Swaraj

    A very basic one assuming the resultset rs is already populated....
    <table border=1>
    <%
    while(rs.next())
    %>
    <tr>
    <td><%=rs.getString(1)%></td>
    <td><%=rs.getString(2)%></td>
    </tr>
    <%
    %>
    </table>

  • Displaying Netui RadioButtonGroup in grid layout in JSP

    Hi All,
    I am trying to display a hashmap as NETUI radiobuttongroup in jsp in a matrix format as below.
    Say map contains 10 elements then it should display as.
    1 2 3
    4 5 6
    7 8 9
    10
    I am not able to get it through. Any help is appreaciated.
    -Ami

    No, there is nothing that you can do.  The hierarchial list is presented in that view only. 
    Regards,
    Rich Heilman

  • How to call a function defined in a JSP file into a servlet?

    Hi
    I have defined a JSP file with some functions in it. I am including this JSP file into other JSP files so that these functions can be used. Now is there soe way, that I can include this file in a servlet as well and use the defined functions in the servlet as well.
    Thanks and Regards
    Vikram

    I assume you have a function with OUT arguments because you need to return at least two distinct things from this function? The functions return value and this OUT argument, too. Right? For the sake of argument, let's say that you're trying to return a VARCHAR2 value and a NUMBER value from this function.
    Assuming that you cannot just wrap your existing function with a function that does not have OUT arguments, the first idea that pops to mind is to create an Oracle8 type that looks like:
    CREATE TYPE MYREC AS OBJECT (V VARCHAR2(80), N NUMBER);Then you could rewrite your function to return an instance of this MYREC type instead of having one return value and one OUT parameter.
    Then create a BC4J domain for this Oracle8 type (which will mimic its nested structure), and then you can just select the value straight-away in your view object.
    I just tried this idea with 9.0.2 production and it works.
    The Domain you create will have getV() and getN() accessors on it so you can get at the nested values in the MyRec domain "record" structure.
    The other way would involve building a programmatic view object that sources the data for your VO programmatically. If I think of anything else I'll post something here.

  • CS5. Deleting a user-defined preset Perspective Grid Preset???

    CS5
    Mac10.5.8
    I want to delete a user-defined preset Perspective Grid Preset.
    How can I do this?
    http://help.adobe.com/en_US/illustrator/cs/using/WSb8134070d1ccd4cc-123066e6124d7ca3149-80 00.html
    • Where do I hit Delete in the Perspective Grid Preset Options dialog box?
    • There is no Delete option in the Grid Preset Options dialog box.
    • Simply selecting my custom Grid and then hitting Delete on my keyboard does not work either.
    What am I missing?
    Please advise.
    Thank you in advance.
    Kathryn

    Yippee! It worked.
    I was looking at View>Perspective Grid>Define Grid dialog box
    I am just getting my feet with CS5 and its new features.
    A big thank you, Michael and Mylenium.
    Kathryn

  • Data Grid on JSP Application...

    Someone knows where i can get a good data grid (free) for JSP applications.
    tanks
    Daniel S.

    yes there is, almost anything is possible in a web application so probably a data grid too.
    Might be nice idea to first give information about what you udnerstand under a datagrid before asking information on it.

  • Data Grid in JSP

    Hi guys
    I need to create a Data Grid on a JSP. It has to display data retrieved from database. I should be able to select a row and delete it from database.. I think I can manage the database stuff... But how dow I create the grid?
    Any suggestion? Links?
    Do help!
    Thanx a ton!

    Let your backend return a list of data.
    Put the list on the request (request.setAttribute...).
    Use jstl tag like
    <c:forEach items="${myList}" var="myRow">
    <c:out value="${myRow.firstname}"/>
    <c:out value="${myRow.lastname}"/>
    </c:forEach>

  • How To Retrieve an Object's Value Defined Using c:set ... Tag?

    I have the value of a variable defined in JSP#1 (JSP#1 is not a form) using JSTL tag:
       <c:set var="id" value="${articleForm.article}" scope="session"/>Now, I have an object 'id' in the session scope. The object 'id' and all the information, which are defined in JSP#1, are forwarded to JSP#2.
    JSP#2 is a form. But, the 'id' is not used in JSP#2.
    JSP#2 has a submit button and then, a servlet takes over the control after that button is clicked. All the text fields in JSP#2 together with the object 'id' are forwarded to this servlet.
    I have two questions:
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)
        int articleID = Integer.parseInt( session.getAttribute( "id" ) );   or, it should be retrieved in another way?

    I'm not sure you understand the concept of a session object.
    Java objects stay on the server. There is no transmission between the web browser and the client.
    The scope just sets how long the server "remembers" that variable.
    request scope - only lasts one request. Once a web page is returned to the client, the server forgets all request variables.
    session scope - lasts for one user - across multiple requests/web pages.
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.From your description, you appear to have it right - your object should be in session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)If articleForm.article is an String then that looks the right way to access it.
    You might have to do it like this:
    int articleID = Integer.parseInt( (String)session.getAttribute("id"));
    The Integer.parseInt method takes a String as a parameter - while session.getAttribute() returns an Object.
    This code will work if the object stored in the session is a String.
    The object stored in the session is ${articleForm.article} What type does articletForm.getArticle() return? That is the type you need to cast it to when retrieving it from the session.
    Cheers,
    evnafets

  • How do I setup in wls 6.1 a jsp file that has a different extension (not *.jsp)

    I have a jsp file with extension *.abc. The browser is showing the files as text instead of sending it to be processed as a jsp file.
              I have the following settings in the web.xml but it is not picking it up.
              <servlet-mapping>
              <servlet-name>
              jsp
              </servlet-name>
              <url-pattern>
              *.abc
              </url-pattern>
              </servlet-mapping>     
              

    This is kind of a hack and not officially supported, but you might try...
              <servlet>
              <servlet-name>ABC</servlet-name>
              <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
              <init-param>
              <param-name>compileCommand</param-name>
              <param-value>javac</param-value>
              </init-param>
              <init-param>
              <param-name>workingDir</param-name>
              <param-value>WEB-INF/classes</param-value>
              </init-param>
              </servlet>
              Since this isn't the default JSPServlet registration, it doesn't pick up the
              default JSPServlet init arguments, so after some experimentation I figured
              out that you have to at least define these two. Others that you may want to
              configure are...
              defaultFileName
              compileCommand
              compilerClass
              compileFlags
              workingDir
              verbose
              keepgenerated
              precompileContinue
              pageCheckSeconds
              encoding
              packagePrefix
              superclass
              noTryBlocks
              compilerSupportsEncoding
              These are all defined as jsp-descriptor args in the weblogic.xml file, but
              you can equally use them as servlet-args for your custom JSP registration
              Good luck,
              Alex
              P.S.
              Why don't you want to use jsp files anyway?
              "shelley otero" <[email protected]> wrote in message
              news:[email protected]...
              > I have a jsp file with extension *.abc. The browser is showing the files
              as text instead of sending it to be processed as a jsp file.
              >
              > I have the following settings in the web.xml but it is not picking it up.
              >
              > <servlet-mapping>
              > <servlet-name>
              > jsp
              > </servlet-name>
              > <url-pattern>
              > *.abc
              > </url-pattern>
              > </servlet-mapping>
              >
              

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • Ergent problem with the jsp file access in tomcat. HELP...

    I use tomcat as my server, I have one JSP file located in :
    webapps\abc\war\WEB-INF\jsp\index.jsp
    You see my project name is abc, I want to access the index.jsp file, I define another jsp file in the path: webapps\abc callled outside.jsp. I want to use outside.jsp to invoke the index.jsp.
    Inside outside.jsp it is :
    <html>
    <head>
    <title>index</title>
    </head>
    <body>
    <%@ include file="war/WEB-INF/jsp/index.jsp" %/>
    </body>
    </html>
    When I open the browser, and access, http://localhost:8080/abc/outside.jsp , the content of index.jsp was shown as expect. But, all the link pages of the index.jsp can not shown (PS: the link pages is located in the same path as index.jsp, they are all jsp files). I guess the problem may be that the <%@ include file="war/WEB-INF/jsp/index.jsp" %/> inside outside.jsp include the index.jsp as a static file. Is there any method to make all the link pages of index.jsp can be shown when call from outside.jsp???HELP
    Message was edited by:
    Mellon
    Message was edited by:
    Mellon

    I don't know why your links can't be shown, but I can tell you that your suspect:
    I guess the problem may be that the <%@ include file="war/WEB-INF/jsp/index.jsp" %/> inside outside.jsp include the index.jsp as a static file.is wrong, because included jsp is dynamic, not static.

  • New to JSP-How to run a .jsp file

    I Have just begin to learn JSP. I downloaded the JSP developer kit from java.sun.com. However I dont know how to proceed. I have seen references to'the container'. what is it and how do I start it? and the same for the server which I have in the form a batch file. How do I configure the environment? Are there any prerequisites to using this kit wrt software? Please do help me, since I am absolutely clueless
    Regards,
    Sweta

    Hi Sweta,
    Please use any editor like eclipse or netbeans or you create one jsp page(assumes you know jsp).
    and then create two folders web-inf inside which create classes and lib folder and web.xml is created, and meta-inf inside which context.xml is created. And use tomcat container to deploy.
    Apache tomcat is container which would receive the client request from browser that will route to servlet/jsp.
    whereas Apache webserver is different it provides the request to container if it exists then we can replace localhost:8080 by user defined.
    JSP is nothing but Dynamic web page creator which embed java program in html.
    JSPinit initializes and while running converts to servlet and will be processed according to the java code embed and display as per the html tags.
    But you should use struts framework why it is constructed upon MVC architecture and purely object oriented.
    So struts is nothing but the execution calls are drived by configuration xml files.
    If anything you need to know in details, pls msg me to [email protected]
    Thanking you
    Charles v c

Maybe you are looking for