• 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
  • Paul Clapham
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Peter Rooke
  • Mikalai Zaikin
Bartenders:
  • Himai Minh

how to display data from database on jsp using struts2

 
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is My class where database connection and other databasequery gets executed....


this is my action class............for student










next is ma jsp page where i want to display d data .....



i m not getting any error but nuthing is getting displayed on my jsp page.....

hey can anybody please help me out with this problem.


Thanks in advance

priyanka jaiswal.

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added code tags to your post to make it easier to read. Please UseCodeTags in the future.
I see your JSP references an action property named "list" but you don't have a method to get the list from your action class.
Your action class is confusing as it appears to be both a data object (containing attributes for each student instance) and an action method (execute).
 
priyanka jaiswal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for respose...
yes i have written action method in same class....bt when i created a diffrent actionclass there wasnt ny diffrence..the result was same....

actully i am very new to the technology not even worked on sturts1 ..so didnt have any idea....
and about the list ...i am not getting..where shuld i create a method nw.i reffered many examples.it was same as it is....jst can you help me out where i am getting wrong.
Really stucked with particular part of code ...

Thanks
priyanka jaiswal
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you new to Java as well (it looks like it)? You should start off with the Java Tutorial. It will be very difficult to write a web application in Java without understanding the basics of the language.
If you are new to web programming, you should read over the Struts Key Technologies. Again, without a basic understanding what is going underneath the covers, you will very easily lose your way.
After getting a good foundation, try reading through the pointers on our Struts 2 FAQ. There are many good tutorials and references available for Struts 2. We would love to help you, but if you haven't completed Step 1 and want to jump to Step 10, you will be setting yourself up for a lot of frustration and failure.
NOTE: Struts 2 has little to do with Struts 1, so it is not necessary to know one before learning the other.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic