File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Spring in Action this week in the Spring forum!
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
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
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.


Ping & DNS - my free Android networking tools app
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp project