It seems that Ant won't let me compile this file since it appears to be laden with errors. What this servlet does is that it prompts for a search term provided by the user in order to search within an RSS feed for headlines that contain the search term, and write them out in HTML. The error that I keep getting is "illegal start of expression" in the startElement method. Can someone please see if the syntax is correct as well as point out the mistakes that I have made? Thanks.
[ November 18, 2004: Message edited by: Diego Tori ] [ November 18, 2004: Message edited by: Diego Tori ]
You code seems to involve a lot of stuff. Generally, its a good ide to seperate stuff and not put too much into one file. Here you have servlet code that seems to output HTML, which is good. But your attempt to stuff it with XML Parsing makes the code rather ugly and difficult to follow / debug.
If you agree that its difficult to debug, I would suggest that you seperate the parsing from the servlet code. Generally this is done inside a Java Bean class of some kind.
Also if you could tell us how familiar you are with Servlets / XML parsing, it would help us to point you in the right direction with some links. Consider that and then lets see where we go... regds.
Joined: Nov 18, 2004
OK, it seems that I put a method in a method, and that's why it was laden with errors. I made some necessary changes to the code, but it's still throwing me some errors, possibly a syntax error. I just started learning how to write servlets a month ago, thus my knowledge is limited. How would I successfully integrate these classes into one servlet, a.k.a., the standard skeletal syntax for a servlet of this nature.
Here's some updated code:
[ November 19, 2004: Message edited by: Diego Tori ]