Strategy? Bean to multi page JSP

I want to make a Bean create a table of search results. If there are too many for 1 page, I want to have a counter thingy saying entries 20 of 50 or something like that. How does the bean remember where in the search it is. And how does the JSP call the first 20 entries then the next 20 etc? I'm looking for something like you would find on say www.download.com.

useBean scope="session"
MySQl e.g. supports "LIMIT" where you can start from an offset and limit the number of next records. This is good for paging like you want.
Nearly a sample for what you want: http://www.must.de/jspsample.html
Christoph

Similar Messages

  • Multi page jsp portlet

    I have being trying to investigate deplyoying jsp's as portlet.
    My first step was to look at the multipage example provided by oracle. This works fine.
    I then decided to copy the code of the jsp's into my own jsp's and use the portlet wizard in jdeveloper to create the provider. I then deployed this to portal but for some reason page 1 displays but the link to page2 just reloads page1 . The jsp's are exact copies if the multipage example so i can onlythink its the provider.xml or something else.
    Can anyone help ???
    The proider.xml is this
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <?providerDefinition version="3.1"?>
    <provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
    <id>1</id>
    <name>mpage</name>
    <title>mpage</title>
    <description>mpage</description>
    <timeout>40</timeout>
    <showEditToPublic>false</showEditToPublic>
    <hasAbout>false</hasAbout>
    <showEdit>false</showEdit>
    <hasHelp>false</hasHelp>
    <showEditDefault>false</showEditDefault>
    <showDetails>false</showDetails>
    <renderer class="oracle.portal.provider.v2.render.RenderManager">
    <renderContainer>true</renderContainer>
    <renderCustomize>true</renderCustomize>
    <autoRedirect>true</autoRedirect>
    <contentType>text/html</contentType>
    <showPage>/htdocs/mpage/red.jsp</showPage>
    </renderer>
    </portlet>
    </provider>
    Thanks
    Richard

    Change the value of passAllUrlParams to false - that should do the trick.
    Peter

  • Can't See request Parmeters in Multi Page JSP

    Hi,
    I have a multipage portlet in which a simple JSP submits to another JSP. The JSP is submitted fine but for some reason I am unable to see the form parameter (a text box) in the 2nd JSP.
    following is snippet from first JSP:
    <%
         PortletRenderRequest prr = (PortletRenderRequest) request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
         String actionString = UrlUtils.parameterizeLink(prr, UrlUtils.PAGE_LINK, HttpPortletRendererUtil.portletParameter(prr, "next_page") + "=/htdocs/testsubmit.jsp");
    %>
    <%= new java.util.Date() %></p>
    <form name="sample" action="<%=actionString %>" method="post">
    <%=UrlUtils.htmlFormHiddenFields(prr, UrlUtils.PAGE_LINK) %>
    <input type="text" name="sampletext1" value="" size="20" maxlength="40">
    <input type="submit" name="samplesubmit1" value="Submit">
    </form>
    following is the second JSP accesing the request variable "sampletext1"....I see the static string but the request parameter comes out as null..
    <body>
    <h2>
    The submitted text is:
    </h2>
    <p>
    <%= request.getParameter("sampletext1") %></p>
    </body>
    Can anyone point me to the problem here?..
    Thanks,
    Chirdeep.

    Hi.
    Trying to use this code.
    <%
    PortletRenderRequest prr = (PortletRenderRequest) request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String actionString = UrlUtils.parameterizeLink(prr, UrlUtils.PAGE_LINK, HttpPortletRendererUtil.portletParameter(prr, "next_page") + "=/htdocs/testsubmit.jsp");
    String f_sampletext1 = HttpPortletRendererUtil.portletParameter(request, "sampletext1");
    %>
    <%= new java.util.Date() %></p>
    <form name="sample" action="<%=actionString %>" method="post">
    <%=UrlUtils.htmlFormHiddenFields(prr, UrlUtils.PAGE_LINK) %>
    <input type="text" name="<%=f_sampletext1 %>" value="" size="20" maxlength="40">
    <input type="submit" name="samplesubmit1" value="Submit">
    </form>

  • How does session bean contain in the JSP page

    May i know how session bean contains in the JSP page
    If the situation is like the following ...
    if i dont want to put the session bean in the session
    like this :
    session.setAttribute("UserBean",userBean);
    the way i get the session bean is only
    session.getAttribute("UserBean");
    Does have the other way to get the Session bean during the JSP
    if i dont want to use this kind of way,
    what else i can do for?
    may i know the solution with detailed
    and please attach the solution of code to me if you know...
    thanks...

    Hi,
    I am not clear with ur query..
    What I understood from ur query is that, u are trying to put the session ejb in the HttpSession Object for some use ahead in future?
    If this is the case, then I think are approach is not correct.
    StatefulSession beans are meant for this purpose, i.e they will be maintaining the client session. So use the same using the JndiLookup of the HomeInterface and the getting the Home reference and calling the businessmethods
    sameer

  • How to call a void bean method in a jsp ?

    I want to call a bean method from the jsp page. The method is void i.e it returns nothing.
    Lets say the bean id is mybean and the method name is beanmethod( ). I want to know in what type of jsp tags should I put mybean.beanmethod( ). Using jsp expression <%= mybean.beanmethod( ) %> gives error and so does scriptlet <% mybean.beanmethod( ) %>
    Can someone help me out. Thanx.
    Arshad

    did you already implement this?
    <jsp:useBean id="mybean" class="yourPackage.YourBean scope="session"/>
    use ";" at the end:
    <% mybean.beanmethod(); %>

  • Execute a bean method on page entry

    Hi all,
    When I have a page with a backing bean on the request, then I know for sure that that bean will have its constructor called and executed when the page loads. That enables me to do some initialisation in the constructor.
    Now I have a page with a bean on session context. However, now the bean is already there (most of the time) so the constructor isn't called.
    Is there a (simple) way so that I can call a method of my bean every time my jsp page is loaded?
    Thank you,
    Steven

    Thanks,
    I still have a problem though.
    I thought of initialising my bean before the apply request phase, but it seems that this phase gets skipped when my page loads for the first time. In fact my beforePhase method only gets executed just before the render response (my method doesn't really contain a lot, I just found out by debugging).
    Any ideas how I could resolve this, as in: how can I fire this method everytime my page is accessed?
    Thanks
    Steven

  • How to make multi-page PDFs?

    A question on this in the Archives did not answer my problem. Until recently, I could easily make multipage PDFs from Pages on my iMac (10.8.4). Now suddenly it only makes a PDF of the first page of multi-page files. Cannot find anyplace to change that back. HOW do I make multi-page PDFs again?

    Check this portion of your code.
    if(rs.next())
       response.sendRedirect("02_dashboard_welcome.jsp");
    else
      out.println("Wrong username or password");Once the user is authenticated(valid username and password found), he is always redirected to a particular page no matter what kind of user he is. You need to add some if-conditional and redirect him to different pages based on his role.
    i have stored their login and password in different tablesI don't understand the need to create different tables for each kind of users. Rather i would do something like this.(Rough Schema)
    USER_ROLE(table)
    1. USER_ROLE_ID (Eg: 1:salesperson, 2:employees etc)
    2. DESC (Eg: salesperson, employees)
    USER TABLE
    1. USER_ID
    2. USER_NAME (Eg: AAA)
    3. PASSWORD (Eg: BBB)
    4. USER_ROLE_ID<Foreign Key, 1 if user is sales person, 2 if user is an employee etc>
    Please note that you will have to create a third table to assign role to an user if an user can have more than
    one role ie he can be salesperson and employees at the same time.
    Now use USER_ROLE_ID to redirect the user to different pages.
    Note: This is just an example(may be a worst one). please design your database and business logic as per your requirements.

  • Moving Scriptlet Code to backing bean when converting from JSP - Facelets

    Hello!
    We are converting our application from jsf1.2 to 2.0 and all jsps are being converted to XHTML. Some are trivial while others had very complex scriptlets.
    I would like to know what are some of the recommended ways of moving Scriptlet Code to backing bean when converting from JSP -> Facelets.
    I have thought about listeners, actionListeners, putting code getXXXX() of the backing bean and then calling #{bean.XXXX} but not sure whats the best way.
    I do appreciate the response!
    Eg of a jsp page:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="/WEB-INF/xxx-jsf.tld" prefix="l" %>
    <%@ taglib uri="/WEB-INF/yyy-pp.tld" prefix="p" %>
    <%@ page import="com.ttyy.search.beans.jsf.AdvancedSearchFormManagedBean" %>
    <%@ page import="com.kkee.util.*"%>
    <%
        AdvancedSearchFormManagedBean advancedSearchFormManagedBean = (AdvancedSearchFormManagedBean) request.getSession().getAttribute("AdvancedSearchFormManagedBean");
        if (advancedSearchFormManagedBean == null) {
           advancedSearchFormManagedBean = new AdvancedSearchFormManagedBean();
           request.getSession().setAttribute("AdvancedSearchFormManagedBean", advancedSearchFormManagedBean);
        advancedSearchFormManagedBean.initializeForAdvancedSearchOptions();
        advancedSearchFormManagedBean.setQuickSearch();
         request.setAttribute("portletHeader", "Hello " + advancedSearchFormManagedBean.getPerson().getFirstname() + ", check out the latest programs in your practice areas and jurisdictions");
    %>
    <h:form id="MYCenterForm">
         <p:portletRenderer portletSetName="test of portlet"
              portletContainer="#{PortletContainerManagedBean}"
              id="MYCenter"
              portletScope = "TEST_SCOPE"
              suppressIfNoData="true"
              portletSkinName="SOME_SKIN">
              <f:facet name="persistenceToolkit">
                   <h:commandLink id="persistenceToolkitLink"
                        actionListener="#{PortletContainerManagedBean.persistPortletSetStateListener}">
                        <h:outputText value="Save State Of Portlet Set" id="persistenceToolkitLinkText"/>
                   </h:commandLink>
              </f:facet>
         </p:pagePortletSetRenderer>
    </h:form>
    <%
         String flag = PropertyItems.getInstance().getPropertyItem("response.time.flag");
         if("1".equals(flag)){
              ResponseTime rt = (ResponseTime) session.getAttribute("responseTime");
            if(rt!=null){
                rt.setDesc("my cle loaded");
                long now = System.currentTimeMillis();
                long start = rt.getStart() + rt.getTotal();
                rt.setInterval(now-start);
                rt.setTotal(rt.getTotal()+rt.getInterval());
                LogUtil.log(rt.toString(), LogUtil.DEBUG_LEVEL);
                session.setAttribute("responseTime", rt);
    %>

    That helps.
    This could be another topic question but itst kind of related to what i am doing right now. while converting JSP to facelet (in jsf2) I came across another issue.
    <h:commandLink id="Save" rendered="#{RegistrationBean.isNOTInOrigionalRegistrationMode}" action="#{RegistrationBean.updateProfile2Submit}" styleClass="#{portalSkinManagedBean.contentPortletSkin.strongTextStyle}">
              <l:htmlSkinnedImage id="SaveImage" style="border:0;" url="save.gif" alt="Save Information"/>
    </h:commandLink>When I click on the generated link, I get this. And this is happening for all the h:commandLink in the application.
    http://localhost:9080/registration/updateProfile2.jsf[request.getQueryString()=null][request.getRequestedSessionId()=F1CCE237DD81D301F1C4DBA6910FFD8A][request.isRequestedSessionIdFromCookie()=true][request.isRequestedSessionIdFromURL()=false][request.isRequestedSessionIdValid()=true]Parameters:[rolePracticeAreasForm:title=rolePracticeAreasForm:primaryPracticeArea=10002javax.faces.ViewState=-2943345291093118815:-4400303399130292206rolePracticeAreasForm:practiceAreasMod2=10148.1rolePracticeAreasForm:practiceAreasMod1=10002.1rolePracticeAreasForm:Save=rolePracticeAreasForm:SaverolePracticeAreasForm=rolePracticeAreasFormrolePracticeAreasForm:otherField=rolePracticeAreasForm:fromMyAccount=1]||
    javax.servlet.ServletException: Index: 0, Size: 0
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.legaledcenter.util.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:250)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.jscape.framework.galileo.support.upload.UploadFilter.doFilter(UploadFilter.java:71)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at java.util.ArrayList.RangeCheck(ArrayList.java:547)
         at java.util.ArrayList.get(ArrayList.java:322)
         at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:161)
         at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
         at com.sun.faces.application.view.StateHolderSaver.restore(StateHolderSaver.java:121)
         at com.sun.faces.application.view.StateManagementStrategyImpl$4.invokeContextCallback(StateManagementStrategyImpl.java:289)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1253)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:284)
         at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
         at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:434)
         at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
         at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:199)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
         at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
         ... 22 more
    ********** Message End *************Thanks

  • Re: having a bean go from page to page

    I have a bean that I put information into on the first page, it retrieves data from a database when the user clicks submit, and then the next page should pull the information from the bean, to set the text fields.
    <jsp:useBean id=".." class=".." /> doesn't work, I get an error:
    If I do this:
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:useBean id="PersonServer" class="edu.usf.acomp.epic.server.persons.NamsPersonServer" scope="session"/>
    I get Exception Details: org.apache.jasper.JasperException
    /Page1.jsp(2,144) Could not add one or more tag libraries.
    If I try placing the <jsp:useBean .../> before the <jsp:root ...
    then I get
    Exception Details: org.apache.jasper.JasperException
    /Page1.jsp(3,5) Invalid standard action
    How can I make this work, where beans will persist through the session.
    Thank you.

    It won't work on the first page, when I try to set the session initially. All of the jsp pages are created from within Studio Creator.
    There should be some way to state that this bean is going to be maintaining state from page to page, within this session, but I don't see how to do that using Studio Creator.
    I shouldn't have to edit the faces.config file by hand though, if that is the case then there is a bug with Studio Creator, but I will try it.
    Thanx for the idea.

  • Design Question: Multi-page Enrollment Process?

    I'm thinking of 3 different possible design approaches for a multi-page customer enrollment process and wanted to know if anyone had any recommendations? There are 3-5 pages in the sign-up process, each page containing form fields the user inputs information to. The main design issues are around how to save the data between pages, not committing the data to the database unless the user completes the entire process, and handling cases where the user does not complete the entire process:
    1. Store form field inputs in temporary database table; if user completes process copy data to real database table. Can delete rows from temporary table as part of nightly cleanup process (i.e., rows where customer bails part way through enrollment)
    2. Use process-Scope variables to hold the user input; commit data to database after user completes the process
    3. Store user input in View Objects with transient fields as a way to preserve the data; commit the data to the database after user completes the process
    Any suggestions or examples?
    Thanks
    Using JDev 10.1.3 ADF BC / JSF

    sorry, to revive this "old" thread, but could someone please elaborate on this:
    Implement a state-machine for each workflow. Example: basic-info->payment-info->success constitute one workflow for me. This state-machine would be a stateful Java class (holding the current state/page) implementing a StateMachine interface with a method: canTransitionTo(String pageName). Declare this as a session-scoped managed bean. You can optionally wire this to your other controller backing beans for modifying the current state when user presses "Next" in the individual pages.
    So basically, you make an interface with a single method canTransitionTo(String pageName) [btw, this seems like it returns a boolean ... although wouldn't a method like "getAvailableTransitions(String pageName)" be more appropriate?] Then your "State machine" would have some variable that holds the current state, for example, "page one".
    My question is this. Suppose we have 3 pages (much like the example), page one -> page two -> page three
    In the page three Action, how do we check to make sure they are allowed to come to this page? The State Machine would not have any state in it yet ... (maybe this was what point(s) 2 and/or 3 was saying, but I couldn't understand exactly what he was saying... PhaseListener?)
    Thanks

  • Multi-page units of work with automatic state management

    Hi Jhs team:
    When my applications need to support an end-user task requiring data entry on many different web pages to complete,
    how to building multi-page units of work with automatic state management ? please give some instruction .

    Ting Rung,
    You can do this in two ways:
    - use a Struts form bean to collect all the values over the requests
    - submit the changes of each request to bc4j, but do not post and commit the changes to the database.
    The latter is easiest. For this to work, you must set the doCommit property of all your save actions in the stuts-condig to false, except for the last save action in the chain of requests.
    In addition, in your application module class, you need to overwrite method postChanges as follows:
    * DO NOT post the changes to the database
    public void postChanges() throws Exception
    // do not post here
    // posting will happen when the commitChanges
    // method on the handler is invoked
    Steven Davelaar,
    Jheadstart Team.

  • Need Multi-Page TIFF Viewer Add-In for Safari

    Greetings - Any recommendations on a (preferably free of charge) multi-page TIFF viewer add-on for Safari?
    Thanks.

    Sorry for the delayed reply as I cannot access from work.
    Here is the link to the tool...
    [http://www.daeja.com/products/viewone1.asp]
    Here is what I did so far:
    I copied ViewONE files to my \forms\java directory
    Added the ViewONE ji.jar reference to my 'archive_jini' parameter in formsweb.cfg
    Create a Bean item on my form
    Added 'ji.applet.jiApplet.class' to my Implementation class property for item
    when I invoke the layout, I get the following error:
    FRM-13008 Cannot find JavaBean with name 'ji.applet.jiApplet.class'.
    Appreciate any info to get this going.

  • Can anyone give me a bean for JAVAMAIL in JSP?

    Can anyone give me a bean for JAVAMAIL in JSP?
    I'd like to use a bean instead of writing a complete jsp page for each of my send mail options!!

    Have a look in the javaMail forum, youll find code for a class in there without too much trouble.

  • How can i print only pages which have been highlighted, from a multi page file?

    How can i print only pages which have been highlighted, in a multi page file.

    Ah, I see want you mean. This might not be practical for you, but if you select one instance of the highlighted text and add a [space] to the little sticky note, all of the highlighted text on that page will appear in the summary.

  • How do I print selected pages from a multi page document

    How do I print selected pages from a multi page document?
    This question was solved.
    View Solution.

    Hi,
    It depends on the software you are using, what is it ? In general you can select a range or just a number of pages.
    Regards
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

Maybe you are looking for

  • BI Server Fails for No Apparent Reason

    Hi, I have a problem I cannot explain in that our BI Server continually fails for no apparent reason. We have OBIEE+ installed on Windows Server 2003 together with Oracle 10g. The OTM Advanced Analytics repository &.catalog has been installed with th

  • Free Text in Sales Order

    Hi , How can we fetch the free text for a Sales Order . Any inputs on the same would be very helpful. Thanks

  • Several update related issues but one I can't fix ???

    Background: I'm on a PC with Windows XP. Got ATV 2-3yrs ago and use it on a WIRED network. Had the "need to open ports" issue and fixed it. All is good. VERY fast synch speeds and no problems. Love the ATV.....until...intalled latest iTunes update (9

  • BIPublisher + Apex report problem with summary operator

    I design report layout in Microsoft Word with Oracle BI Publisher Tempate Builder. I need to sum two numbers: 2+2 then I create following statement (addition): <?2+2?> In PDF preview I see correct sum: 4 Next I save this report in RTF format and impo

  • How to prefix (-) sign in values column of ALV

    Hi!! every one!!!      can u please let me know how to prefix sign to the values in values column of ALV Report... when negative values r there  its giving sign after the value so how to prefix that sign to the value. please do the needful... thanks