Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to group data specific field wise?
    primarykey
    data
    text
    <p>I am getting data from database for specific category. Suppose I select or pass data to query that category is Laptop then it give me data of all attribute and it's value. Like :</p> <p><img src="https://i.stack.imgur.com/8EgcQ.png" alt="enter image description here"></p> <p>My Code to getting and display data on JSP page is :</p> <pre><code>&lt;% List&lt;String&gt; attribNameList = (List&lt;String&gt;)request.getAttribute("attribName"); List&lt;String&gt; attribValueList = (List&lt;String&gt;)request.getAttribute("attribValue"); List&lt;String&gt; attribDataList = (List&lt;String&gt;)request.getAttribute("attribData"); String aname,aval,adata; for(int i = 0 ; i&lt;attribValueList.size() ; i++) { aname = attribNameList.get(i); aval = attribValueList.get(i); adata = attribDataList.get(i); %&gt; &lt;a&gt;&lt;%=i%&gt;&lt;%= aname %&gt;&lt;/a&gt; &amp;nbsp; &lt;a&gt;&lt;%= aval %&gt;&lt;/a&gt; &amp;nbsp; &lt;% if(adata == null) { } else { %&gt; &lt;a&gt;&lt;%= adata %&gt;&lt;/a&gt; &lt;% } %&gt; &lt;br&gt; &lt;% } %&gt; </code></pre> <p>Here <code>aname</code> display attribute name i.e. <code>RAM, Processor, etc.</code></p> <p><code>aval</code> display value i.e. <code>4, 2.8, etc.</code></p> <p>and <code>adata</code> display last data i.e. <code>GB, GHz, MP, etc.</code></p> <p>Now I want to display data as category wise like all memory attribute will display first. Like :</p> <pre><code>RAM 4 GB HDD 1 TB Cache 3 MB, etc. </code></pre> <p>How can I display data in such format ? I have tried using <code>if condition</code> where <code>adata</code> variable checked with</p> <pre><code>if(adata.equals("GB")||adata.equals("TB")||adata.equals("MB")) { //memory category data display } else { //Other data } </code></pre> <p>but it isn't working.</p> <p>Any Suggestion Please...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload