• 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

JSTL, JDBC, and Result Set

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I stored DB results in a HASHMAP and then ARRAYLIST, but it displayed my results in an order that wasn't the way I needed it.

I've been trying to store my results in an ArrayList, but for some reason, the JSP page using JSTL just displays a blank page. No results, no nothing.

Here is where I store my Array List



and here is the main display part of the JSTL page.


I'm confused as to why I can use a HashMap and ArrayList and get results to display but when I try to just use an ArrayList to store, nothing is displayed at all.
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
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
I added code tags to your post -- it makes a huge difference in the readability of your code as you can see. Please read this for more info.
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
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

nothing is displayed at all.



As in empty page, or empty table?

If the former, an error may be preventing the response from being sent.

Check your logs. And what's with the spurious ${item} in your JSP?
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see any code that binds your ArrayList to scope (request, session, etc..).
Where are you doing that?
 
william gates
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's an empty blank page.

Here is part of my servlet code.



But for whatever reason, it forwards me to a blank queryResults.jsp page.

However when I use a hashmap in the DBcode, like the code listed below, I do get results back. Albiet they aren't displayed in the order I wish them to be.





As far as logs, I don't have access to them on websphere 6.0. I run jython scripts to either update, delete or install my web application and from there I can't even read the folder on the server.. That is locked down by the server admins.
[ April 20, 2007: Message edited by: william gates ]
 
Bear Bibeault
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

Originally posted by william gates:
That is locked down by the server admins.



Don't know what to tell you. The blank page is indicative of an exception that is preventing the response from being sent. Without access to the logs, you're flying blind.

Can you not set up a local server for testing?
 
william gates
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tested on my local system using Apache Tomcat 5 before deploying to the Websphere 6.0 development server box. But there were many issues related with new server admins, scripts, db connections, memory allocation, user accounts and so on that made it a waste to continue testing on the local Tomcat web server.

I'll try to test on Tomcat to see if I can see what's going wrong, but i'm sort of flying blind right now on the Websphere 6.0 side. The server admins have been helpful enough over the past few weeks, even though they are new to Websphere. The problem now is the two server admins are gone until May. One is in training and the other on vacation. So I can't even ask them to see if they can send me error logs.

thanks for your help.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not difficult to write a servlet that reads log files and streams them to the browser.

If I were working in such absurd conditions, I wouldn't write a line of anything else until I was done building one.
 
william gates
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.. I'll have to do that..

It's all for security reasons, which I understand. Doesn't make it easier, but it sort of makes sense. They've had one too many "missing laptop" problems and hence, a new IT Security Kingpin with all new rules, regulations and policies.

Besides that, I'm a contractor and I've had to go through many user rights, privledges, and admin issues over the past few months due to me being a non-employee. Sometimes I can't connect to a certain database until I get approved and that might take a week or two.

That's all besides the point though. I'll have to write a servlet to find out what is going wrong.

thanks,
 
william gates
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sort of related to original topic..

I decided to store the DB data in a bean.. Not sure if I'm doing it right or not and definitely not sure if I set up JSTL correctly. I'm new to JSTL so not sure how it all works together at times. I get my page to display, but I don't get any results back.. Just my Table Headers(which I hardcoded in the table and no data.

Here is the JSP results page with JSTL :



Here is how I store the Java Bean.




And here is the part of my servlet




[ April 20, 2007: Message edited by: william gates ]
[ April 20, 2007: Message edited by: william gates ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic