[b]Data Grid in jsp using Struts [/b]

I need to develop a data grid in JSP using struts .
I am using Tomcat web server , Intellij IDEA IDE.
If any one has code, please sent it.
Thanks in Advance.

hi,
Use Struts-Layout datagrid framework to full fill your needs
Related Topic link
here is the clear documentation for your topic
http://struts.application-servers.com/datagrid/index.html
here is the download link
(Struts-Layout datagrid framework)
http://deltha.uh.cu/java/docs/struts-layout-1.0-docs/download.html
related discuss
http://forum.java.sun.com/thread.jspa?threadID=5202989&messageID=9811082

Similar Messages

  • How to assign bean value to a local variable in JSP using struts.

    Hi everybody!
    I've a problem that puzzled me on how to assign a bean value to a local variable like String in JSP using struts.
    we can have someting like this to display the value
    <bean:write name="detailService" property="status" />or
    <bean:define id="theStatus" name="detailService" property="status"/>
         This is country: <%=theStatus%>but an error occured when I tried like this:
    String currentStatus = "<bean:define id="theStatus" name="detailService" property="status"/>";
    or
    String currentStatus = "<bean:write name="detailService" property="status" />";Is there a way to do this?.....
    Any help pretty much appreciated

    Java != JSP.
    The <bean:define> and <bean:write> tags are custom tags meant to appear in the HTML section of a JSP file, as opposed to the scriptlet section. They actually get turned into java code as part of the translation process.
    The <bean:write> tag naturally just writes out what you tell it to.
    The <bean:define> tag defines a local variable, and gives it a value.
    this should do it.
    <bean:define id="theStatus" name="detailService" property="status" type="java.lang.String"/>
    <%
      String currentStatus = theStatus;
    %>With the advent of JSTL, you shouldn't really need to use scriptlet code anymore. Personally I am for 0% scriptlet code in any jsp I write.

  • Displaying Hashmap values in JSP using struts taglib

    Please can any one provide me the solution for the below query,
    I have stored hasmap key as string and value as arraylist, can any one suggest how to display the hashmap values(arraylist) in table format in jsp using struts taglib.
                             HashMap hsMap=new HashMap();
                             ArrayList arrList = new ArrayList();
                             arrList.add("filesize");
                             arrList.add("filelength");
                              hsMap.put("filename",arrList);
               In jsp i want to display filename and filesize in table format.

    Read this documentation:
    http://struts.apache.org/struts-doc-1.2.x/userGuide/struts-logic.html#iterate

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

  • Display date in jsp. using struts, JSTL

    want to display today's date in format October 18, 2006
    how to get today's date and how to display it in jsp?
    I am using struts framwork and JSTL tags in my JSP.
    Thanks.

    rizza_99 wrote:
    The page underlines {<fmt:formatDate value="${now}" type="both" dateStyle="long" />} says
    attributte value doesn't accept any expressionsWait, you said "the page underlines"?? So you're using an IDE? Are you sure that it a JSTL problem and not an IDE problem? Ignore the IDE and just execute the code. Does it work without any compilation errors or runtime exceptions? If so, then there's a problem in the IDE.

  • Data Grid Control +JSP+Sorting

    Hi,
    Can any one help me regarding In JSP by using Data Grid Control to sort columns in table and displayed in same JSP.

    Yes! We can help! Do you have any other questions?
    Edited by: SoulTech2012 on Sep 20, 2008 11:51 AM

  • Data grid for jsp applications

    Someone knows where i can get a good data grid (free or cost ) for JSP applications

    I just stumbled across this thread as we are developing a stateless BSP application and plan to use model binding in it.
    For our application the part of the models state that changes is displayed in the view in form fields, so our idea is to reload the model from the db in the doInitattributes-Method and let the model binding do the rest of the work filling in the values that changed in the view. It seems to work so far - so i guess persisting the state of the object to the db is only necessary when something changed that is not part of the view, right?
    My second question is on Brians recommendation to use MVC only at exactly one level. Is using Sub-Controllers a problem when they have got their own model? I guess the extra work Brian mentions is all about telling the subcontrollers which model to load, right?
    It would be good to know if there are any serious pitfalls when using a hierarchy of controllers instead of a controller with a collection of views.
    Martin

  • 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>

  • Displaying  list of  items , in  a jsp , using STRUTS--Correct approach

    I have a requiremnet tht on click of a button , a list of items should be displayed on a jsp page , so tht a user can select items from tht list.
    But the problem is tht , the list is very large(Conatins 1500 record).
    So wht approach should i adopt.
    One approach is tht , i have a link on my main.jsp , where user has a link (addItems) , and on clicking this link , another page(Items.jsp), opens up , where i dispaly the list of users , and user here can select multiple items , and then those items will be shown in Main.jsp.
    Is this appraoch correct,
    also plz tell me how can i incorporate previous and next functionality , so tht 20 records per page are shown
    Can anyone tell me how 2 go abt it.
    I m using STRUTS , and weblogic.

    Hiiii
    When u want2 add textboxes dynamically,
    then declare ur proprerty in action form as of type String[]
    <form-bean
    name="userForm"
    type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="name" type="java.lang.String[]"/>
    <form-bean>
    When u add textboxes dynamically , and if the textboxes name is same as that in form bean,
    then automatically this form bean property gets populated.
    If u require further assistance do tell me

  • Approaches for Prepopulating dropdowns in Jsp using struts.

    Hi,
    I'm having a functionality working of pre-populating dropdowns using struts like:
    ArrayList list = getRoles(); //This method will return list of roles
    request.setAttribute("roles", list);
    By setting this collection in the request it will be availbel to <html:select and <html:options> tags for pre-populating. My question here is do we need to set the list (that is to be displayed in the JSP) in request scope deliberately, or there are other better approaches as well to do the same, like using expression language and accessing the method directly.
    Thanks,
    Prashant.

    Why dont you use ActionForm.
    declare a private variable
    //variable
    private List roles=null;
    //methods
    public List getRoles();
    public void setRoles(List roles);and in ActionClass
    ArrayList list = getRoles(); //This method will return list of roles
    form.setRoles(list);This collection object will be available in the jsp forwarded from that action in the scope specified in the struts-config.
    then use
    <html:select>
    <html:options collection="roles" labelProperty="name"     property="id" />
    </html:select>

  • Dynamic Textboxes in JSP using struts

    Hi all
    I'm using JSP and Struts framework. I have two buttons Add row and delete row.(not submit buttons) on click i need to either generate or delete a row of textboxes. I able to do the same using javascript but the tag in that case is <input..>(normal HTML) and not <html:text> tag of struts.. Can i use the struts tag in jsp?? I tried but err... So any suggestions?
    A sample code would be of great help.. Im still a beginner in this ocean of Java!
    cya

    If the add/delete row buttons run in javascript, then you have to use the standard <input> tags.
    The struts <html:text> tag is a JSP tag that just generates an <input> at the end of the day anyway (filling in the attributes automatically though)
    As long as you name the controls consistent with what would have been produced by the struts tag, it should work perfectly well.

  • 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.

  • Flex mobile app - which data grid control to use?

    Hi,
    Trying to build my first Flex mobile app in FlashBuilder 4.6 and I need a grid control to display a 2 dimmensional array of 6 columns x 50 rows.
    The user doesn't don't need to have any interraction with the grid except for scrolling the rows.
    I was looking at using dataGrid component but adobe doesn't recommend it for mobile apps.
    Is there a grid component that is recommended for mobile apps?
    Thanks

    Here it is.
    // Show empty grid to start
    private function initGrid():void
        const dataArray:Array = new Array(1);
        var values:Array = new Array(1);
        values[0] = "";
        dataArray[0] = values;
        grid.dataProvider = new ArrayCollection(dataArray);
    // Build array and feed it to the grid - 50 rows x 9 columns dataGrid (grid)
    protected function FillGrid():void
    var rows:int = 50;
    var columns:int = 9;
    // rows array
    const dataArray:Array = new Array(rows);
    // Get rows
    for(var row:int=0; row<rows; row++)
      const arrLine:Array = [columns+1];
      arrLine[0] = row+1;
      for(var col:int=1; col<columns+1; col++)
       // columns array
       arrLine[col] = Math.floor(Math.random()*10);
      dataArray[row] = arrLine;
    // At this point the multi dimensional array is assembled, now we connect it to the dataGrid
    grid.dataProvider = new ArrayCollection(dataArray);
    <!-- The DataGrid's dataProvider and typicalItem are set at initialize time by the initializeDataProvider method. -->
    <s:Panel id="tablePanel" x="519" top="91" width="470" height="400" color="#827259" fontSize="18" title=".">
    <s:DataGrid id="grid" left="5" right="5" top="5" bottom="5" selectionMode="singleRow" initialize="initGrid()" fontSize="17" >
      <!-- The default item renderer is used by the first 6 columns to display
      the dataProvider item's array element value at col. -->
      <s:itemRenderer>
       <fx:Component>
        <s:DefaultGridItemRenderer>
         <fx:Script>
          <![CDATA[
           override public function prepare(hasBeenRecycled:Boolean):void
            label = data[columnIndex];
          ]]>
         </fx:Script>
        </s:DefaultGridItemRenderer>
       </fx:Component>
      </s:itemRenderer>
      <s:columns>
       <s:ArrayList>
        <!-- Columns inherit the DataGrid's itemRenderer. -->
        <s:GridColumn id="zero"    headerText="N0" width="65" resizable="false"/>
        <s:GridColumn id="one"     headerText="N1" width="45" resizable="false"/>
        <s:GridColumn id="two"     headerText="N2" width="45" resizable="false"/>   
        <s:GridColumn id="three"   headerText="N3" width="45" resizable="false"/>   
        <s:GridColumn id="four"    headerText="N4" width="45" resizable="false"/>
        <s:GridColumn id="five"    headerText="N5" width="45" resizable="false"/>
        <s:GridColumn id="six"     headerText="N6" width="45" resizable="false"/>
        <s:GridColumn id="seven"   headerText="N7" width="45" resizable="false"/>
        <s:GridColumn id="eight"   headerText="N8" width="65" resizable="false"/>
       </s:ArrayList>
      </s:columns>
    </s:DataGrid>
    </s:Panel>       
    Tomexxus

  • Scrolling of data with UNSCROLLED header.using struts.Tried a lot my friend

    Got the class file fr.improve.struts.taglib.layout.util.FixedHeaderCollection which will be used to solve the problem.But how to use this in struts-layout.tld & in my application,where I am using layout:collection.

    I am also attaching the portion of that particular JSP page:
    [sample is just a style class]
    <table class="sample">
                        <th width="80">
                             Sl No.
                        </th>
                        <th width="233">
                             Code
                        </th>
                        <th width="150">
                             Name
                        </th>
         </table>     
         <div style="position: relative; left: 0px; overflow: auto; top: 0px; height: 170px; width: 100%; padding: 0em; ">
                        <table class="sample">
                             <logic:present name="searchMst" scope="session">
                                  <logic:iterate name="searchMst" id="searchMst" scope="session">
                                       <tr style="background-color:red;">
                                            <td width="80" height="10">
                                                 <bean:write name="searchMst" property="srlNo" />
                                            </td>
                                            <td width="233" height="10">
                                                 <bean:write name="searchMst" property="accCd" />
                                            </td>
                                            <td width="150" height="10">
                                                 <bean:write name="searchMst" property="accDesc" />
                                            </td>
                                       </tr>
                                  </logic:iterate>
                             </logic:present>
                        </table>
         </div>

  • Multi forms from different action in one jsp using struts?

    In user home page i am using 3 tabs in that 1 tab is for personal , 2 tab is for resume details etc.. but i crated for personal form1 and resumes for form2. when i click in the resume tab i have to show resumes list using same jsp. when click that tab it is showing Null pointer exception. How to solve please help.......

    Read the stacktrace. The 1st line points to the class/method/linenumber where this exception is caused. Lookup this line in your code and fix it accordingly. I.e. either make sure that the object reference in question is NOT null when it is been accessed/invoked, or add a nullcheck on this object reference (e.g. if (object != null) { object.doSomething();} ) so that you can skip the action when it is null.

Maybe you are looking for

  • Installing XP on Mac Pro

    I will be getting my Mac Pro this week. I have reviewed all posts re SATA fix and have slipstreamed an XP Serv P 2 disk with Intel chipset and SATA drivers. I plan to install XP on a separate disk. My question is as follows: is it necessary to use Bo

  • Snapshot from movie clip

    snapshot from movie clip in iPhoto

  • How to get a specific tag value from SAX parser

    I am using the SAX method to parse my xml file. My Question is how to get the returning characters parsed after calling? esp the value of <body> tag? Here is my xml file, and i want to get the parsed <body> value after call sax parser. <?xml version=

  • I have pages. Do I have to pay $20 to open the pages I "updated while king a doc?

    I have pages. Was ask if I wanted to update a doc. Said ok. Now doc can't be opened with pages. Do I have to pay $0 to work on my doc?

  • ERASING DUPLICATE PHOTOS FROM I PHOTO

    I WOUND UP WITH 3 COPIES OF EVERYTHING ON MY CAMERA WHEN I PLUGGED IT INTO MY MAC LAST NIGHT. IS THERE A WAY TO ERASE ALL DUPLICATES WITHOUT INDIVIDUALLY SELECTING EACH COPY? ANY HELP IS APPRECIATED. THANKS, FINN