aspose file tools*
The moose likes JSP and the fly likes Creating a table in a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Creating a table in a JSP" Watch "Creating a table in a JSP" New topic
Author

Creating a table in a JSP

Gary Dwivdi
Greenhorn

Joined: Sep 12, 2011
Posts: 9
Hi Guys,
I'm trying to learn JSp and servlets...need your help for that ...
I have an XML and i'm parsing that XML to get the value of some tags,I need to display the value of these tags in a JSP page,in a form of a table.
i have already written a java class which parses he XML .I'm stuck in intergrating that piece of code in JSP.
Any help appreciated.
Thanks in Advance.





Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

please share the XML data format which may lead to help you in detail.
Gary Dwivdi
Greenhorn

Joined: Sep 12, 2011
Posts: 9
The XML data comes as a String ...
Say XML has a tag<name>XYZ</name>
So i'm parsing the XML and getting the value as:String name=XYZ,Now this XYZ value. i need to display in JSP ..How do i do that ???
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39844
    
  28
Have you seen our JSP FAQ? Have you tried Googling for something like JSP tutorial?
Gary Dwivdi
Greenhorn

Joined: Sep 12, 2011
Posts: 9
I tried both of these Links and gone through some of the tutorials but i could not figure out how do i integrate my class file to the JSP .
I know its quite Dumb of me to ask such basic questions,But could not help it as i have just started to learn JSP's and all.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

I always recommend that novices to JSP read the following articles:
  • The Secret Life of JSPs
  • The Front Man

  • The combination addresses the concepts you need to address your issue.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61654
        
      67

    And be sure that any tutorials or other learning materials that you use are modern and up-to-date, focusing on the use of the JSTL and EL and not Java scriptlets (which have been discredited for almost a decade now).
    Gary Dwivdi
    Greenhorn

    Joined: Sep 12, 2011
    Posts: 9
    Hi All,
    Thanks a ton for your valuable suggestions.I finally succeeded in making the JSP and servlets.and now I'm trying a hands on on JSTL.
    Can any one please share some pointers to a descriptive documentation of the same or help me figuring out how to get the size of a data list using JSTL.
    My code looks something like:
    <c:forEach var="data" items="${requestScope.dataList}" >
    <tr>
    <td><cut value="${data.date}" /></td>
    <td><cut value="${data.mobileNumber}" /></td>
    <td><cut value="${data.msg}" /></td>

    </tr>
    </c:forEach>

    and I tried using <c:if test="${empty myObject.dataList}"> but I'm not able to get any output after putting this line of code.
    Can any one please let me know where am I going wrong?
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61654
        
      67

    We'll need more info that n you are giving us. For example, what are the values of the scoped variables?

    Also, please be sure to disable smilies when posting JSP code.
     
    Consider Paul's rocket mass heater.
     
    subject: Creating a table in a JSP