• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet to JSP - Can't display the rows.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to display rows from my database from servlet by passing it to a JSP, but nothing is displayed.
I checked the syntax and even the source of the page shows that it gets the data but the rows are not displayed!
My servlet (serv.jsp)


My JSP (SP.jsp)


searchResult.java:

My servlet file is in the Pack1 package under Source Packages and jsp file is under Web Pages.
Please help me debug my program, any help would be greatly appreciated!
Thank you!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you done a View Source at the browser to see what's being generated?

If so, is it valid HTML?
 
Jaco Smith
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Have you done a View Source at the browser to see what's being generated?

If so, is it valid HTML?



Yes, I've also check that, here is the view source code page:


After the I enter a word in the textbox and click "search", it retrieves the data correctly - because we can see the address of the searchResult objects right?
So, why is it not being displayed?..
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume that you have jstl library. If not. You can download it from https://coderanch.com/how-to/java/JstlTagLibDefinitions. Choose your version(JSTL 1.2 I guess).
And JP.jsp don't have taglib
Add this line of code to beginning into JP.jsp
For version JSTL 1.1 or 1.2


With version JSTL 1.0


Then It's maybe gonna work
 
Jaco Smith
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hai nd wrote:I assume that you have jstl library. If not. You can download it from https://coderanch.com/how-to/java/JstlTagLibDefinitions. Choose your version(JSTL 1.2 I guess).
And JP.jsp don't have taglib
Add this line of code to beginning into JP.jsp
For version JSTL 1.1 or 1.2


With version JSTL 1.0


Then It's maybe gonna work



Thank you for your reply!
I downloaded it and added it to my libraries, but now I am getting another error..


I have a class names searchResult.java in my Pack1 folder - it is just a class to create objects to make storing the data easier..
Should I add it as a Java servlet class? full code of searchResult is:

 
hai nd
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
Have you tried create getter for searchResult class or make data field public.
If getter, then change ${m.URL} -> ${m.getUrl()}
 
Jaco Smith
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hai nd wrote:Have you tried create getter for searchResult class or make data field public.
If getter, then change ${m.URL} -> ${m.getUrl()}



Made a few other modification along with that getter idea of yours and it works!
Thanks! ;)
 
reply
    Bookmark Topic Watch Topic
  • New Topic