jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes jsp project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp project" Watch "jsp project" New topic
Author

jsp project

ritesh srivastav
Greenhorn

Joined: Nov 30, 2012
Posts: 8
i want to to create a jsp page where it count the user hits and save in database.......i hve tried to write tht code but its nt work.

Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
While you didn't say how it's not working (what is it supposed to do, and what does it do instead, and what have you done so far to debug the issue), a few things jump out.

#1 - You absolutely, positively should not declare Java classes in JSPs. Put those classes into WEB-INF/classes where they belong.

#2 - All DB code that does anything seems to be commented out. The code tags I added to your post make that easy to see (please UseCodeTags in the future when you post code of any length).

#3 - What's with the threads? Should the DB operations not be carried out out right away? But regardless of what it is supposed to do, it almost certainly won't work the way you hope it will work; best to get rid of all that.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

There's a lot more to criticize in that code. I would suggest you extract it from that JSP -- where as already said, it doesn't belong -- and post it in one of the Java forums. I would just start by pointing out this:



Don't do that. When exceptions are thrown, you won't know about them and you will just have unexplained behaviour.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: jsp project
 
It's not a secret anymore!