Results 1 to 2 of 2
Thread: search key in servlet
- 11-26-2009, 07:14 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 9
- Rep Power
- 0
search key in servlet
i have got this code for searching a particulate word from a XML list!
i just want to ask how can i make some changes in the code so that that same code could give me option for searching for 2 words or 3 words at a time
example!!
right now that code is giving me output of search word "ABC" . it disply all the excat match of ABC in xml sheet !!! i want to search fro "ABC PQR ZZWQ"
like that!
using a single search key to search a perticular word i want to search entire line with spaces
my code
Java Code:import javax.servlet.*; import javax.servlet.http.*; import java.util.*; import java.io.*; public class NegativeListServlet extends HttpServlet{ final String pResourcePath = "C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/NegativeList/WEB-INF/res/consolidatedlist.xml" ; public void doPost(HttpServletRequest pRequest, HttpServletResponse pResponse)throws ServletException,IOException { try{ String lSearchkey = pRequest.getParameter("Searchkey") ==null ? "" : pRequest.getParameter("Searchkey"); //System.out.println("Search for "+lSearchkey ); XmlDataExtracter lObject = new XmlDataExtracter(pResourcePath); List<Map> lSearchList = lObject.search("SORT_KEY",lSearchkey); //System.out.println("Result "+lSearchList ); RequestDispatcher lRequestDispatcher = pRequest.getRequestDispatcher("Search.jsp"); pRequest.setAttribute("SearchResult" , lSearchList ); lRequestDispatcher .forward(pRequest,pResponse); }catch(Exception e){ e.printStackTrace(); } } }
- 11-26-2009, 08:56 AM #2
Member
- Join Date
- Nov 2009
- Posts
- 9
- Rep Power
- 0
Similar Threads
-
Not able to highlight the search key work in wild card search
By annappa in forum LuceneReplies: 0Last Post: 10-29-2009, 09:28 AM -
how can i link html+servlet+xml to form servlet
By balachandarr in forum Java ServletReplies: 0Last Post: 04-15-2009, 04:06 PM -
Servlet - apache tomcat/glassfish server shuts down on servlet usage
By StewS in forum Java ServletReplies: 1Last Post: 12-02-2008, 12:23 AM -
make search function ike eclipse search in window->preference
By i4ba1 in forum Advanced JavaReplies: 5Last Post: 08-26-2008, 03:43 PM -
javax.servlet.ServletException: Wrapper cannot find servlet class util.t2
By osval in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 03:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks