aspose file tools
The moose likes Servlets and the fly likes Parsing servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Parsing servlet" Watch "Parsing servlet" New topic
Author

Parsing servlet

Jay X Brown
Ranch Hand

Joined: Jan 26, 2001
Posts: 51
i'm trying to write a servlet that parses an xml file and then hits the database.
do i extend HTTPServlet or HandlerBase?
i feel i should know this by now. don't know why i'm confused.
thanks in advance for the help.
jb
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6913
Your servlet should extend HTTPServlet, and I recommend that you create one or more support classes to do your XML parsing and database access. Your parser class(es) can then extend HandlerBase.
In my experience one of the most common mistakes with using servlets is to assume that all the code must be written "inside" the servlet. A servlet is just a java class, and should be made no bigger than it needs to be to handle and process HTTP requests and parameters, and dispatch to appropriate processing in other classes.


A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
Jay X Brown
Ranch Hand

Joined: Jan 26, 2001
Posts: 51
Thank you very much, Frank.
That was my hunch as well but I was not sure.
JB
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Parsing servlet
 
Similar Threads
Problems with jsp:include
centralized/reusable servlet inside portlet
testing servlet thread safety
what are the steps to run my first servlet by JBoss
help me in writing a unit test case for the given servlet