Yes, the form is pretty much identical to that. What I'm writing is a
form of metasearch. My form takes in a query and sends the query to
appropriate engine.
It does'nt give a 404 or 500, it just returns a blank page. With a one
word query it returns the correct page.
If I get the query using the above and then use
out.println(query) ............it will print the correct query, so I
figure its no passing the value(if its a multiple word query) from the
servlet to the search engine.
> Yes, the form is pretty much identical to that. What I'm writing is a
> form of metasearch. My form takes in a query and sends the query to
[quoted text clipped - 5 lines]
> figure its no passing the value(if its a multiple word query) from the
> servlet to the search engine.
It could also be that you need to escape multi-word queries. Its hard
to tell without knowing your search index.
"Damo" <cormacdebarra@gmail.com> said:
>Yes, the form is pretty much identical to that. What I'm writing is a
>form of metasearch. My form takes in a query and sends the query to
[quoted text clipped - 5 lines]
>figure its no passing the value(if its a multiple word query) from the
>servlet to the search engine.
Hmm, this isn't nice. You're changing your problem description.
At first you let us know that information is not getting passed to the
servlet. Now you're telling that you can see the information in the
servlet. So, the form part of the question is irrelevant; the issue
is what does your servlet do to the string it received - how it is
passed on, and what kind of interface there is to the search side.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
Daniel Pitts - 04 Jan 2007 17:49 GMT
> "Damo" <cormacdebarra@gmail.com> said:
> >Yes, the form is pretty much identical to that. What I'm writing is a
[quoted text clipped - 14 lines]
> is what does your servlet do to the string it received - how it is
> passed on, and what kind of interface there is to the search side.
Yeah, It could be that he worked out that it wasn't the problem he
thought it was, and instead was a different problem.
I'm assuming since he hasn't posted a question since then (which he
hasn't), he's figured out the rest on his own.
Damo - 04 Jan 2007 20:07 GMT
I was away for the last day.
I've discovered its nothing to do it passing long Strings(Sorry!). The
right query is forwarded. Whats causing the problem is a
ParserConfigurationException. I dont know why this would happen though,
it only appears with multiple word queries.
Daniel Pitts - 04 Jan 2007 20:15 GMT
> I was away for the last day.
> I've discovered its nothing to do it passing long Strings(Sorry!). The
> right query is forwarded. Whats causing the problem is a
> ParserConfigurationException. I dont know why this would happen though,
> it only appears with multiple word queries.
What search engine are you using?
Damo - 04 Jan 2007 20:22 GMT
> What search engine are you using?
yahoo. . It works fine with asingle word query
Damo - 04 Jan 2007 20:48 GMT
Its a 400 error the browser is returning .
the URL that i am sending to the search engine would be in the form :
http://search.yahoo.com/search?&p=java program&n=100
If you type this directly into the browser yahoo will add "%20" between
java and program.
So i guess if you're opening a connection from a program it does'nt do
this. Can I account for this before i send the query?
Daniel Pitts - 04 Jan 2007 20:53 GMT
> Its a 400 error the browser is returning .
> the URL that i am sending to the search engine would be in the form :
[quoted text clipped - 5 lines]
> So i guess if you're opening a connection from a program it does'nt do
> this. Can I account for this before i send the query?
Look at java.net.URLEncoder
Specifically, java.net.URLEncoder.encode(urlString, "UTF-8");
Damo - 04 Jan 2007 21:11 GMT
excellent, cheeers ... that did the trick