Proper use of RequestDispatcher.forward()

I have a servlet, and want to forward on to an error JSP page for
          exceptions. Is RequestDispatcher.forward() supposed to return to the
          source servlet when the target is finished?
          I am using a return to stop the source servlet when the target is
          finshed. Is this the correct behavior? Isn't this behavior very
          similar to to include(), or is the only difference that include() does
          not clear the source servlet's response buffer?
          TIA,
          Alex
          

Alexander,
          The forward kindof has to return to the source servlet because that's
          where it's called from(unless it threw an exception). A servlet that
          performs a forward is meant to do preliminary processing of the request and
          allow another resource to generate the response. You are right in that it is
          basically an include that clears the buffer. If you want it to make a whole
          new request you should probably use a redirect.
          The weblogic docs help clarify things a bit(as well as the regular
          javadocs). http://www.weblogic.com/docs51/classdocs/API_servlet.html#129331
          Hope this helped.
          -jeremy
          Alexander Kowalyshyn <[email protected]> wrote in message
          news:[email protected]..
          > I have a servlet, and want to forward on to an error JSP page for
          > exceptions. Is RequestDispatcher.forward() supposed to return to the
          > source servlet when the target is finished?
          >
          > I am using a return to stop the source servlet when the target is
          > finshed. Is this the correct behavior? Isn't this behavior very
          > similar to to include(), or is the only difference that include() does
          > not clear the source servlet's response buffer?
          >
          > TIA,
          >
          > Alex
          >
          

