Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

how to display mysql table datas in jsp using struts2

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i have made this code for getting the values present in my users table and display those values in a jsp using struts2.

My java code:




and my jsp code:



But when i run this code, i'm getting all the users values in 1x1 cell and all passwords values in 1x2 cell...
I want each users value and passwords value in a single row as a pair...
What must i do??? Pl help....
Thanks in advance!
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts2 having inbuilt mechanism to display the content if you want to customize it Use simple theme and customize it how to want it to display.

Struts2 Themes
 
Vasanth Rajasekaran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mohan Rao for your help...
Since I'm a beginner in Struts2 and also since i havn't worked in Struts1 I can't able to understand neither what you are telling nor the link you posted..
If you don't mind can I hav a sample code of tat Struts2 themes what you are mentioning???

Thank you!
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My above answer is not relevant to your query. I think you are expecting this.



 
Vasanth Rajasekaran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But Mohan Rao, the code you gave is same as the code i used...
I'm getting the same output as I got before...
I need output of Users in one column and their corresponding passwords in next column...
Can you help me in how to achieve that???
Thanks!
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer to the below link

http://www.vaannila.com/struts-2/struts-2-example/struts-2-control-tags-example1.html

HTH
 
Vasanth Rajasekaran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you vishwas gopala...

Now it got worked...!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
you could do it by using the keyword "status" in the iterator tag..
in your example you could do like...
<table><s:iterator status="indice">
<tr><td>
<s:property value="username[#indice.index]"/></td>
<td>
<s:property value="password[#indice.index]"/></td>
<td>
</tr></s:iterator></table>
 
reply
    Bookmark Topic Watch Topic
  • New Topic