Search Option in JSP page

Hi all,
Any one can help me to do the search option in JSP pages.
regards,
Bala

You need to index the page contents and store it somewhere (database, textfile, binaryfile, etc) and write code to crawl in the index. You can write it all youself, but as I guess that you're not very skilled to do that, it might be worth to take a look for several 3rd party Java Search Engine API's:
http://www.google.com/search?q=java+search+engine+api

Similar Messages

  • Save option for jsp page

    hi all,
    In my project am including a html page in jsp.Now i want to save the html page only.Please any body help me to how to give save option for jsp page.
    Thanks in advance.
    mohan :)

    you can save it in with browser "save as"

  • To search a record from the table by providing a search button in JSP page

    Hi,
    My problem statement is:
    I have a jsp page which displays a table containing records. I have to provide a button called search and a condition in a textfield so that the record which matches the condition gets highlighted.
    Can anyone solve my problem statement. Its urgent.
    Suraj.

    Example:
    on the jsp page, read the matched value the server provides and use it to put the statement in bold using the <b> tag (I dont know the syntax for highlighting).
    <%String matchedString=(String) request.getAttribute("matchingString");%>
    Then in your list:
    <%if(matchedString.compareTo(thisRecordString)==0){%>
    <b>
    <%}%>
    //your text goes here
    <%if(matchedString.compareTo(thisRecordString)==0){%>
    </b>
    <%}%>

  • How to search for file in jsp page

    i need help on how to search for a file in a folder where there is a lot of subfolder.like how u search in a document in windows. i need a complete codes in jsp page.
    thank you in advance.
    Message was edited by:
    n_dilah

    no i need to do a search engine in jsp page which is the j2ee.
    i type smth than tat file from any folder will appear the same way when u need to search your file in a document in windows.
    well can u nice people tell me where i can get the codes bcos i stinks when it come to programming.
    thank you very very very much.

  • A jsp page for searching employees

    this jsp page is used for searching employees and displaying the search results.
    when the submit button is clicked, the http request will be sent to a servlet java class.
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <title>SEARCH STAFF</title>
    </head>
    <body>
    <p align="center"><font color="#008000">SEARCH STAFF</font></p>
    <FORM METHOD=POST ACTION="/servlet/ReqHandler?action=searchstaffget">
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
        <tr>
        <td width="50%">Staff ID:</td>
        <td width="50%"><INPUT NAME=staffid SIZE=15></td>
      </tr>
      <tr>
        <td width="50%">First Name:</td>
        <td width="50%"><INPUT NAME=firstname SIZE=30></td>
      </tr>
        <tr>
        <td width="50%">Last Name:</td>
        <td width="50%"><INPUT NAME=lastname SIZE=30></td>
      </tr>
      <tr>
        <td width="50%">Gender:</td>
        <td width="50%"><select size="1" name="sex">
        <option value="m" selected>Male</option>
        <option value="f">Female</option>
        </select></td>
      </tr>
       <tr>
        <td width="50%">E-mail:</td>
        <td width="50%"><INPUT NAME=email SIZE=30></td>
      </tr>
      <tr>
        <td width="50%">Birth date:</td>
        <td width="50%"><INPUT NAME=birthdate SIZE=10></td>
      </tr>
      <tr>
        <td width="50%">Address:</td>
        <td width="50%"><input type="text" name="addr" size="30"></td>
      </tr>
      <tr>
        <td width="50%">Phone number (Home):</td>
        <td width="50%">
    <input type="text" name="phoneno" size="8"></td>
      </tr>
      <tr>
        <td width="50%">Phone number (Mobile):</td>
        <td width="50%">
       <input type="text" name="mobileno" size="8"></td>
      </tr>
      <tr>
        <td width="50%">ID card number:</td>
        <td width="50%"><input type="text" name="idno" size="8"></td>
      </tr>
        <tr>
          <td width="50%">Position:</td>
          <td width="50%"><select size="1" name="position">
        <option value="deliveryman" selected>Deliveryman</option>
        <option value="normalstf">Normal Staff</option>
        </select></td>
      </tr>
    </table>
    <P align="center">
    <INPUT TYPE=SUBMIT></FORM>
    <!--
    I WANT THE SEARCH RESULTS TO BE DISPLAYED HERE IN THIS JSP PAGE.
    THIS MEANS THAT, AFTER THE SUBMIT BUTTON IS CLICKED, THE FORM ABOVE WILL NOT DISAPPEAR AND THE SEARCH RESULTS WILL DISPLAY BELOW THE FORM.
    --> the java servlet class will then forward the search parameters(last name, first name....etc.) to a database accessor class and this class will then return an arraylist of all the columns for each row in the database that match the search criteria. Each column of a row is stored as a String object in the arraylist.
    what i would like to ask is, what codes should i use in the servlet class, and what codes should i use in the jsp page, in order that, the search results will finally display in <TABLE> format.
    please help, thanks a lot~~~~~~~~

    put the search results in session in your servlet
    using
    request.getSession().setAttribute("SEARCH_RESULT_SESSI
    ON", searchResult);
    where searchResult is your arrayList.
    in your JSP page:
    <c:set var="SEARCH_RESULT"
    value="<%=SEARCH_RESULT_SESSION%>"/>
    <c:set var="searchResult"
    value="${sessionScope.SEARCH_RESULT}"
    scope="request"/>
    and use this searchResult to display your results in
    whatever format you want.
    <c:forEach var="result" items="searchResult">
         <c:out value="${result}"/>
         result is the string that you stored in arrayList.
    </c:forEach>
    Questions, let me know.thanks but.....
    this doesn't work for me, i placed this statement in my java servlet class:
    request.getSession().setAttribute("SEARCH_RESULT_SESSION", searchResult);and i placed the other statements in the JSP page like this:
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ page isELIgnored="false" %>
    <%@ page import="java.util.ArrayList" %>
    <html>
    <head>
    <title>SEARCH STAFF</title>
    </head>
    <body>
    <p align="center"><font color="#008000">SEARCH STAFF</font></p>
    <FORM METHOD=POST ACTION="/servlet/ReqHandler?action=searchstaffget">
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
    <td width="50%">Staff ID:</td>
    <td width="50%"><INPUT NAME=staffid SIZE=15></td>
    </tr>
    <tr>
    <td width="50%">First Name:</td>
    <td width="50%"><INPUT NAME=firstname SIZE=30></td>
    </tr>
    <tr>
    <td width="50%">Last Name:</td>
    <td width="50%"><INPUT NAME=lastname SIZE=30></td>
    </tr>
    <tr>
    <td width="50%">Gender:</td>
    <td width="50%"><select size="1" name="sex">
    <option value="m" selected>Male</option>
    <option value="f">Female</option>
    </select></td>
    </tr>
    <tr>
    <td width="50%">E-mail:</td>
    <td width="50%"><INPUT NAME=email SIZE=30></td>
    </tr>
    <tr>
    <td width="50%">Birth date:</td>
    <td width="50%"><INPUT NAME=birthdate SIZE=10></td>
    </tr>
    <tr>
    <td width="50%">Address:</td>
    <td width="50%"><input type="text" name="addr" size="30"></td>
    </tr>
    <tr>
    <td width="50%">Phone number (Home):</td>
    <td width="50%">
    <input type="text" name="phoneno" size="8"></td>
    </tr>
    <tr>
    <td width="50%">Phone number (Mobile):</td>
    <td width="50%">
    <input type="text" name="mobileno" size="8"></td>
    </tr>
    <tr>
    <td width="50%">ID card number:</td>
    <td width="50%"><input type="text" name="idno" size="8"></td>
    </tr>
    <tr>
    <td width="50%">Position:</td>
    <td width="50%"><select size="1" name="position">
    <option value="deliveryman" selected>Deliveryman</option>
    <option value="normalstf">Normal Staff</option>
    </select></td>
    </tr>
    </table>
    <P align="center">
    <INPUT TYPE=SUBMIT></FORM>
    <c:set var="SEARCH_RESULT" value="<%=SEARCH_RESULT_SESSION%>"/>
    <c:set var="searchResults" value="${sessionScope.SEARCH_RESULT}" scope="request"/>
    <c:forEach begin="1" end="3" var="result" items="searchResults">
    <c:out value="${result}"/>
    </c:forEach>
    </body>
    </html>
    i typed some data in the text fields and clicked "submit" button
    but it turned into a blank page
    i was sure the arraylist contained the search results because i tried to write them into the stdout.log file.
    could you please tell me why it's like this?

  • Convert jsp page into xml  or dom for search

    Hello everyone,
    I have to build an application that searches for message beans in all jsp page. I did it the traditional way, using scanner and string methods. Its working but its not perfect. So i want to convert all my jsp page into xml format and then process them. My jsp pages are quite complicated. I used some jars that convert them into jspx . But its not working. Please help
    Thanks in advance

    Well its like this.I need to develop a program that reads all the message bean keys.. We have lots of struts webapps. All messages in the jsp pages have been externalised and internationalised. Now i have to build a program that given a webapp path prints out all the message bean keys used in the webapp. I have developed the program using the Plexus Directory scanner to filter all the jsp pages and java util Scanner to read line by line and used String functions to search for keys.
    Now thats not the best soultion. The best way, imo, is to cinvert the jsp into xml pages and then we can parse the xml pages easily. The' problem is to find a way to convert the jsp pages(jstl +javascript) into xml.
    Can you help me out?
    Thanks

  • How to call a stored procedure to search db then return results to jsp page

    Hi,
    Most of what i have said is in the title. Im trying to search a database using a stored procedure that will call the procedure using sql2000 then coming back with the results to the jsp page. all of this is done using JSP web pages. if JAVA example is availabel then let me know.
    I need some examples.. I cant seem to find any code that will help.
    Thanks

    Use CallableStatement. You can set parameters with setXXX and registerOutParameter methods. And to fetch results, you can use getXXX methods of it.

  • Create jsf jsp page / page implementation / third option is not visible

    The third option (check box) for page implementation settings in the create jsf jsp page is not visible. The window is not resizable.

    I see the option radio button and text "Automatically Expose UI Components in an Existing Managed Bean" that is disabled but i see only partially the label what is a disabled input text field i suppose just below the radio button.
    I see also the Directory input field and Browse button a little bit truncated at the bottom (1-2 pixels missing).
    I see also the Render in Mobile Device check box and combo box ... cutted by the half when i expand the page implementation part.
    As said the window is not resizable.
    Let me know a location i can send you a hard copy of the screen.

  • ADF Search form inside a jsp page's panel page container

    I am going through the Oracle JDeveloper 10g for Forms & PL/SQL book and I got to page 391 where I need to drop a search form onto a jsp page set up with a panelpage. The form show up but when I go to delete the extra fields JDeveloper completely locks up. I am running JDeveloper version 10.1.3.3.0.4157. I tried reinstalling it and it still locks up. I tried going back a few steps and recreate the search form and it still locks up.
    Can anyone explain why it is locking up or how to delete the extra fields without locking up?

    I also tried selecting a field in the source file code window. Just selecting a field in any form or window locks up JDeveloper. My program worked find until I created a search form from a data set. I think it is a bug in the version of JDeveloper I have. I did a similar task in a previous version and it worked fine. I could select and delete fields with no problem.

  • How to separate search results onto different jsp pages?

    Hi,
    I'm using struts framework and I'm a newbie to this technology as well as JSP.
    Let's say, this is an online shop portal and a user has decided to search by category for the products he wants. After submitting the search string, the servlet will return a collection of product value objects to the searchResult.jsp.
    Since this collection may contain alot of products, I will have to allow the user to choose to view the search results by 5, 10, 20 products etc. Now, how do i divide the collection? Do i have to code this function in the action servlet or at the jsp pages? And how do i code them?

    I had a similar problem which I resolved by:
    1) load results into a ArrayList
    2) Have a ValueListHandler with getNextElements(int) & getPreviousElements(int) - see J2EE patterns book for code egs
    3) Then I put logic in display jsp along lines of if ->, call ValueListHandler.getNextElements(10), else call ValueListHandler.getPreviousElements(10)
    Good luck
    Eddie
    Hi,
    I'm using struts framework and I'm a newbie to this
    s technology as well as JSP.
    Let's say, this is an online shop portal and a user
    r has decided to search by category for the products
    he wants. After submitting the search string, the
    servlet will return a collection of product value
    objects to the searchResult.jsp.
    Since this collection may contain alot of products, I
    will have to allow the user to choose to view the
    search results by 5, 10, 20 products etc. Now, how do
    i divide the collection? Do i have to code this
    function in the action servlet or at the jsp pages?
    And how do i code them?

  • Content search over jsp pages

              Hi,
              I am using IIS indexing server to do the content search, but the site is writetn
              in jsp page, so i need to produce the same file in html to be searched. It is
              pain to modify the content. Is there a way to search jsp pages?
              Thanks
              

    Well, Servlet and JSP both are server side technologies and both can be used in web applications. You can write web pages using both servlet and JSP. In fact, your JSP pages are converted to Servlet by container while serving requests. However, writing a JSP page is relatively easier and requires minimal Java knowledge.
    When you will develop real world java based web applications you will find that you are writing more JSP pages than servlet.
    In a typical MVC (Model View Controller) architecture a single servlet is used as controller and JSP pages are used to generate web content.
    Thanks,
    Mrityunjoy

  • The best  way of carrying the search string across different jsp pages?

    I heard about transfer object. What about carrying object with session for different pages.
    Please suggest me the best approach to
    carry the search string across different jsp pages?
    thanks
    vijendra

    I doubt its possible even with a fancy HTML widget, although the last iBA update now allows links to other books.

  • How to call a stored to search database then return results to jsp page

    Hi,
    Most of what i have said is in the title. Im trying to search a database using a stored procedure that will call the procedure using sql2000 then coming back with the results to the jsp page. all of this is done using JSP web pages. if JAVA example is availabel then let me know.
    I need some examples.. I cant seem to find any code that will help.
    Thanks

    Make use of Callablestatement. You can set parameters to it by registerOutParameters and setXXX methods. And use getXXX methods to get results of procedure.

  • Moving the Ultra Search search.jsp page

    I am trying to move the search.jsp Ultra Search page into a new directory that has non-SSO security on it, does anyone know how to do this? I do not use Ultra Search on a Portal page and I don't want to use SSO for security because we already have all of the pages that are being searched in a secure area and I want the search page in that same secure area.

    It might be better if you address this question on the UltraSearch forum at Ultra Search

  • To Report Error message in oracle website search option

    I have encountered an error message in oracle website search option. There was some compilation error in their JSP pages I did not know how to inform the Otn team. Can any one please guide me.
    regards,
    sagar

    You can use the below information for raising an Alert for adapters.
    Specific Error Information from the Adapter Engine:
    Container Element
    ABAP Dictionary Data Type
    Meaning
    SXMS_TO_ADAPTER_TYPE
    CHAR70
    Adapter type
    SXMS_TO_ADAPTER_ERRTXT
    CHAR70
    Error text from the Adapter Engine
    Refer the below link:
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

Maybe you are looking for