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?

Similar Messages

  • 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 can I share values between different jsp pages?

    Hi,
    I'm doing a jsp, bc4j application (JDeveloper 9.0.3), and I need to share some values between different jsp pages. To do this,
    I have used the tag <jsp:usebean.....></jsp:usebean> in this way:
    on pageone.jsp
    <jsp:useBean id="param" scope="session" class="MyPackage.Parameters" ></jsp:useBean>
    on pagetwo.jsp     
    <jsp:useBean id="param" scope="session" class="MyPackage.Parameters" ></jsp:useBean>
    and so on, in order to refer to the same instance of the class "Parameters".
    After deploying, the application works well only if the client is the same pc where the AS resides, otherwise the variables of "Parameters" are null.
    Please, could you help me?
    Thanks
    Nunzio.

    I am seeing an indication on 9.0.3 that static includes are not static, but instead always dynamic. The compiler generates a call to the included page, and doesn't include the content in the calling page as it should.

  • 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.

  • In a Google search, clicking on a search result causes the new page to open with the search terms highlighted in yellow -- how can I turn off th

    In a Google search within a Firefox session, clicking on a search result causes the new page to open with the search terms highlighted in yellow -- how can I turn off this highlighting?

    Try to clear the Google cookies and redo those Google options.
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"

  • How to go to different jsp pages based on different selection?

    I put SELECT and OPTION in the page. I want to go to different jsp
              pages when different OPTION been selected, but there is only one URL
              in the action attribute. How can I do it ?
              

    add a javascript on the select tagg:
              onchange=javascript:jump(this);
              Then make a javascript to pull out the url from the value attribute in the
              selected option tagg.
              http://javascript.internet.com/
              "hgui" <[email protected]> wrote in message
              news:[email protected]..
              > I put SELECT and OPTION in the page. I want to go to different jsp
              > pages when different OPTION been selected, but there is only one URL
              > in the action attribute. How can I do it ?
              

  • How do i use Connection pool in JSP pages

    Hey everyone,
    I am using a connection pool in my web application. I am using DbConnectionBroker from Javaexchange.com. It has a class that creates a connection pool available for the servlets. I am trying to figure out that how to use connection pool within the JSP pages if I want to connect to the database. In the servlets i am using DBConnectionBroker pool = (DbConnectionBroker) getServletContext().getAttribute("dbPool") to get database connection. How Can i use this in JSP page to get a db connection.
    Thanks

    If the reference to the connection pool is already stored as an ServletContex attribute, try:
    <jsp:useBean id="dbPool" scope="application" class="com.javaexchange.dbConnectionBroker" />
    <%
    Connection con = dbPool.getConnection();
    %>

  • How we can generate dynamic menu in jsp page

    Hi all,
    how we can generate dynamic menu in jsp page.
    Thanks
    Manjinder

    by reading more about them on the web or in a good book, OR BY HIRING SOMEBODY TO DO SO. ;)

  • HOW to send a value to another jsp page

    HOW to send a value to another jsp page, like user name in one jsp page to another jsp page

    In the most simplest form...
    // pageA.jsp
    <html>
    <body>
    <form action="pageB.jsp" method="post">
    <b>First Name:</b> <input type="text" name="FNAME" value="Joe">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>
    // pageB.jsp
    <html>
    <body>
    <b>Name:<b> <%=request.getParameter("FNAME")%>
    </body>
    </html>

  • How To Eliminate Separate Search Results Window in iTunes 11

    From my perspective (based upon how I use iTunes to create playlistsby searching for titles, listening, and selecting), the new format in iTunes 11 of showing search results in a separate window was totally unworkable. Fortunately, I found a CNET article that said how to revert to the old method.  To disable the new format, and have search results show up in the body of your music library, all you need to do is this:
    Click on the magnifying glass in the Search box in the uppper right corner of the iTunes screen
    The first item in there is "Search Entire Library", and has a check mark next to it
    Click on it to remove the check mark
    That's it!  Now your Search results will show up in the library itself, as it always has. 
    Until I found this quick fix, I was ready to trash the new iTunes and replace it

    I found this article with the explanation on how to find this again.  In the upper right corner of itunes (only when an item is downloading) you will see a downward facing arrow inside a gray circle with a blue status bar type line below it.  If you click that it will show you your downloads progress.
    Link: http://www.cultofmac.com/204589/find-the-download-manager-again-in-itunes-11-os- x-tips/

  • How to display search results in a table or in different columns

    Hi
                 How can i display search results in multiple columns or in a table so that the user can sort the results based on a particular property displayed in the search results.
    Thanks in advance
    Regards,
    Vidya

    Hello,
    To display search results in a table, in different columns or more... you should modify SearchResultLayoutSet.
    Create your own StandardSearchResultRenderer (exp My_StandardSearchResultRenderer) and add to SearchResultLayoutSet. Than change whatever you like to achive your aim.
    Thank you.
    Hope this helps.

  • Different sequence of search results in different environments with same set of documents

    I am using Sharepoint 2013 Foundation version.
    I have set up 2 environments (say environment A and environment B) with the same Window baseline and Sharepoint server farm setup. The similar set of documents have been uploaded to both environments. With input of exactly the same search string at the search
    field and enter button pressed, the sequences of entries shown on search result page are different in these 2 environments.
    In particular, there is a document 'Monthly Newsletter.pdf' uploaded in both environments. When I type 'Monthly Newsletter' in search field and press enter, this document appears as the first entry in the search result in environment A, but this same document
    appears as the 8th entry in the search result in environment B. 
    May I know the reason? Thanks a lot for advice!

    There are a lot of factors that go into computing the "relevance" of any one document. One factor is "closeness". So one question would be how identical are the two environments? Same number of site collections? Are the
    documents at the same depth? (sites -> subsites -> libraries -> folders)  Are the libraries of the same type, using the same content types and the same metadata>  In both cases are you searching from
    the same site and are the documents at the same depth?  
    Ranking is also impacted by past searches. The more people who have clicked through to the document, the higher it will be ranked in the future.
    If the two environments are identical, and are only being used for testing, Reset the Indexes and do a new Full Crawl and then test.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • How to change search result list entries?

    Hi together,
    I'd like to fit the TREX search result list to my own requirements. I've edit the Search Result Renderer Settings, Search Result Layout Set, Search Component Set and the Search Option Set. But that's not enough.
    1.) I would like to display the relevant index name, in which the document was found.
    2.) For special indexes (not for all!) I want to change the content link:
    For example: if TREX is finding an xml-File in index "abc_index" I would like to change the content link from
    "https://portalserver/irj/go/km/docs/folder/p76.xml" to
    "https://portalserver/irj/go/km/docs/folder/p76.htm"
    and from
    "https://portalserver/irj/go/km/docs/folder/p76_data.xml" to
    "https://portalserver/irj/go/km/docs/folder/p76.htm"
    3.) I'd like to display a special part of the document as a explanatory text in the result list.
    I think point 1 and 3 are possible with properties and HTML-extractors. But point 2 I'm afraid I have to create my own component.
    But how to manage this? I cannot find any code snippets or tutorials or pattern to copy and develop further.
    Is it possible or advised to write a WebDynpro? Are there other possibilities? I don't know how to start.
    I would be pretty delighted to get any idea...
    Thanks a lot
    Steffi

    Hi Stefanie
    1) If you want to be able to show the name instead, you should write your own property renderer. Heres the link for the documentation: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c739e546-0701-0010-53a9-a370e39a5a20 -> How to Implement Flexible UI
    Components -> Property Renderer
    2) Documentation will be send in a matter of minutes.
    3) I also think the web property extractors only work with the web repository manager, because as far as I know that is the only repository manager, where you can select a web property extractor upon creation. I guess you could open an OSS to SAP and ask if its not possible to extract properties in your scenario just to be sure if its not possible. But my guess is that you either have to develop your own repository manager or publish your files on a web server in order to meet your requirements.
    Best regards,
    Martin

  • 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.

  • How to configure search results web part to display results only after a query is generated from user?

    Hi All,
    I am crawling documents from a file server. I created a new content source and crawled the documents. All documents are crawled successfully.
    Then I went to my enterprise search center site collection and created a new result source. I have added the query to use above content source.
    After that, on a page I am trying to configure the search results web part to display documents using this result source. Now the problem is:
    It displays all the documents that are crawled without searching for anything. I mean first it should not display any results. If a user searches for something , then according to that search it should display results.
    Any idea how to do this in the web part? I am using SharePoint 2013 on premise enterprise edition. No code. Totally OOTB.

    Hi Mohan,
    What did you use for the Query text in the result source?
    I could reproduce this issue when I used Query text like: {searchTerms} Path:”http://sps2k13sp/sites/First/Shared%20Documents”
    Then I changed the Query to
    {?{searchTerms}
    Path:"http://sps2k13sp/sites/First/Shared%20Documents"}
    , then Search result web part didn’t return results without searching.
    So , check your result source, and use the Query like the above(adding "{?...}").
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

Maybe you are looking for

  • How to open and XML file?

    Does anyone have a way on Mac to open an XML file for viewing. This can be done with WIN Excel and XML toolkit but doesn't exist for Mac Excel in Office 2008. I can open with TextEdit but would like to see the info with headers and cells without all

  • Things you need to know about 6280

    Hi everybody, I used to have a 6680 and I say this with regret. Why? I gave it to my girlfriend as a gift. Now that was a good sturdy functional phone. Now I bought a 6280 from Vodafone. I wanted a N70 but the Vodafone representative recommended this

  • How to Auto open PS CS3 instead of CS5

    Clicking on a .psd file opens photoshop CS5. Is there a way to automatically open CS3 instead? I have changed the "open with" info several times but still I get CS5. My next step will be to rename the app or uninstall it. Thanks.

  • HT3529 how do I download iOS5 for my Apple iphone 4?

    How do I download iOS5 for my Apple iphone 4?

  • SO654 - send mail medium '7' to a e-mail address from HR Minimaster direct

    I created an output type that has as a partner a number from the HR minimaster. Now the Minimaster does have a communication block 0105 setup but only the subtype '0010' and not '0001' as normally requested. Now I get the error message SO654 when try