Forwarding and including page

Friends I have a JSP application in which I have option for add,modify and delete records.Now for each option I have different JSP pages i.e. I have Add.jsp,Modify.jsp,Delete.jsp.I using Main.jsp to move around the three JSP.
That is Main.jsp I have code like this
if (request.getParameter("Add") != null)
%>
<jsp:forward page="Add.jsp" />
<%
else
if (request.getParameter("Modify") != null)
%>
<jsp:forward page="Modify.jsp" />
<%
else
if (request.getParameter("Delete") != null)
%>
<jsp:forward page="Delete.jsp" />
<%
Now forward method passes request data in Main.jsp, to the forwarded page also, which I don't want .I want the forwarded page to have no idea of the last page data.Even include method doesn't help me.Is their any solution to my problem.
Help.

You can actually do something like this:
String url = "";
if (request.getParameter("Add") != null)
url = "1stpage.jsp";
else
if (request.getParameter("Modify") != null)
url = "2ndpage.jsp";
else
if (request.getParameter("Delete") != null)
url = "3rdpage.jsp";
response.sendRedirect(url);
Have fun!

Similar Messages

  • Forwarding and including page ...something more

    Basically my requirement is ,I want something like what HREF does,only difference being I want to go to the new page dynamically .I am not bothered about the data of the last page that I used ,to go to my new page.

    you can use a response.sendRedirect(page) where page is the page you want to go to!
    Hope this helps!

  • Embed pdf in website, show one page at a time, with forward and back controls?

    Hi,
    Not sure if this is possible (or if this is the right place to ask), but I need to take a multiple page pdf, embed it in a website so its on the left half of the screen, have it only show one page at a time, and have the forward and back page controls.
    Is this possible, and if so, could someone point me in the right direction?

    Typically you would save it to a JPeg and post those on the web site. Expecting a PDF to show up depends on the client computer configuration and browser. This is too risky, unless you don't mind getting nasty little notes that it does not work. If you do it with JPegs, then all the browsers I know of can handle it. Then simply put the PDF separately for those who prefer to download the PDF and look at it separately.

  • Re; page forwarding and retrieving pr

    Hi
    i am stuck i need to collect a persons name if they are a current member to then forward them to another page using page fowared and passing their name as a property or parameter.
    then on this page i need to then retrieve their name variable and use it to say hello then i need to use this varible to help populate a collections list once they enter some more information for the order.
    where i am stuck i cannot seem to get the varible to transfer and then retrieve it on the new page. can you help .
    the page that takes their name and forwards them to a members page
    <%@ page language="Java" import="java.util.*,pizza.*" %>
    <%@ include file="NoCache.jsp"%>
    <%
    //Process
    List pizzaList = (ArrayList)application.getAttribute("myPizzaList");
    if (pizzaList == null) {
    pizzaList = new ArrayList();
    page.setAttribute("myPizzaList", pizzaList);
    }//endif %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Pizza Club Mian Page</title>
    </head>
    <body>
    <CENTER><P><H1>Pizza Club Main Page</H1></P></CENTER>
    <jsp:include page="navigation.jsp" />
    <center>
    <form method="POST" action="<%pageContext.getPage();%>">
    <p>
    </p>
    <table width="400" height="80" border="1">
    <tr>
    <td>Please input your Name to sign in</td>
    <td><input name="name" type="text" value=""> </td>
    </tr>
    <td> </td>
    <td><input type="submit" name="submit" value="Submit" /> </td>
    </tr>
    </table>
    <p>  </p>
    </form>
    </center>
    <jsp:useBean id="myPizzaEater" class="pizza.PizzaEater" scope="page"/>
    <jsp:setProperty name="myPizzaEater" property="*"/>
    </jsp:useBean>
    <%
    if(request.getMethod().equals("POST")){
    if (myPizzaEater.getName() == null || myPizzaEater.getName() == "Guest" ){
    out.print("you didnt enter a Name please enter a Name");%>
    <br><blockquote></blockquote>
    <%}else{%>
    <jsp:forward page="currentMember.jsp">
    <jsp:param name="myPizzaEater" value="name" />
    </jsp:forward>
    <%}
    }//endif %>
    </body>
    </html>
    this is the current members page that is to recieve the name variable
    <%@ page language="Java" import="java.util.*,pizza.*" %>
    <%@ include file="NoCache.jsp"%>
    <%
    //Process
    List pizzaList = (ArrayList)application.getAttribute("myPizzaList");
    if (pizzaList == null) {
    pizzaList = new ArrayList();
    application.setAttribute("myPizzaList", pizzaList);
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Current Member</title>
    </head>
    <body>
    <jsp:useBean id="myPizzaEater" class="pizza.PizzaEater" scope="page"/>
    <jsp:setProperty name="myPizzaEater" property="*"/>
    </jsp:useBean>
    <form method="POST" action="<%pageContext.getPage();%>">
    <p>
    </p>
    <table width="655" height="152" border="1">
    <tr>
    <td>Hello</td>
    <td> <%myPizzaEater.getName();%></td>//this is where i have been trying to retrieve the variable forme the passing page
    </tr>
    <tr>
    <td>Do you Prefer Halal</td>
    <td><select name="halal" size="1">
    <option value="true">Yes</option>
    <option value="false" selected>No</option>
    </select></td>
    </tr>
    <tr>
    <td>How Many Meat Pizza Slices would you like
    </td>
    <td><input name="meat" type="text" value=""></td>
    </tr>
    <tr>
    <td>How Many Vegitable Pizza Slices would you like
    </td>
    <td><input name="veg" type="text" value=""></td>
    </tr>
    <tr>
    <td> </td>
    <td><input type="submit" name="submit" value="Submit" /> </td>
    </tr>
    </table>
    <p>  </p>
    </form>
    <%
    if(request.getMethod().equals("POST")){
    if (myPizzaEater.getName() == null || myPizzaEater.getName() == "Guest" ){
    out.print("you didnt enter a Name please enter a Name");%>
    <br><blockquote></blockquote>
    <%}else{
    boolean NameExists = false;
    if (!pizzaList.isEmpty()){
    String myName = myPizzaEater.getName();
    Iterator itr = pizzaList.iterator();
    while(itr.hasNext()){
    PizzaEater nextPizzaEater = (PizzaEater)itr.next();
    String nextName = nextPizzaEater.getName();
    if(nextName == myName){
    NameExists = true;
    if(NameExists == true){
    out.print("i am sorry that name already Exists");%>
    <br><blockquote></blockquote>
    <%}
    if(NameExists == false){
    pizzaList.add(myPizzaEater);
    if(pizzaList.size() == 0){ %>
    <p>No members in collection</p>
    <%}else{
    ListIterator litr = pizzaList.listIterator(0);
    while(litr.hasNext()) {
    out.print(litr.next());%>
    <br>
    <%}
    } //endif %>
    </body>
    </html>

    ok i have solved the problem of passing the variable to the second page got other problems of i made the scope of the list on the first page page scope but it has survived to the second page any ideas

  • Forward from an included page

    When we try to <jsp:forward> from an included (<jsp:include>) page, the
    rest of the page that includes gets rendered after the forwarded page.
    Let's say "main.jsp" includes "subpage.jsp". If there is an error in
    "subpage.jsp", we want to forward in to an eror page called "error.jsp"
    However, after the "error.jsp" is rendered, the remaining section of the
    main.jsp (after where the include is made) is rendered as well. So we
    see the contents of "error.jsp" and remaining-sections of "main.jsp" in
    a single page.
    Is there a way to stop this?
    Thanks

    It is very odd to fw: from an included page. Very odd. Forward basically
    means "go somewhere else to render the page" and include basically means
    "while rendering this page, include something from somewhere else". It is
    handy to code a servlet, for example, without any presentation logic, and so
    at the end of its processing, it just forwards to a JSP or HTML page or XSL
    processor. It is handy from within a JSP to include a standard page heading
    and a standard left navigation pane and a standard right navigation pane and
    a standard footing so your JSP has includes to suck those things in.
    Cameron Purdy
    "Muhtar Akbulut" <[email protected]> wrote in message
    news:[email protected]..
    When we try to <jsp:forward> from an included (<jsp:include>) page, the
    rest of the page that includes gets rendered after the forwarded page.
    Let's say "main.jsp" includes "subpage.jsp". If there is an error in
    "subpage.jsp", we want to forward in to an eror page called "error.jsp"
    However, after the "error.jsp" is rendered, the remaining section of the
    main.jsp (after where the include is made) is rendered as well. So we
    see the contents of "error.jsp" and remaining-sections of "main.jsp" in
    a single page.
    Is there a way to stop this?
    Thanks

  • How can I forward an email and include the attached images?

    I sent a client an email with attahced images (I attached the images, pictures I took).  The client responded with the images attached to the response.  When I try to forward that response to a third party the attached images become place holders only, no image. 
    Shouldn't my forwarded mail include the images?  Short of re-attaching the images how can I get them included in the forwarded email?

    I tested a few I forwarded to myself and I could still forward with attachments. You might try Redirecting it (Message menu).

  • In latest version of MF there`s missing button, which was in previous version: between buttons back/forward and the typing bar there used to be little flash, which showed few last pages I have just browsed. How can I restore it?

    In latest version of MF there`s missing button, which was in previous version: between buttons back/forward and the typing bar there used to be little flash, which showed few last pages I have just browsed. How can I restore it?

    If you mean the drop marker then you can still get the History of the Back and Forward buttons if any by either Left-Click and hold for a second or by Right-Clicking them.
    If you still want the drop mark there also then there is this Extension at https://addons.mozilla.org/en-US/firefox/addon/backforward-dropmarker/
    Also the abbreviation for Firefox is '''Fx'''

  • In Firefox 3.6.10 I was able to go forward and backwards between pages without the page defaulting to the top of the page. Is there any way to prevent the page from automatically moving to the top when using the forwards and back buttons in Firefox Four?

    I like to be able to navigate backwards and forwards without having to scroll down and find where I was previously. In Firefox Four, when using the forwards and back buttons, the page will automatically return to the top of the page. Is there any way to change this setting in Firefox Four to prevent it from doing that?

    Thanks for the response. No Time Machine, but I probably have a backup from a few months ago on an external hard drive. :/ I guess it'd have useful history, but not if it overwrote the last 3 months or so of Awesome Bar, that might not be so great.

  • What are the parameters "page-forward" and "page-backward"  used for?

    In the LIMITS section of the Netscape Calendar Server configuration
    documentation, there are two parameters called "page-forward" and
    "page-backward." The default setting for these parameters is FALSE. However,
    it is unclear what these parameters are used for.
    <P>
    With previous versions of Calendar Server, you could scroll one page forward
    or one page backward through the user search screens. However, with the
    implementation of LDAP in later versions, the options have been disabled in
    the client.
    <P>
    Although the page-forward and page-backward parameters are documented in the
    Administrator guides for Calendar Server versions 3.5 and 4.0, the guides
    state that the default value of FALSE for both parameters cannot be
    changed. In actuality, the parameters can be changed. However, the reason
    that users should not change these parameters is that versions 3.5 and 4.0
    do not support the page-forward and page-backward capabilities. So to avoid
    errors, please do not change these parameters from the default value of FALSE.

    if AdobeRGB is the more professional working space, then why not use that profile?
    on the web (and in unmanaged and broken work flows) sRGB is the safest profile (source space)
    just open your tagged Adobe RGB and tagged ProPhoto RGB document (use the embedded profile in each document)
    and go to View> Proof Setup: Monitor RGB (notice the loss in saturation? that's how most of the people on the Internet will be viewing your color, assuming you have a standard-gamut monitor like most people)
    always CONVERT to sRGB for the World Wide Web
    i didn't read your link
    anyone who recommends "disable color management in Photoshop" -- set Working RGB to "Monitor RGB" -- AND MOST UNBELIEVABLY -- "Don't color manage this document" (ignore embedded profiles) ------ is pretty mixed up (in my opinion)
    i will recommend reading JEFF SCHEWE and BRUCE FRASER for professional color management information

  • Sales and purchase journal - balance carry forward to next page

    Hi all,
    When we run sales and purchase journals in transaction S_ALR_87012357 (Belgium) and print it we want a summary per page and balance carry forward to next page.
    The paging is correct by selecting "statistical info not printed" in output control but we don´t want only summary on last page, instead on every page and a total summary on last page.
    Does anyone knows how to mangage this?
    Best regards Lisa

    With a developer implement a the BADI  FI_TAX_BADI_010

  • Difference between page and include in jsp

    difference between <%@ page import="foo.*"%> and <%@include file="foo.*"%> in jsp

    The one imports a class for the code and the other includes a resource for the output. Those are in no way comparable with each other.

  • When I last up dated Firefox the forward and back arrows dissapeared. Now if I want to go back I have to go to History to get back to previous page. How do I get these forward and back arrows?

    On MSN web sight there use to be forward and back arrows on the left hand upper side of page that let me go forward and back from page to page. Now the arrows are gone and I have to use the History or Bookmarks to move back and forth.
    The arrows didn't reappear when I up dated to the new foxfire.

    Click the Firefox button, go to Add-ons, then Plugins and disable the following:<br><br>
    * Fun Web Products Plugin<br><br>
    * My Web Search<br><br>
    Both of these are adware/spyware and cause performance issues in Firefox.
    Next, click the Extensions menu link (above Plugins where you are) and remove the "Ask Toolbar".
    If the problem persists, please do the following:<br><br>
    #Click '''Help '''| '''Restart with Add-ons disabled'''.<br><br>
    #In the next menu which appears, checkmark: "'''Reset toolbars and Controls'''".<br><br>
    #Finally, click the button called "'''Make changes and restart'''".
    Just in case you weren't aware of it, you can right click the Back or Forward buttons to get a list of sites visited. If you'd like to see the return of the arrow on the Back button, install this add-on: https://addons.mozilla.org/en-US/firefox/addon/backforward-dropmarker/
    Last but not least, some of your plugins are seriously out of date which exposes your system to exploits. Please visit the [http://www.mozilla.com/en-US/plugincheck/ Plugins Check] page and update where necessary.
    See: http://www.adobe.com/support/security/bulletins/apsb11-08.html

  • Pass Parameter from main page to include page (subview) and read it ?

    Hello All
    i have an include header.jsp page in main page.jsp ,and i included it by subview.
    i want to pass a parameter ex(screen name) to the subview by using f:param.
    Here is the code in main.jsp:
    <f:subview id="headerSubView">
    <jsp:include page="/commons/header.jsp" flush="true">
    <jsp:param name="screenTitleByJspParam" value="screen2007"/>
    </jsp:include>
    <f:param name="screenTitleByFparam" value="screen2007"/></f:subview>
    Code in header.jsp
    1- <af:outputFormatted value="#{param.screenTitleByJspParam}"/> -- this dose not work
    2- <af:outputFormatted value="#{param.screenTitleByFparam}"/> -- this dose not work (i want this manner)
    So how i can send parameter by ]<f:param and read it by subview uesing adf/jsf tags ?
    Regards
    Mohd.Weshah
    weshah79

    Dear thanassis
    Thanks for you help ,your code is working successfully but my case is the following :
    same your main jsp page but the subview tag in table :
    <%@ page contentType="text/html;charset=windows-1256"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1256"/>
    <title>main</title>
    </head>
    <body>
    <h:form>
    <afh:tableLayout>
    <afh:rowLayout>
    <afh:cellFormat>
    <f:subview id="header">
    <jsp:include page="header.jsp" flush="true">
    <jsp:param name="pageTitle" value="Modify aa record"/>
    </jsp:include>
    <f:subview>
    </afh:cellFormat>
    </afh:rowLayout>
    </afh:tableLayout> </h:form>
    </body>
    </html>
    </f:view>
    try it the parameter dose not work ,but if you want that code work successfully move the subview out of the table.
    Do you know what is the problem ?
    i want give you another hint maybe it is realted to the same problem, which is in my original page the body tag is adf tag ie(<afh:body>) your code dose not work with that tag until i changed the afh:body to html body.
    Regards
    Mohd.Weshah

  • ADF Faces: included pages and bindings

    Hello all,
    I want to create a page with a panelSplitter, where the left panel has some sort of selection menu and the right panel displays a page depending on the selection made.
    I am displaying the pages with ppr using f:subview and jsp:include. I have already learned that the bindings for the included page must be in the pageDef of the enclosing form for it to work properly. Now I found a post in the forum where someone said that in JDev 11 it would be possible to include one pageDef into another pageDef. Is that feature already available in the 11g Preview? If so, how do I use it?
    Thanks,
    Achim

    Achim,
    Including a .jsff page in a jspx/jsp page with the jsp:include tag will not include any pageDef associated with the page fragment. Instead you can include a page fragment in a page by creating a task flow that contains the fragment you wish to reference and then include the task flow in you jspx via an af:region. Below is a link to an online demo the illustrates how-to create a task flow.
    http://www.oracle.com/technology/products/jdev/viewlets/11/index.html
    --Ric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Trouble with using several page tag in pagedef and including jsff-page

    Please, help!
    I have the .jsff-page with table (refNMU.jsff with own pagedef), which used as ref-book on main page. On main page it simple include in dalog content:
                  <af:popup id="dlgNMU">
                    <af:dialog>
                      <jsp:include page="/Refs/refNMU.jsff"/>
                    </af:dialog>
                  </af:popup>In main pages pagedef I include the pagedef of jsff-page:
        <page id="PD_refNMU" path="Refs.refNMUPageDef" Refresh="ifNeeded"/>and in jsff-page replace binds from
    bindings.refNMUView.collectionModelto
    bindings.PD_refNMU.refNMUView.collectionModelIt`s work fine.
    But if I add two ref-book (in main pages pagedef insert two <page> tag before existing ("PD_refNMU") then table on refNMU.jsff page "no row yet" show (but "estimatedRowCount" method work fine).
    If I move <page> tag on first position then its work fine again, but the other two jsff-page not working ("no row yet" in table or "QueryModel object not defined" in console)!

    Hi,
    binding file references are supported for template bindings only and here you are allowed to have a single template only. So what you try is not supported. Please use a region for adding the page fragment (bounded taskflow) or copy the bindings into the main file
    Frank

Maybe you are looking for

  • Trying to use UK iPhone 5s abroad

    Hi I have a UK bought iPhone 5s. It's a1457 model. I am trying to use it in South Korea on 4G LTE and their iPhone 5s are all a1530 models. I was wondering if it's possible to use my a1457 over there. The essence of the question is if it's possible t

  • I want to reset my ipod touch 4th gen but i have forgotten the restrictions passcode and for some reason its not working on my laptop on itunes and the restore thing wont work! any help?

    I want to reset my ipod touch 4th gen but i have forgotten the restrictions passcode and for some reason its not working on my laptop on itunes and the restore thing wont work! any help?

  • How to read Active Directory?

    Hello, I am experienced in the Oracle database, but not in the Application Server or any of its components. We have a Forms application which maintains its users in it proprietary Oracle database tables. I need to link them to our employees in the HR

  • Php form error?

    Hi. I've got php form from one of the templates but it doesn't work. Can anyone see an error? The code: <div id="content_item">           <h1>Contact Us</h1>           <p>Say hello, using this contact form.</p>           <?php             // Set-up t

  • Podcast rejected, can't get it to resubmit...

    I have had a podcast on itunes for the past 3 years.  I recently switched servers, so I stuck a HTTP 301 redirect on the old feed to send it to my feedburner page.  Almost immediately I received notice from Apple that my show had been rejected from t