Google Search


Google Search

Gopinath Ashokan
Google Search
2 Answer(s)      5 years and 5 months ago
Posted in : JSP-Servlet

I have a textbox and submit button in my JSP page. On giving word in the textbox and click submit it should redirct to google search page and fetch all the results based on my input word automatically. JSP/Servlet code I need. Anyone can help me with explanation.

View Answers

January 24, 2013 at 6:02 PM

hi friend,

For this you can create a html page where you put a textbox and a submit button inside the form tag and write a Servlet for processing the redirect operation. In Servlet get the text what is entered into the textbox at html page then create a String with the value of google search page url and textbox value. And then pass this newly created String as the argument of sendRedirect() method.

An example is as follows : HTML page index.html is as follows :

    <p><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 <br>
Transitional//EN" ""><br>
<head> <br>
<title>Google Search</title><br>
<form method="get" action="
<td>Google Search </td><br>
<td><input type="text" 
<td><input type="submit" 

And you can write the Servlet as follows :

package net.roseindia;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class GoogleSearch extends HttpServlet {

protected void doGet(HttpServletRequest request, 
HttpServletResponse response) throws ServletException, IOException {

String text = request.getParameter("search");
if(!((text) == null))
String url = 
protected void doPost(HttpServletRequest request, 
HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);


And the web.xml can be written as follows :

    <?xml version="1.0" encoding="UTF-8"?><br>
<web-app xmlns:xsi="" <br>
xmlns="" <br>
xmlns:web="" <br>
xsi:schemaLocation="" <br>
id="WebApp_ID" version="3.0"><br>
<welcome-file>index.html</welcome-file> <br>

For the detail tutorial how can we redirect to the google search using JSP visit the link Redirect to Google Search JSP

January 25, 2013 at 10:10 AM


You can write a JSP page for this. Go through the link

this may helpful for you.



Related Tutorials/Questions & Answers:
Google Search
Google Search  I have a textbox and submit button in my JSP page. On giving word in the textbox and click submit it should redirct to google search page and fetch all the results based on my input word automatically. JSP/Servlet
How to include website in google search?
How to include website in google search?  Does anyone has idea about how to include a website into Google Search?   Visit the given Google website link on how to oiptimize or submit your website to Google. http
Drop down for search textbox like google search
Drop down for search textbox like google search  I want drop down like google search (ie, when we type one letter then the word start with that are displayed). when the drop down list appear, then we can select one of word as our
Google Desktop Search
Google Desktop Search       GDSearch (Google Desktip Search) is an alternative File search... capabilities, this plug-in uses the Google Desktop Search Engine instead
Redirect to Google Search JSP
Redirect to Google Search JSP This tutorial explains you how can you crate a google search in your page. Redircting to google search means the text what you have entered into the textbox in your page, the google search should fetch
Dojo Google Web Search
Dojo Google Web Search        ... the google web search. That means user enter your text that have to be searched. This program search all content related to its. If you click on the filtered data
Dojo Google Blog Search
Dojo Google Blog Search      ... the google blog search. That means user enter your text that have to be searched...: Google Blog Search Here is the code of program: <html> <head>
Top 10 Ways to Increase Google Search Hits
Top 10 Ways to Increase Google Search Hits In deliberating here on the top 10 ways to increase Google search hits first of all one must understand how search... search engines who will not agree with the dominance of Google as the world's most
Top 20 SEO Techniques for Google Search Ranks
. Though in presenting top SEO techniques for Google search ranks we are most likely... tools and techniques. Here is our pick on top SEO techniques for Google search... to search ranks in Google or for that matter any other search engine. Putting
Google web Service (GWS)
using Internet. Whenever we have to search something we select Google for it. Google provides its search functionality as its web service...Google web Service (GWS)      
Google Penguin 3.0 Launched
release of Google Penguin search engine technology. Last month Google's 27th... that the Penguin 3.0 is released and the Google Search is being updated with new...Google Penguin 3.0 Launched nearly after year year of previous Google Penguin
Google says Start Searching India
Google has started a new campaign for Indian people to persuade them to search everything and anything on its search engine. Google aims to simplify.... Google will provide the search results of your queries in the form
search  how to develop search box and how to retrive data from database..   Please visit the following link: Search box
Web Search
Web Search         The Web Search plugin for Eclipse allows you to search for selected text on the Web using Google, Yahoo, or Microsoft Live Search. The plugin supports
SEARCH  how can we do search in jsp...? option for search criteria like name and DOB...   Please visit the following links:
What is Google Penguin?
from their websites to maintain their search engine ranks. Google's Penguin...Introduced on April 24, 2012, Google penguin is a code name given to Google algorithm update with an objective to decrease the ranking of websites in search
Google Launches Panda 4.0
Google Launches Panda 4.0 search engine updates Now the latest update... confirmed that the Google has updated the search engine and now Panda 4.0... is targeted to provide the great content to the people searching on the Google search
Search   Hi, I have a project in which I am trying to enter "Marathi" (Indian local language) data in JSP using JSTL and trying to search data... and tries to search then It shows no data from database
Google Panda 4.0 is rolling out
Google Panda 4.0 Launched - Get ready for the impact of Google Panda 4.0 on the search results After a prolonged speculation finally Google Panda 4.0 hit the search engine, the latest version of search engine algorithm. Google Panda
Google Penguin Update 2013
of search results for users. Matt Cutts, head of Google webspam team announced...Google Penguin is an algorithm that Google uses to restrict spam websites or blogs. Till today, Google has rolled out three updates to original Google
add google map javascript
add google map javascript  How can i add google map using javascript in my web page?   Search for the " Google Maps Javascript API" it will allow you to embed the Google Map into your web Page
Google Ajax API
Google Ajax API  Hi, What is Google Ajax API? From where I can get in our application. Thanks   Hi, Google AJAX APIs is a JavaScript..., search, or feed-based Internet content into web applications/pages, organized
What are Google Penguin update impacts?
Matt Cutts, head of Google webspam, recently announced an update to its... in the search engines, which do not redirect them to a "no use" webpage or blog, Google is downgrading the rankings of websites that are using Black-Hat SEO
search program
links after google search...plzz program  i m writing program which takes company names from databse...serch on google...n try to find the best match WEBSITE...of company name
What is Google Penguin Update?
search aspirations Google is committed to improve our web experience by limiting... to their web experience. Google is the world's most popular search engine and is far... majority of websites to come up into Google's search rankings in multitude
Google Penguin Update at a Glance
to search. The latest Google Penguin update is just a step towards that. Google... search. Let us understand what SEO is and what the Google Penguin update...We all get fairly astonished at the grand success of Google, the world's
Top 10 Search Tricks for Smarter Googling
today is dominated more or less by the Google, world's most popular search... refer to Google experience in relating to search engine. There is great array of search tricks for smarter Googling or smart use of Google search engine
SEO and Search Engines,Best Search Engines on Web,What is Search Engine
in the search result page. Best Search Engine Google... technology. Now ad days the search engine leader is Google, with many services like image search, email, chat, bogglers etc. Google provides best clutter free
How to Recover a Business from a Google Panda 4.0 Penalty?
is the search engine algorithm from Google to evaluate website traffic and search... Panda is all about? Google Panda is a search engine algorithm targeted... Google Panda as a search engine algorithm will only influence ranking
Turnhout Turnhout1 is a eclipse plugin to search google Whats New Added preference to change the search engine. Default is Google. Added preference to add a keyword (e.g. Java) to search string for more
How to Recover from Google Penguin Effects
the latest Google penguin update and its consequent effects on the search... Google Penguin effects that help you to avoid search engine indexing... those irrelevant links before it let your search rank affected by Google indexing