Nested request dispatches when using RequestDispatcher in a Button action

Hi all,
I am new to JSF so I am probably missing something very simple, please help:
The test case is simple: I created one visual web page with one button and one normal JSP file(named test.jsp) using Netbeans 5.5 with visual web pack on Sun Application Server 9 PE. The code action for the button is as follows:
public String button1_action() throws Exception
        ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
        HttpServletRequest request = (HttpServletRequest) context.getRequest();
        HttpServletResponse response = (HttpServletResponse) context.getResponse();
        RequestDispatcher dispatcher = request.getRequestDispatcher("test.jsp");
        dispatcher.forward(request,response);
        return null;
    }Once the JSF page is loaded and the button is clicked, this exception occurs:
ApplicationDispatcher[WebApplication1] Servlet.service() for servlet Faces Servlet threw exception
javax.servlet.ServletException: WEB2651: Exceeded maximum depth for nested request dispatches: 20
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:837)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:697)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:532)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:465)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:353)
at webapplication1.Page1.button1_action(Page1.java:242)
Can anyone provide any advice on how to resolve this issue?

Hi Rachel,
As per the Servlet2.3 Javadoc:
The pathname must begin with a "/" and is interpreted as relative to the current context root.
If you make that change and include the complete path, then it would work fine.
Ex:
If your context looks like http://my.company.com/webapp1/ and if you were to have your forwardPortlet.jsp in a directory like:
webapp1
  |
  |-> htdocs
         |
         |-> forwardPortlet.jsp
then, your code would look like;
RequestDiscpatcher d = request.getRequestDispatcher("/htdocs/forwardPortlet.jsp");
HTH,
thanks,
harsha

