JSTL: c:redirect using Post

I am trying to find some documentation as to how I can redirect to a different jsp page using post method. What I am trying to acheieve is hide the parameters in the URL for the destination page. This is very critical.
Regards.
Priyesh

Ok, understood.
What you are specifying here is pretty standard stuff. Do some processing and then display success or failure.
Is there any reason not to use a jsp:forward instead of a c:redirect?
Given a choice, jsp:forward is always preferred, as it doesn't involve a round trip back to the client, and most of the time you are navigating to a relative page on the server (jsp:forward doesn't work for links in different servers)
Will all the processing take place before onLoad is called ? Please correct me if I wrong. All JSP processing occurs before the page is even dispatched back to the client.
Of course most of the time you just want to generate the page and send it back to the client.
The only point of doing it this way including the javascript onload event to submit a form is to hide the parameters on the form as you were requesting.
Hope this helps.
evnafets

Similar Messages

  • [JSF2] Redirect after post, flash scope, keepMessages

    Hi,
    I'm using the redirect-after-post (or post-redirect-get) pattern [1] in a JSF2 application. To preserve the faces messages until the next request (get), I call FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true) before returning the redirect as a result from my action method.
    All works fine, however, if I keep redirect-after-posting through my application, these messages never disappear. I have to manually clear them before issuing another redirect as in:
        private static void removeRenderedMessages(FacesContext ctx) {
            final Iterator<FacesMessage> msgIterator = ctx.getMessages();
            while (msgIterator.hasNext()) {
                if (msgIterator.next().isRendered()) {
                    msgIterator.remove();
        }Is this a bug or a feature (I'm using Mojarra 2.0.2 in Glassfish 3 web profile)? I was under the impression that variables in flash scope survive for exactly one request.
    Cheers,
    Daniel
    [www.flexive.org|http://www.flexive.org]
    [1] [http://en.wikipedia.org/wiki/Post/Redirect/Get|http://en.wikipedia.org/wiki/Post/Redirect/Get]

    Hi,
    I'm using the redirect-after-post (or post-redirect-get) pattern [1] in a JSF2 application. To preserve the faces messages until the next request (get), I call FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true) before returning the redirect as a result from my action method.
    All works fine, however, if I keep redirect-after-posting through my application, these messages never disappear. I have to manually clear them before issuing another redirect as in:
        private static void removeRenderedMessages(FacesContext ctx) {
            final Iterator<FacesMessage> msgIterator = ctx.getMessages();
            while (msgIterator.hasNext()) {
                if (msgIterator.next().isRendered()) {
                    msgIterator.remove();
        }Is this a bug or a feature (I'm using Mojarra 2.0.2 in Glassfish 3 web profile)? I was under the impression that variables in flash scope survive for exactly one request.
    Cheers,
    Daniel
    [www.flexive.org|http://www.flexive.org]
    [1] [http://en.wikipedia.org/wiki/Post/Redirect/Get|http://en.wikipedia.org/wiki/Post/Redirect/Get]

  • How do I stop Firefox from opening a new tab when I click a link or navigation button (such as "home") instead of redirecting using the currently open tab?

    Any time I click on a link within a page, such as the "home" link in Facebook, or the various links on the Mozilla page that I needed to follow to get to this screen, Firefox opens a new tab instead of redirecting using the tab I'm on. Also, Firefox doesn't go to the new tab, it just opens it. So if I want to actually go to the page I've just clicked on, I have to then also find and click on the new tab that just opened.

    Hello,
    In safe mode link still open in new tabs?
    *[http://mzl.la/MwuO4X Firefox in safe mode]
    Go to '''about:config''' and search for:
    *'''browser.tabs.loadInBackground''' change its value to '''false'''.
    If in safe mode the links still open in new tabs try go to '''about:config''' and search for:
    *'''browser.link.open_newwindow''' change its value to '''3'''.
    *[http://kb.mozillazine.org/About:config about:config]

  • How do I send "unlimited" text in a parameter using "POST" in Ajax

    I'm trying to send large amounts of text data to the server using POST rather than GET, using Ajax
    However, I am only able to send a max of 9.76 kb
    I start with a jsp page, which calls a javascript method that utilises Ajax, which sends the text in a parameter in a XMLHttpRequest object
    to a servlet. The text is derived from options values in a multi select combo box.
    Here's my code:
    Code snippet from .jsp page:
            <table>
            <form name="form1" id="form1" method="POST">
               <tr>
                  <td>
                 <select name="sel" id="sel" multiple="multiple" size="0"></select>
              </td>
              <td>
                 <input type="button" id="sendOpts" name="sendOpts" value="Send Options" onClick="jsObj.sendOpts()">
              </td>
              </tr>
           </form>
           </table>Code snippet from jsObj.js file:
    //=================================================
    // jsObj object
    //=================================================
    jsObj = new jsObj();
    function jsObj() {
         this.sendOpts = function() {
              if(!confirm('Send Option Values?'))
                   return;
              if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
                   xmlhttp=new XMLHttpRequest();
              } else { // code for IE6, IE5
                   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              xmlhttp.onreadystatechange=function() {
                   if(xmlhttp.readyState==4) { // 4 = The request is complete
                        if (xmlhttp.status==200 || window.location.href.indexOf("http")==-1) {
                             alert(xmlhttp.responseText); // When I copy and paste all the text from this alert to text editor and save the file, the largest the file can be is 9.76 kb.
              var url = 'testSize'; // Servlet that simply retrieves the sent String in a parameter and sends it back to this method
              var sel = document.getElementById('sel');
              var str = sel.name + '=';
              var delim = ':';
              for(var i = 0; i < sel.length; i++) {
                   str += encodeURIComponent(sel.options.value + delim); // 'encodeURIComponent' encodes any special characters within the parameter values
              xmlhttp.open("POST",url,true);
              xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // This is needed for any POST request made via Ajax
              xmlhttp.send(str); // send the parameter and it's value to the servlet
    }Code snippet from 'testSize' servlet:package test;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.util.*;
    public class TestSize extends HttpServlet {
         public synchronized void doGet(HttpServletRequest request,
              HttpServletResponse response) throws ServletException,IOException {
              PrintWriter out = null;
              try {
                   response.setContentType("text/html");
              out = response.getWriter();
                   String str = request.getParameter("sel");
                   str = str.substring(0, str.length()-1); // cut off last delimiter
                   out.println(str);
                   } catch (Exception e) {
         public synchronized void doPost(HttpServletRequest request,
              HttpServletResponse response) throws ServletException, IOException {
              doGet(request, response);
    }Any help greatly appreciated.
    Edited by: Irish_Fred on Feb 25, 2010 5:14 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Yes, I tried that.
    I set the "ACTION" of the form to the servlet and then used the form.submit() method to POST the text to the servlet.
    i.e.: I selected many options in the select combo, concatenated them to one string, set the 'value' property of a form text field to
    this string, did a 'form.submit()' to the servlet and I was able to send a much larger amount of text.
    ( The .txt file I saved from the resulting text equaled about 30 kb in size, so obviously I can send much more
    data this way. )
    However, I want to use Ajax, so I don't have to reload the page. I 'borrowed' the Ajax part of the code from a website:
    http://www.javascriptkit.com/dhtmltutors/ajaxgetpost2.shtml
    and I presumed that because the author used "POST" as opposed to "GET", I would be able to send larger
    chunks of data. Obviously not, or there's another reason for the limit of data I can send using my present code,
    which I'm not seeing. I'm fairly new to jsp, Ajax & Servlets, so this is no surprise.
    If anyone can point out to me where I'm going wrong, I'd greatly appreciate it. Cheers.

  • Interesting Problem in VA4Java: Using POST with forward(req, res)

    I am trying to use POST Metod with forward(request, response) in VisualAge for java using webSphere test environment and getting an error page. Interesting thing is that if I set a breakpoint then I get the desired page otherwise an error page. However, if use GET Method everything works fine. What confuses me is that why POST method is not working without setting a breakpoint and running the code in debug mode? Does it has to do with WebSphere test environment or problem of using POST method with requrest forwarding in servelt API?

    Hi there,
    I am beginning in developping jsp / servlet in VAJ3.5 and Websphere Test Environment.
    i manage to run the servlet properly. unfortunetely the jsp is not working properly : in my hello.jsp (this example is coming from tomcat4.0), there is a method 'request.getContextPath()'
    WTE send me a message : 'method not found in interface javax.servet.http.HttpServletRequest'
    Any idea hox to solve this?
    VAJ3.5, WTE use JSP1.0, is it something linked to this?
    Thanks to you.
    Regards
    Hugues

  • How to use POST method to send & recieve XML data in WebDynpro application

    Hi There,
    How can we use POST method in a Url (callign weebdynpro application) and pass XML String content. How can we read this this inside WD Application.
    Any pointers will be great help.
    Rgds

    Closed

  • Open URL, use POST method in new window

    From a Java program, how do we open a https connection, basically a secured site, in a new window and pass some parameters to the link, using POST method?

    Hi
    Is JavaProgram a Applet or Servlet?
    Opening a new window directly from server,probably not possible? From your question
    what I understand is, A html page is displayed
    and when u click on a link opens a new window.
    The parameters to the link should be posted using POST method, again
    it is not possible this can be done only by appending
    "?name1=value1&name2=value2..."to the link
    Vinay
    [email protected]

  • How to use post method in j2me

    I used post method and when im about to receive the response from the servelt i get the output like
    str=<html><head><title>Apache Tomcat/4.1.24 - Error report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;} B{ ................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks supareno I have tried the weblink u hav given. It helped me a lot

  • Document Posting restriction using posting key,document type combination

    Hi
    We have a authorization restriction issue using posting key&document type&Accoutn type  combination.
    Requirement is
    User A should be able to post to vendors only for particular posting key&document type.He should be able to post to with any other posting keys and document types to vendors.
    We have tried with document type authorization object/vendor authorization objects from user profile but it does,t work.
    can any one suggest some way please/
    r
    regards

    Hi
    I think you should be able to achieve the same through Validation rule:
    Prerequisite
    Document Type - XXXX
    Check
    User name = 123 and Posting Key = XX
    You can set a an error messsage which would be bleeped when the check fails
    Regards
    Sanil Bhandari

  • Want to send information in Header dynamically using HTTP adapter using post method

    Hi ,
    I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
    Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
    I have followed below link to create UDF
    http://scn.sap.com/thread/3241568
    As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
    Regards,

    Hi Abhay,
    Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
    You also need to test it successfully externally, capture the request and replicate it in XI.
    Hope this helps,
    Mark

  • NetConnection using POST requests to retrieve data

    Hi Everyone,
    I've noticed that when I use NetConnection.call(methodName) in my client Actionscript it sends a POST request off to the server. I thought this was odd because requests for data are normally GET operations but I didn't worry about it because it doesn't impact my application.
    Now I have our sysadmin complaining about the amount of data I'm shifting over POST requests because POST requests aren't cached by the web servers (and we are working with the kind of traffic levels where that matters.) Is there anyway I can make call() use GET?
    The code  I'm using is all fairly standard, but here is the relevant snippit:
                        var nc:NetConnection = new NetConnection();
                   nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                            nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
                   nc.connect(serverUrl);
                   var res:Responder=new Responder(onResult,onError);
                   function onResult(e:Object):void {
                        trace(Trace.structure(e,"",0));
                        loadSequence(e);
                   function onError(e:Object):void {
                        trace(Trace.structure(e,"",0));
                        noService();
                   nc.call(methodName,res);
    Any information even a 'No thats not possible' would be much appreciated.
    _Pez

    Hi Pez,
    I checked with some of my colleagues here at Adobe and I do believe that the answer is 'not possible as this time'.  Player is hardcoded to use POST for RTMPT so you're not going to be able to change those to GET based requests.
    Asa

  • HTTP Transformation using POST Method

    Hi, I will have to use POST method with header as application/json to get the results in http transformation. I downloaded the RESTFUL client utility from Chrome, to see how JSON would look like by passing parameters and the result is displayed as expected.  But I'm not sure how the URL to be constructed in HTTP transformation and appreciate if you have any suggestions. My URLL http://dev1.com/contract-api/contract/public/contractValidationMy input parameters:  {"hierarchies":[10],"properties":[18],"licId":123} If I use the above URL and parameters in RESTFUL client, I'm getting the output, but having difficulty in setting up the URL using HTTP transformation.  RegardsSelva

    Thanks Marc.
    Let me rephrase the scenario.
    I have an external application which is capable of sending information only in XML through HTTP requests. It does not send SOAP messages. I guess in this case, we would need to use the HTTP binding using POST method. Much like the sample at http://blogs.oracle.com/reynolds/2005/09/invoking_bpel_from_an_html_for.html which uses the GET method.
    In this sample reynolds is using the GET method. I have been trying to get the POST method to work.
    Regards
    John

  • HAP_DOCUMENT BSP redirect using the BADI HRHAP00_BSP_TMPL

    Hi all,
    Below is my issue:
    Last year, We have modified the BSP HAP_DOCUMENT by copying it to Y_HAP_DOCUMENT. Now we had to make further changes to the BSP which had to be template specific.
    So we used the BADI HRHAP00_BSP_TMPL to redirect the document to a new BSP Y_HAP_DOCUMENT_V1.
    The iviews are pointing to the BSP Y_HAP_DOCUMENT, but when the BADI is hit its getting redirected to the V1 BSP.
    But the issue is that whenever the redirect BSP is used, the error messages are getting killed.
    Please let me know if anyone had a similar issue and if they were able to solve the issue.
    Thanks,
    Manasa
    I am using the

    Hi Luk!
    Sorry that i got back to you this late. Have you solved the issue?
    whenever we redirect using the badi for hap_document the control starts from layout_alternative.htm  view instead of the layout_sap_standard.htm. So if you copy paste the code from the sap standard view you will be able to redirect it.
    Hope this helps. Plesae reward hlpfull answers.
    Thanks,
    manasa

  • [REPOST]How to force ADF Dialog / POPUP to use POST method ?

    Hi all,
    Is there any way to make ADF Dialog / POPUP to use POST method ?
    I need that approach to implement this post : [SOLVED] Faces - Preventing user from entering URL manually
    But it breaks in my application because ADF Dialog / POPUP is using GET method.
    Thank you very much,
    xtanto

    repost.
    Thank you

  • Invoke ADF taskflow with parameters using POST

    Hi,
    Can someone give an example or point me to an example describing invoking adf taskflow with parameters?
    The requirement is to have the parameters passed using POST method and not passing the parameters in the url.
    Jdev: 11.1.1.4.0
    Thanks!

    Hi,
    a use case for the requirement would have been good to have as yet I can't tell if I am helping you with something useful (hope so) or stupid (for which there would be a better approach to use instead if only we knew the use case).
    Anyway, here's a document describing what you asked for
    http://adfpractice-fedor.blogspot.de/2013/07/url-task-flow-call-with-http-post-method.html
    Frank

Maybe you are looking for

  • Cost Component structure field and table names

    Hey all, i need to code a BADI to push value of one column in cost component structure to another column in ccs for only order settlements.. any idea how to do this?? i am very new to abap please take it easy on ur answer.. i coulndt even find in whi

  • J2EE app server won't start on Windows XP Pro

    Greetings -- I have been trying to get the J2EE SDK up and running on my Portable computer but have been unable to get the application server up and running. Whenever I try to run it using j2ee -verbose I get Error executing J2EE server ... (I have i

  • In urgent need of help regarding getting month name and dates

    Hi Experts I have a table called MONTHLYBILL with Column TRANSACTIONMONTH. I need one query / function / SP to do return ouput based on following combination. I am using Oracle 9i Have researched on various forums, documents but unable to get the des

  • TS4006 I used find my ipad from my iphone. I have now found my ipad. How do I re-activate it?

    I used "find my ipad" last Friday, from my iphone. I found the ipad this morning at work, where I left it. How do I now, re-activate the ipad? It does not turn on.

  • Redownload PS Elements 12

    I purchased PS Elements 12 in Feb while in Australia, as my PS 8 crashed, and I loaded it onto my laptop.  I am now home (Canada) and want to know if I can redownload Elements 12 to my desktop.  I had someone on Adobe Chat last nite and she send me o