Similar Messages

  • Return; after RequestDispatcher.forward();

    I notice that some examples using return; keyword right after the line with RequestDispatcher.forward(request, response);
    Can anyone pls explain when and why we do this?

    Thanks a lot BalusC. Can't believe I am so damn dumb not noticing that there were more codes after that block of codes....

  • RequestDispatcher.forward() bug in WLS61???

    Hi
              attached is a web application called forward that demonstrate a possible
              bug in weblogic 6.1 server.
              Description of the application
              index.html:
              <html>
              <head>
              <title>form</title>
              </head>
              <body>
              <form name="form" method="post" action="forwardServlet">
              <input type="hidden" name="nextPage" size="20"
              value="result.jsp">
              </form>
              <script language="javascript">
              document.forms["form"].submit();
              </script>
              </body>
              </html>
              the index.html of the application just cause the web browser to send a
              request to the ForwardServlet with a parameter nextPage=result.jsp
              ForwardServlet.java:
              import javax.servlet.http.*;
              import javax.servlet.*;
              import java.io.*;
              public class ForwardServlet extends HttpServlet {
              public void service(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,
              IOException {
              RequestDispatcher disp =
              getServletContext().getRequestDispatcher("/" +
              request.getParameter("nextPage") + "?result=kabooom");
              disp.forward(request, response);
              the servlet forwards the request to the nextPage(result.jsp) using
              RequestDispatcher.forward adding to the URI a parameter result=kabooom;
              result.jsp:
              ****<P>
              <%
              String result = request.getParameter("result");
              out.println(result);
              %>
              <P>****
              the jsp just takes the "result" parameter from the request object and
              prints it. However it gets a null instead of the String kaboom
              We use this method of adding parameters in many places in our application
              and it should work according to the API:
              "For a RequestDispatcher obtained via getRequestDispatcher(), the
              ServletRequest object has its path elements and parameters adjusted to match
              the path of the target resource."
              Everything worked fine in WLS5.1
              P.S
              if ForwardServlet.java looks like:
              import javax.servlet.http.*;
              import javax.servlet.*;
              import java.io.*;
              public class ForwardServlet extends HttpServlet {
              public void service(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,
              IOException {
              RequestDispatcher disp =
              getServletContext().getRequestDispatcher("/result.jsp?result=kabooom");
              disp.forward(request, response);
              and not touching the request object itself the result.jsp will display
              kaboom!!!!
              Dror Last
              Senior Software Engineer
              Unisfair Inc.
              12 Yad Haruzim St. Tel Aviv 67778 Israel
              Tel: +972-3-5373738 Ext. 243
              Fax: +972-3-5373731
              GSM: +972-55-723710
              mailto:[email protected]
              http://www.unisfair.com/
              [forward.war]
              

    Yes, SP1 fixes the problem.
              Thanks,
              Beth
              "Ian M. Goldstein" <[email protected]> wrote in message
              news:[email protected]...
              > Service Pack 1 is available now via WebSupport
              > http://websupport.beasys.com/custsupp/
              >
              > Regards,
              > -- Ian
              >
              > "Robert Patrick" <[email protected]> wrote in message
              > news:[email protected]...
              > > Contact BEA technical support...
              > >
              > > Beth wrote:
              > >
              > > > Hi,
              > > >
              > > > We are having this same problem with WL6.1.
              > > > Where do we get this patch? It doesn't appear that SP1 is out yet.
              > > >
              > > > Thanks,
              > > > Beth
              > > >
              > > > "Andrew" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > >
              > > > > I spoke with BEA about this bug, as we were exhibiting almost the
              > exact
              > > > same behavior.
              > > > > It is definitely a bug, and their engineering department said it is
              > fixed
              > > > with
              > > > > 6.1 SP1 which is due to be released in September. They gave me a
              > patch to
              > > > test,
              > > > > and it did indeed fix this bug.
              > > > >
              > > > > Andrew
              > > > >
              > > > > "Willie" <[email protected]> wrote:
              > > > > >Hi,
              > > > > >
              > > > > >Any update on this one? We are running into the exact same problem
              > and
              > > > > >it is
              > > > > >blocking us from moving into 6.1. The same code worked well in 6.0.
              > Is
              > > > > >this
              > > > > >a WL bug? When is the fix going to be available?
              > > > > >
              > > > > >Thanks!
              > > > > >Willie
              > > > > >
              > > > > >"Dror Last" <[email protected]> wrote in message
              > > > > >news:[email protected]...
              > > > > >> Hi
              > > > > >>
              > > > > >> attached is a web application called forward that demonstrate a
              > > > possible
              > > > > >> bug in weblogic 6.1 server.
              > > > > >>
              > > > > >> Description of the application
              > > > > >> ------------------------------------------
              > > > > >>
              > > > > >> index.html:
              > > > > >>
              > > > > >> <html>
              > > > > >> <head>
              > > > > >> <title>form</title>
              > > > > >> </head>
              > > > > >> <body>
              > > > > >> <form name="form" method="post" action="forwardServlet">
              > > > > >> <input type="hidden" name="nextPage" size="20"
              > > > > >> value="result.jsp">
              > > > > >> </form>
              > > > > >> <script language="javascript">
              > > > > >> document.forms["form"].submit();
              > > > > >> </script>
              > > > > >> </body>
              > > > > >> </html>
              > > > > >>
              > > > > >> the index.html of the application just cause the web browser to
              > send
              > > > > >a
              > > > > >> request to the ForwardServlet with a parameter
              nextPage=result.jsp
              > > > > >>
              > > > > >> ForwardServlet.java:
              > > > > >>
              > > > > >>
              > > > > >> import javax.servlet.http.*;
              > > > > >> import javax.servlet.*;
              > > > > >> import java.io.*;
              > > > > >>
              > > > > >> public class ForwardServlet extends HttpServlet {
              > > > > >>
              > > > > >> public void service(HttpServletRequest request,
              > > > > >> HttpServletResponse response) throws
              ServletException,
              > > > > >> IOException {
              > > > > >> RequestDispatcher disp =
              > > > > >> getServletContext().getRequestDispatcher("/" +
              > > > > >> request.getParameter("nextPage") +
              > "?result=kabooom");
              > > > > >> disp.forward(request, response);
              > > > > >> }
              > > > > >> }
              > > > > >>
              > > > > >> the servlet forwards the request to the nextPage(result.jsp)
              using
              > > > > >> RequestDispatcher.forward adding to the URI a parameter
              > result=kabooom;
              > > > > >>
              > > > > >>
              > > > > >> result.jsp:
              > > > > >>
              > > > > >> ****<P>
              > > > > >> <%
              > > > > >> String result = request.getParameter("result");
              > > > > >> out.println(result);
              > > > > >> %>
              > > > > >> <P>****
              > > > > >>
              > > > > >> the jsp just takes the "result" parameter from the request
              object
              > > > > >and
              > > > > >> prints it. However it gets a null instead of the String kaboom
              > > > > >>
              > > > > >>
              > > > > >> We use this method of adding parameters in many places in our
              > > > application
              > > > > >> and it should work according to the API:
              > > > > >> "For a RequestDispatcher obtained via getRequestDispatcher(),
              the
              > > > > >> ServletRequest object has its path elements and parameters
              adjusted
              > > > > >to
              > > > > >match
              > > > > >> the path of the target resource."
              > > > > >>
              > > > > >> Everything worked fine in WLS5.1
              > > > > >>
              > > > > >>
              > > > > >> P.S
              > > > > >>
              > > > > >> if ForwardServlet.java looks like:
              > > > > >>
              > > > > >> import javax.servlet.http.*;
              > > > > >> import javax.servlet.*;
              > > > > >> import java.io.*;
              > > > > >>
              > > > > >> public class ForwardServlet extends HttpServlet {
              > > > > >>
              > > > > >> public void service(HttpServletRequest request,
              > > > > >> HttpServletResponse response) throws
              ServletException,
              > > > > >> IOException {
              > > > > >> RequestDispatcher disp =
              > > > > >>
              > getServletContext().getRequestDispatcher("/result.jsp?result=kabooom");
              > > > > >> disp.forward(request, response);
              > > > > >> }
              > > > > >> }
              > > > > >>
              > > > > >> and not touching the request object itself the result.jsp will
              > display
              > > > > >> kaboom!!!!
              > > > > >>
              > > > > >>
              > > > > >> Dror Last
              > > > > >> Senior Software Engineer
              > > > > >> Unisfair Inc.
              > > > > >> 12 Yad Haruzim St. Tel Aviv 67778 Israel
              > > > > >> Tel: +972-3-5373738 Ext. 243
              > > > > >> Fax: +972-3-5373731
              > > > > >> GSM: +972-55-723710
              > > > > >> mailto:[email protected]
              > > > > >> http://www.unisfair.com/
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >>
              > > > > >
              > > > > >
              > > > >
              > >
              >
              >
              

  • Differences between (response.sendRedirect and Requestdispatcher.forward)

    Hi All,
    I have 3 queries
    *1> I wanted to know the "Differences" between*
    response.sendRedirect and Requestdispatcher.forward
    *2> when do we Opt for response.sendRedirect?*
    *3> when do we Opt for Requestdispatcher.forward?*
    Thanks,
    Deepak AL

    The fundamental difference is that sendRedirect is a client based direction, while forward is a server based one.
    SendRedirect forces the client to make a new request. In effect you are telling the client browser "What you are looking for is over there"
    RequestDispatcher forward, is purely an internal server transition. The client knows nothing about the forward happening.
    Example
    Lets say you request the page www.myserver.com/myPage.jsp
    Example A: Redirect
    We send a redirect to www.myserver.com/thatPageOverThere.jsp
    The browser receives this message, and its address url changes to www.myserver.com/thatPageOverThere.jsp, and it sends a new request over there.
    Note that it is a completely new request, so any parameters that were sent with the old request are irrelevant. If you want to send them again you have to put them into the sendRedirect url.
    You can also send a redirect to www.myOtherServer.com/thatPageOnACompletelyDifferentServer.jsp
    Example B: Forward to thatPageOverThere.jsp
    We obtain a request dispatcher to "thatPageOverThere.jsp" and forward to that resource.
    The server instead of running myPage.jsp now executes and returns thatPageOverThere.jsp
    The client browser knows nothing of this. As far as it knows it asked for myPage.jsp, and it is getting that response back.
    So if you forward to something like "my/page/inASubFolder.jsp" you have to be very careful with relative links on the page.
    The browser requested myPage.jsp, so it will resolve relative links from that Url.
    When to use one or the other?
    Redirect would need to be used when the resource is on another server.
    Another common usage is the "Post-Redirect-Get" pattern. (you might want to look that up)
    Hope this helps you understand a little.
    cheers,
    evnafets

  • How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to.

    How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to, so setting up an account with the correct reply-to address doesn't work because there's no associated outgoing mail server.  I had this working under iOS4 but it seems to have disappeared when I upgraded to iOS5.

    Welcome to the forum, NicoleYM. I don't think the Touch Mail has as many options as the Mac Mail app. However, you could set a standard signature. Go to Settings > Mail, Contacts, Calendars > Signature. There you can type a reply address and hope people see it.
    Alternatively, you can go to your GMail account in your web browser and click on Settings > Forwarding and POP/IMAP. There you will have an option to forward all emails (or only some, if you set up a filter) to your other address.
    Good luck!

  • I have lost the use of the 'forward' and 'back' button

    On Win 7 I have lost the use of the forward and back button - both are greyed out - except on this page ??? when I leave this page the greyed out appears on all tabs or links in use. I am using Firefox 3.6.16. To get to this page I have 7 tabs open at present and all ( except this one - odd! ) are greyed out.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    See:
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.com/kb/Firefox+crashes
    If you have submitted Breakpad crash reports then post the IDs of one or more Breakpad crash reports (bp-xxxxxxxx-xxxxxxxxx-xxxx-xxxxxxxxxxxx).
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    You can open the <b>about:crashes</b> page via the location bar, like you open a website.
    See:
    *http://kb.mozillazine.org/Breakpad (Mozilla Crash Reporter)

  • Proper Use Of Sessions

    Hi everyone,
    My fellow developers and I were having a discussion as to the proper use of sessions in a web application built with Servlets. The situation was we were building a method to get search results from a database and we wanted to have the ability to limit the number of results displayed per page.
    One method of doing this was to get the entire search result, load that into a hashtable or some other data structure, and put that into a session variable to preserve the hashtable.
    The other method was to re-query the database every time the person clicked the 'view next' button and get a new result set every time.
    I tend to favor the use of session variables to maintain the ResultSet...as I was taught that database connections are expensive and should be limited. However, according to one of the other developers, storing objects (especially when they are potentially large) in session variables is not recommended.
    So what do you guys think? Should be store large objects in session variables, or should we re-query the database every time the person loads the page?
    As a side note, the servers we use are quite robust, but we know that that is not an excuse to write in-efficient code.

    Its a trade off between memory and database access.
    Storing stuff in session is expensive in terms of memory.
    The more stuff you store in session, the more overhead there is with each user of the system.
    Querying the database each time saves you memory on the app server, but means more work for the database.
    Which is better? As always it depends.
    - How many users are projected for the system? More users means you want to keep the session as light as possible.
    - Is the query is hugely expensive to run? A long running query that only returns a few records - you would want to cache that in session.
    - Are you able to limit the result set data returned via the database? Some database support this, some don't. ie if you did a database query each time would you have to step through "5 pages" of data to get to display the "6th" page, or could you just get the data for page 6 using row numbers?
    Database connections themselves aren't that expensive to acquire if you are using connection pooling, but they are still a limited resource.
    Hope that helps some,
    evnafets

  • Proper use of END-OF-SELECTION event in report programme

    Hi,
    If we will write "WRITE" statements in side START-OF-SELECTION then it will help me to display the output.Then what is the need of END-OF-SELECTION .
    Can any body please tell me the <b>proper use of END-OF-SELECTION event in report programme.</b>

    This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started.
    <b>In report programs using LDB for every value selected the program issues the output, to control this you would use END-OF-SELECTION.</b> Now if you call your output in this event, the output is made only after all the values are selected as per the selection criteria.
    suppose while coding, u need a logic like below:
    if a condition is satisfied continue with the report
    and if not satisfied, then display a message and end the report.
    then u can code like below.
    start-of-slection.
    if a = <condition>.
    do the following.......
    else.
    stop.
    end-of-selection.
    write: 'THIS IS END'.
    stop command triggers end-of-slection from anywhere.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Proper use of Field symbol .. please help

    what is the proper use of field symbol in sap abap ?
    Moderator Message: Please do a proper search for such basic questions.
    Edited by: kishan P on Sep 13, 2010 4:01 PM

    hi Gopal,
    The parameter is used to color a cell in ALV grid.
    See this example how it is used
    http://www.sap-img.com/abap/line-color-in-alv-example.htm
    take a closer look at the code where the info is passed
    MOVE 'MATNR' TO wa_color-fname.
            MOVE '6'         TO wa_color-color-col.
            MOVE '1'         TO wa_color-color-int.
            MOVE '1'         TO wa_color-color-inv.
            APPEND wa_color TO it_color.
    Cheers
    VJ
    If it helps dont forget to mark points

  • Proper use of location in metadata

    I'm building my library of images now with LR and want to get started on the right foot. I store on CD. In Metadata "Location" I have entered the CD volume name as a way of identifying where the images are stored. But now I am wondering if the Metadata "Source" under workflow would be a better place to record the CD name such as "2007_03_08b" Can someone point me down the correct path so I don't regret my actions after thousands of images later? Thanks

    <blockquote><span style="font-size: 90%><i>In Metadata "Location" I have entered the CD volume</i></span></blockquote>The IPTC metadata location is intended to store the physical location the shot was taken (as in "Museum", "City Hall", "Home"). It is also recommended to fill out the other location fields (Country, State, City) to make proper use of the Location Metadata Browser.<br /><br />Alexander.<br><span style="font-size: 75%; color: #408080">-- <br>Canon EOS 400D (aka. XTi) &bull; 20" iMac Intel &bull; 12" PowerBook G4 &bull; OS X 10.4 &bull; LR 1 &bull; PSE 4</span>

  • Proper use of stacked sequence structure

    Hello
    I have been reading this forum up and down, trying to figure out what the proper use of a stacked sequence struckture is.
    The reason i ask was that almost evryone in this forum thinks it is miss used / and or hides code. And that there is berrer ways of doing it.
    I ask this question, wondering what is the PROPER use of SSS?
    attached is the code so you can see what i am doing. As you will see, the code in the SSS are all the same for each frame, only channel number and numeric indicator is different, making upscaling more efficiant.
    Faster readings is not an issue since i will be slowing it down later on, so we get a visual value evry 5-10 seconds or so.
    keep in mind i am a novice at LabView, and all input is much appreciated.
    Attachments:
    r read 1ch.vi ‏52 KB

    TorbH wrote:
    I tried using array as you showed, but i fail to get it to work properly, well it works as it should but i want it to be able to stop with a button, when i did that only channels 202 - 206 stopped. 201 kept going.
    The reason for me to have this opportunity is that later i will connect channels 207-212. and they also will need to be started/stopped seperatly.
    Put the stop button inside of the loop.  The button is read with the terminal.  The terminal is read outside of the loop, so it will have the same value for every iteration of your loop.  By moving the terminal inside of the loop, your terminal will be read every iteration and you can therefore abort the loop.
    TorbH wrote:
    Also, frome here on out, how would i go ahead and use the data? Can i in a "state machine" use several for loops to perform the same tasks as i had in my previous version?
    A state machine is actually just a single loop.  You can use a state macine with other loops, you just need to be careful of how you pass the data around.
    State Machine
    Producer/Consumer
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Proper use of Iphone

    Does anyone know here the proper use of Iphone?
    1. Im wondering if it's okay if we expose it to sunlight? or sun raise?(walking in the street)
    2. and in Charging mode. we cannot safely remove the iphone in the Computer if its fully charge, is it safe to remove the usb without doing the safely remove?
    3. Is it okay if we charge it overtime? (ex. if we forgot to remove it?)

    1. Im wondering if it's okay if we expose it to sunlight? or sun raise?(walking in the street)
    Not a problem but you don't want to expose an iPhone to extreme heat such as being left in a vehicle.
    2. and in Charging mode. we cannot safely remove the iphone in the Computer if its fully charge, is it safe to remove the usb without doing the safely remove?
    Not required. When the iPhone is connected to your computer, it is not connected as an external drive which requires being ejected or safely removed before being disconnected from the computer.
    3. Is it okay if we charge it overtime? (ex. if we forgot to remove it?)
    Yes. Doing so will not cause any damage.

  • Proper use of undefined

    Proper use of undefined
    Leslie:  I bet you have an answer for this one...
    I am on version 6.0.7.1 (1961)
    My goal is to check and see if a dictionary is not present because its permission was accidently set to NONE.
    When I use this ISF nothing happens...
       if (serviceForm.TRA_INSTRUCTION == undefined)  
       alert('Service form is missing the Instructions dictionary')
    but if I change it to a double negative it works
       if (!serviceForm.TRA_INSTRUCTION != undefined)
       alert('Service form is missing the Instructions dictionary')
    Is this the way that the use of "undefined" was intended - or did I miss something in class.   Like I said, the double negative works fine,  But I would think that "equal to undefined" would work too.
    Thank you
    Daniel

    What you're trying to do is figure out if the dictionary object is defined. The more technically correct expression to do this would be to compare the typeof the object (ie, typeof serviceForm.TRA_INSTRUCTION) to "undefined" -- that would work with an equivalence expression. A longer discussion of, or reference to, object usage in JavaScript should ensue, but it's Saturday. (I think your original attempt is a little like comparing values in a relational database to null -- nothing is ever equal

  • Proper Use of States

    I have a question about how to properly use states.
    I am developing an application that requires login.
    I have two primary states, Authenticated and Unauthenticated. Once the user authenticates successfully, they are taken from the Unauthenticated state to the Authenticated state.
    Under the Authenticated state, I have a menu bar. When a menu item on the menubar is clicked, the application switches to a sub-state of the authenticated state that contains a TitleWindow with the content that I want to display. When the user clicks the close button of the TitleWindow, the application switches back to the Authenticated state.
    For those of you that know, is this proper use of States in Flex?

    As you can see in this sample code, the big factor is the size of the first view in the ViewStack. All the other views "might" be limited based on the size of the first view.
    The first view does not have to necessarily display first, that can happen programmatically, so at startup you could set the ViewStack selectedIndex to something other than 0.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      verticalGap="20" horizontalAlign="center">
      <mx:LinkBar dataProvider="{vs1}"/>
      <mx:ViewStack id="vs1">
        <mx:VBox label="One" width="300" height="200" backgroundColor="0xFFFFFF"/>
        <mx:VBox label="Two" width="600" height="400" backgroundColor="0x00FF00"/>
        <mx:VBox label="Three" width="150" height="100" backgroundColor="0x0000FF"/>
      </mx:ViewStack>
      <mx:Spacer height="50"/>
      <mx:LinkBar dataProvider="{vs2}"/>
      <mx:ViewStack id="vs2">
        <mx:VBox label="One" width="600" height="400" backgroundColor="0xFFFFFF"/>
        <mx:VBox label="Two" width="300" height="200" backgroundColor="0x00FF00"/>
        <mx:VBox label="Three" width="150" height="100" backgroundColor="0x0000FF"/>
      </mx:ViewStack>
    </mx:Application>
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Use commandLink to forward non-jsf page cause other commandLink invalidate

    Hi :
    I use commandLink to forward to non jsf page , after click the link , it worked , success to 1.jsp. Then I click another link , the other commandLink doesn't work.
    any one have the same problem ?
    JSF page:
    <h:commandLink action="#{MenuHandler.go}">
         <h:outputText value="process" />
         <f:param value="1.jsp" name="forward" />
    </h:commandLink>
    MenuHandler.java
      public static String go() {
                HttpServletRequest req = getRequest();
                String forward = req.getParameter("forward");
                getExternalContext().redirect(forward);
                FacesContext.getCurrentInstance().responseComplete();
                return "success";
      }ps:there is one <h:form/> in my jsf page and I use:
    jdk1.5.0
    jsf-1_1
    Tomcat-5.0.28

    to supplement:
    I found something strange:
    The JSF page I used is for menu purpose.
    So there is a <BASE target="mainFrame"> tag in my JSF page.
    If I mark it . Then other commandLink can work ~~
    Because the page is a menu page , so I can't mark the <BASE target="mainFrame">

Maybe you are looking for