Similar Messages

  • When using the up/down buttons in the Inspector, how do I get them to move by .01, instead of default, which is always too much.

    When using the up/down buttons in the Inspector, how do I get them to move by .01, instead of default, which is always too much.

    Feature unavailable.
    Most of the time it's more efficient to type directly the wanted value.
    Yvan KOENIG (VALLAURIS, France) mercredi 1 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How to use the cases in button action?

    Hi Experts,
    I want to get a prompt message if the field is empty.I got it but at the same time if the field is filled I want the other action to be performed that is to call a BAPI and give me output.How can I give two events for the same action.
    How to use the cases in button action?
    So, please guide me.Urgent need
    Regards
    Nutan

    Hi Nutan,
    if I understand you, then you have a simple validation. Therefore you can use the validation functionality of VC for your components. An alternative could be by writing a new ABAP RFC function module like:
    BAPI Input parameters as input and BAPI output parameters as output and an additional return code or string for a message:
    IF I_FIELD IS INITIAL.
      E_RETURN_CODE = "THE FIELD IS EMPTY."
    ELSE.
      CALL FUNCTION <YOUR_BAPI>
      <BAPI PARAMETERS>
    ENDIF.
    I hope that helps.
    Best Regards,
    Marcel

  • How to specify target when using RequestDispatcher !

    Can anybody tell me where do i specify target while using requestDispatcher ?

    I belive that what you want is @
    http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletRequest.html#getRequestDispatcher(java.lang.String)
    Best of luck.

  • Hi, is it possible to create a page transition similar to jquery when using a 'nav to' button?

    I am creating an iPad app and wish to have a menu from which when pressed will take the user to other pages within the same app. For this I am using a 'navto://' URL button with the file name and page number following within the code (e.g. navto://filename#1). In the Folio overlay preview, the desired page transition effect similar to jquery occurs but this is lost when uploaded to the iPad. Does anybody know if you can control the page transition effect?

    What folio overlay preview are you talking about? There are no page transitions in DPS.
    Bob

  • How to change the search provider when using the Firefox Home Button Search feature?

    In Firefox itself I have configured duckduckgo as my default search provider.
    But when I use the Firefox Home Button Search it is always set to google and I do not see any option to change that?
    I like the Firefox Home Button Search (or whatever it's called) otherwise, but it's annoying that it does not use the default from Firefox.
    I use the Google Now Launcher.

    ''philipp [[#answer-704494|said]]''
    <blockquote>
    ...usually it will be enough to switch the default engine in firefox back and forth once to work around the issue...
    </blockquote>
    Thank you, problem resolved

  • No XML file attachment when using Submit by Email button

    Hello all -
    I'm using LiveCycle Designer 8.0 to create a simple form, and am using the Submit by Email button to return the user supplied data. When I save the form and test it with Adobe Acrobat Professional 8.1.1, the email goes through just fine, but there is no attachment. No XML file, no nothing. Just a blank email with my signature block at the bottom. Has anybody else experienced this? Any ideas on what could be wrong? All I want is the XML file.

    You have multiple options to sending whole PDF format.
    1) Set the submit button to submit whole PDF format by using a mailto: [email protected] in the submit button action URL.
    2) Set the submit button to fire a javascript that submits whole PDF format. See Adobe's Javascript reference guide for instructions.
    Note: Methods #1 and #2 require Adobe Acrobat or Extended Reader Rights; because, Adobe Reader users are restricted to submitting just the data formats; such as FDF,XML, XFDF, XDP, and HTML. Beware extending reader rights to a PDF form using Adobe Acrobat places end user EULA restrictions, such as not more than 500 end user submissions for each form.
    My Recommendations:
    #3) Set the submit button to point to a URL of a server-side script; such as ASP.net. Then set the format to a data format; such as FDF, XML, XFDF, or XDP; and use ASP.net and iTextSharp (Free) to merge the data with a blank PDF form; and attach the submission to an outbound SMTP mail message and send without 3rd party email software such as MS OUTLOOK.
    #4) A combination of #1 and #3; where you enable usage rights on the PDF using Adobe Acrobat; and send to a server-side script which bypasses client-side email software.
    Check out the following website for online examples that submit to a server side script:
    www.pdfemail.net/examples/

  • When using mail, my resize button and my down arrow on the side schroll bar appear in the same position making use of both impossible.

    A line is missing at the bottom of the screen just above the dock window on my macintosh. Using Mac OS X, version 10.6.7

    I indicated that I have this problem too, or at least a related one, but I wanted to add some details. In my case, using gmail, the resize button actually isn't even visible. But when I try to put the mouse on the line-scroll arrow at bottom right, the cursor changes to the resize cursor, and I can resize from there (with the mouse a good bit above where the resize button should be). So I think it's the same problem reported by this user. As indicated, it's impossible to use the line-scroll button in this mode. I don't seem to have the problem on other web pages, or at least not that I've noticed. I just obtained Firefox 4, so I think I've got an up-to-date copy, and I'm running on Windows XP, SP2. And other than this, I *really* like FF4--that tab organization feature is absolutely stunning in its usefulness. Oh, and, in case it matters, I'm also running the gmail under the "pinned tab" option.

  • When using the google search button my queries are always redirected to another site, and not google as indicated as my preferred search engine.

    I have to open up an Internet Explorer browser when I try to to a search for anything. Even though I've selected google as my default search engine, I still get redirected to some random site. It's useless. I would like to use Firefox all the time, but I cannot do so.

    Do a malware check with some malware scan programs. You need to scan with all programs because each program detects different malware. Make sure that you update each program to get the latest version of the database before doing a scan.
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and Searches are redirected to another site

  • PSE crashes when using a "close"-Step in Action Player

    Hello,
    i've create an action in my regular Photoshop, which includes a step where the picture is closed without saving the changes.
    When i run this action in the PSE action player it will complete every step, but the PSE application crashes at the end.
    Without the closing step in the action-set, there is no problem.
    I have tried PSE 9 and 10 on different computers (all XP SP3) and i have create the same action in PS CS3, CS5 and CS 5.5 as a source.
    Always the same crash at the end.
    Does anyone have the same problem or even knows a solution?
    Thanks a lot,
    elektrosmogjunkie

    First of all, I've started looking into scripting PSE all of two days ago and don't have a funcitoning PS to use as a test, so take my comments for what they're worth:
    I understand you're talking about an action, but from what I understand from the PS scripting reference there needs to be a "policy" specified for closing a document from a script -- specifying the SaveOptions (save changes, don't save changes, prompt to save changes) to the Document.close() method.
    I suspect that your recorded action doesn't have your answer to the "Save changes?" prompt window in the recorded steps.  If you can't somehow get the "Don't save" option into your action, you might want to try re-creating the action as a script (where you can specify the SaveOption).
    Ken

  • When using the right mouse button in Yahoo mail inbox (Firefox 8.0.1, Win 7, Yahoo Mail Plus) the Firefox navigation window (Back, Forward etc...) is on top of the Yahoo email menu (Open, Print, Reply etc...). This happens in Firefox safe mode as well.

    This also happened in Windows XP which I was using until recently.
    The Yahoo mail menu is there but the Firefox menu is on top of it. I tried Firefox safe mode with everything disabled and the problem still happened. I tried Yahoo mail in IE 9 and the right mouse button works correctly.

    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    Use a compressed image type like PNG or JPG to save the screenshot and make sure that you do not exceed the maximum file size (1 MB).
    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).<br />
    If you are in full screen mode then hover the mouse to the top to make the Navigation Toolbar and Tab bar appear.<br />
    You can click the Maximize button at the top right to leave full screen mode or right click empty space on a toolbar and use "Exit Full Screen Mode" or press F11.<br />

  • Is it possible to customize the email heading (subject) when using a email submit button

    I have created a button for inserting a completed form into an email. Being the button auto inserts is it possible to customize how the button
    titles the email & subject upon insertion?

    You can have more control on the email subject/ to and CC Email address, if you use a regular button and place the code in the click event.
    Refer to the attached sample below.
    https://acrobat.com/#d=HouRLov3lOntSbqAfsr5Hg
    Thanks
    Srini

  • Unable to use Request Dispatcher; Duke $ Post;

    I am using a Controller Servlet to transfer control to a JSP using Request Dispatcher within doPost()
    RequestDispatcher rd;
    rd=req.getRequestDispatcher(URL);
    rd.forward(req,resp);
    I am seting a request object
    req.setAttribute("XXX",obj.func());
    prior to the Redirect;
    The page gets redirected to a JSP. I am unable to access req object in there.
    if i use
    String XXX = req.getAttribute("XXX");
    i get an error in the jsp as
    "req cannot be resolved"
    Do i need to import some directives? Please Reply

    The page gets redirected to a JSP. I am unable to
    access req object in there.
    if i use
    String XXX = req.getAttribute("XXX");
    i get an error in the jsp as
    "req cannot be resolved"
    Do i need to import some directives? Please ReplyThat's simple. Your req (which is the HttpServletRequest object) in the servlet becomes request in the JSP. That's always there. The compiler would not recognize req
    Use request.getAttribute("XXX"); in JSP
    Regards
    ***Annie***

  • Error message when using JSP pages

    Version 6.0
    The error I'm getting is as follows:
    trying to POST headerFragment.html, internal-redirect reports: no way to service request for headerFragment.html
    All I'm trying to do is a jsp:forward on JSP page 1 to JSP page 2 which, at the top of it, has a jsp:include (the headerFragment.html page mentioned in the error).
    Any thoughts on how to remedy this problem would be appreciated.
    Thanks,
    Mark

    By default, the server will not serve static files in response to POST requests, even when using jsp:include.
    This bug was addressed in 6.0 SP2, but instances created in an earlier release will continue to exhibit the problem even after upgrading. To fix the problem, locate the following line in the obj.conf configuration file:
    Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-fileChange the above line so it reads as follows:
    Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file

  • Button not working when using JumpTo Captivate 8

    I seem to be having a problem when using smart objects as buttons, I select use as button, select jumpto and select the slide , in this case home, I have named the home slide home, but when previewing the button doesn't work, this is pretty basic and I'm just about to start a large project , am I missing something or doing something wrong? Would appreciate some help please. 
    Many thanks
    Sue

    Hi there
    Do you by chance have question slides? If so, it's possible that you are disallowing backward movement.
    Quiz > Quiz Preferences > Settings.
    Cheers... Rick

Maybe you are looking for

  • Problems with string comparing

    I have a function, getPlayerName() that returns the contents of a text field, but i want the dialog box to check and see if there was anything typed in there, so i have done things like if(this.getPlayerName() != null), if(this.getPlayerName() != "")

  • Calendar App Broken

    I've got a Centro, on AT&T, with an IBM ThinkPad running XP PRO as my computer.  Hotsync is with the Desktop software, through the USB cable. Computer is up to date with all windows software updates. Phone is not used for e-mail, or internet browsing

  • Does my warranty cover the mac book pro charger?

    I got a new Mac Book pro for Christmas and the charger already stopped working. Luckily I had an old one. Anyone know if my warrantly will cover the dead charger? Not trying to spend like 75 bucks on a new one.

  • Road Permit at the time of GR

    Hello All, I want to know,whether in std SAP "the details of Road Permit can be given at the time of GR"..? Plz revert me back..

  • User not disabled after end date (9i)

    Hi All, The Disable after end date schedule task disabled 7 users but did not disable 1 user. Any know issue around this. Thanks Don