Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a table in a JSP  RSS feed

 
Gary Dwivdi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please share the XML data format which may lead to help you in detail.
 
Gary Dwivdi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55324
157
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you seen our JSP FAQ? Have you tried Googling for something like JSP tutorial?
 
Gary Dwivdi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 66141
    141
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 9
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 66141
    141
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!