Redirect - Get == Annoying parameters on url

Hi everyone.
I have a web site with php deployed on Apache Web Server and a web app deployed on Apache Tomcat.
I want to redirect from an Action (struts servlet) to web site�s php file with some request params. But when I do the redirect, my browser does a GET request, showing all the params in the url. There�s anyway I could redirect with POST method with header params? I think forward is not a good idea because the url must be inside my app context to do that.
Ty.

You could cheat and instead of doing a redirect return a JSP that contains a form with hidden fields populated with the parameter values. At the end of the page (or an onLoad event) you have JavaScrit that automatically submits the form with the php as the action.
Of course the client will need to have JavaScript enabled.

Similar Messages

  • Getting the parameters in url using cfgrid to cfc....

    please help!!!
    passing parameters to cfc using the cfgrid bind...
    im using the cfc bind if u hard coded the query in the cfc its works but if u need to pass a parameters in cfc bind its not working...
    for example...
    my url with parameter is http://localhost/index.cfm?empid=123&start_date=2009/05/01
    <cfform>       
                <cfajaxproxy bind="javascript:todetail({maingrid.id@change},{maingrid.firstname@none},{maing rid.lastname@none})" />
                <cfgrid format="html"
                    name="maingrid"
                    bind="cfc:#request.cfcpath#users.getGridas({cfgridpage},{cfgridpagesize},{cfgri dsortcolumn},{cfgridsortdirection})"
                    preservepageonsort="true"
                    appendkey="no"           
                    selectonload="false"
                    width="750"                           
                    style="clear:both;" colheaderalign="center"
                    >
                    <cfgridcolumn name="id" display="no" />
                    <cfgridcolumn name="datatime" header="DATE" width="100"/>               
                </cfgrid>
            </cfform>
    my query in cfc file:
    select * from hrd_emp
    WHERE 0=0
                <cfif arguments.id NEQ "">AND (id='#arguments.id#')</cfif>
                <cfif arguments.whereClause NEQ "">AND (#preserveSingleQuotes(arguments.whereClause)#)</cfif>
                AND (EmpNo = '#######')   =====> i need to put the empid=123 from the url  http://localhost/index.cfm?empid=123&start_date=2009/05/01
    PLEASE HELP!!!

    Pam, here's how I solved this one. Note the order of the bindings and the order of the bindings in the CFC must be the same as well. Hopefully this helps:
    <!--- create cfgrid with results from url.CFGRIDKEY variable --->
    <cfform name="getUsers">
           <cfgrid format="html" name="displayUsersActive" autowidth="yes" selectmode="row" striperows="yes" pagesize="13" bind="cfc:getUsers.SPActiveUsers({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgrid sortdirection},'#url.CFGRIDKEY#')" width="700" height="360">
                <cfgridcolumn name="intfkclassid" display="no">
                <cfgridcolumn name="txtLName" header="Last Name" headerbold="yes" width="20">
                <cfgridcolumn name="txtFName" header="First Name" headerbold="yes">
                <cfgridcolumn name="startdate" header="Start Date" width="30" headerbold="yes">
                <cfgridcolumn name="enddate" header="End Date" headerbold="yes">
                <cfgridcolumn name="classno" header="Class No" headerbold="yes" hrefkey="intfkclassid" href="allEnrolled.cfm" >
            </cfgrid>
        </cfform>
    <!--- getUsers.cfc ----------->
    <cfcomponent>
        <!--- METHOD: List Active users method --->
        <CFFUNCTION NAME="SPActiveUsers" access="remote" RETURNTYPE="struct">
            <cfargument name="gridpage" type="numeric" required="true" />
            <cfargument name="gridpagesize" type="numeric" required="true" />
            <cfargument name="gridsortcolumn" type="string" required="true" />
            <cfargument name="gridsortdirection" type="string" required="true" />
            <cfargument name="cfgridkey" required="false" type="string" default=""/>
         <cfif arguments.gridsortcolumn eq "">
                <cfset arguments.gridsortcolumn = "txtLName" />
                <cfset arguments.gridsortdirection = "asc" />
            </cfif>
             <!--- get user's info --->
                 <cfquery datasource="#application.dsn#" name="getUsers">
                        select a.intuserid,
                                a.txtFname,
                                a.txtLname,
                                b.intfkclassid,
                                c.intclassid,
                                convert(varchar,c.dtstartdate,106) as startdate,
                                convert(varchar,c.dtenddate,106) as enddate,
                                right('00' + convert(varchar,c.intclassyr),2) + '-' + right('00' + convert(varchar,c.intclassno),2) as classno,
                                c.intclassNo,
                                c.intclassyr
                        from tblusers a, tblenrollment b, tblclasses c
                        where a.intuserid = b.intfkuserid and
                                b.intfkclassid = c.intclassid
                                <cfif arguments.cfgridkey NEQ "" and isnumeric(arguments.cfgridkey)>
            and c.intclassid = #arguments.cfgridkey#
                                <cfelseif arguments.cfgridkey NEQ "" and arguments.cfgridkey EQ "active">
                                and c.blnIsActive = 1
                                <cfelseif arguments.cfgridkey NEQ "" and arguments.cfgridkey EQ "inactive">
                                and c.blnIsActive = 0
                                <cfelse>
                                and 1 = 1
                                </cfif>
                        order by #arguments.gridsortcolumn# #arguments.gridsortdirection#
                        </cfquery>
              <CFRETURN queryconvertforgrid(getUsers, gridpage, gridpagesize)>
        </CFFUNCTION>
    </cfcomponent>

  • ADF Redirect Programmatically to a TaskFlow URL with Parameters

    JDeveloper 11.1.2.0
    I've been working on a redirect scenario where the url parameters gets passed along with it. Initially, i was successful in doing so by using Andrejus's tips to redirect the page.
    http://andrejusb.blogspot.com/2007/10/security-in-oracle-adf-and-automatic.html
    So I thought I'd take it to the next level by doing the same thing but this time through a taskflow URL. To do this, I tried building a taskflow URL using :
    ControllerContext.getInstance().getTaskFlowURL(false, new TaskFlowId(tfDoc,tfId),params);
    Unfortunately, the ViewHandler.createView was only meant for pages defined in unbounded taskflow... but i thought I'd give it a try hehe. So i tried something else this time using F. Nimphius approach by using ExternalContext redirect.
    http://blogs.oracle.com/jdevotnharvest/entry/how_to_efficiently_redirect_an
    Now the main difference i notice between the two is that Andrejus's approach was able to redirect all the parameters i defined on the initial page while the ExternalContext route was removing the parameters upon building of the url through getGlobalViewActiivityUrl(String).
    Also, the documentation specified that it could only target a page defined in an unbounded taskflow. So definitely, redirecting to a taskflow was not possible in that scenario.
    Close to hitting a dead end on this one, I wonder if anyone has other suggestions as to the redirect to a bounded taskflow scenario.
    Ow, my usecase for this is that i'd like to offer our users the ability to just type
    http:<server>\faces\App?parameter1=myvalidparameter
    Then i'll basically redirect him to the bounded taskflow and i'll be setting all the input parameters to be passed in the bounded taskflow as well.

    Hehe scratch that... my bad, i've set a parameter to be required on the taskflow. So after defining the parameters and calling a redirect, everything worked fine.
    Just to share the code:
    private String getTaskFlowTestURL()
         String tfId = "main-flow-index";
         String tfDoc = "/WEB-INF/main-flow-index.xml";
         Map<String, Object> params = new HashMap<String, Object>();
         params.put( "inputParam", "myValue1234" );
         TaskFlowId taskFlowId = new TaskFlowId( tfDoc, tfId );
         String url = ControllerContext.getInstance().getTaskFlowURL( false, taskFlowId, params );
         return url;
    private void redirectToTaskflowTest()
         FacesContext fctx = FacesContext.getCurrentInstance();
         ExternalContext ectx = fctx.getExternalContext();
         try
         ectx.redirect( this.getTaskFlowTestURL() );
         } catch ( IOException e )
         e.printStackTrace();
    }

  • Get the parameters from the URL

    Hi all,
    In my applet I need to know the parameters that are in the URL. But I don't know how to do this.
    I started with this:
    String URL=getDocumentBase().toString();So URL has the full url, like: http://127.0.0.1./test.html?Testparam1=hello
    What I could think of is to use :
    int i = URL.getindexof("?Testparam1");
    String value =URL.substring(i);But that is not very handy when using more parameters.
    Is there an other way to get the parameters from the URL?

    You could use a regex or a StringTokenizer, but I'll bet there's a library somewhere that'll do it for you. Probably something in Apache Jakarta Commons. As far as I know there's nothing in the standard library that'll fully parse query strings for you, although you can use java.net.URLDecoder to decode the url-encoding (the %xx encoding).
    If you don't want to find a specialized library, then probably a regular expression is the easiest approach.

  • How do I use the Parameters from URL to filter on Content Query in ItemStyle.xsl?

    Hi, I might need your help with code that Content Query under <xsl:Template...> that I need a filter for 3 parameter from url (from date, to date(for date range) and type.
    eg: www.mywebsite.com/pages/Filter.aspx?DateFrom=01/01/2012&DateTo=01/01/2013&Type=sports
    I've google for help and not sure they seem working so far.

    Hi,
    If you want to filter a Content Query Web Part with the parameters from URL, we can achieve it with OOTB of Content Query Web Part by adding "Additional Filters" in "Web Part Properties"->"Query". We can add
    three filters like:
    date is greater than [PageQueryString:DateFrom]
    And
    date is less than [PageQueryString:DateTo]
    And
    type is equal to [PageQueryString:Type]
    Then redirect to the URL: www.mywebsite.com/pages/Filter.aspx?DateFrom=01/01/2012&DateTo=01/01/2013&Type=sports, the query results will be filtered.
    Please reply freely if I misunderstand your meaning or there any other questions.
    best regards
    Patrick Liang
    TechNet Community Support

  • How do you detect url redirects when connecting to a URL

    how do you detect url redirects when connecting to a URL?
    Thanks in advance
    stev

    Hai
    (i) If it a jsp we can get the URL by request object.
    Like
    String url = request.getHeader("Referer");
    u can do it in Servlet aslo by request object variable.
    If this explanation is not ok, Explain ur doubt in more briefed Manner

  • How to pass multiple parameters by URL?

    hi i am having trouble passing multiple parameters by URL.
    i tried the following codes but still not successful in using request.getParameter
    <a href="remove.jsp?imageid=<%=imageId%>&userid=<%=user%>">remove</a>
    <a href="remove.jsp?imageid=<%=imageId%>&userid=<%=user%>">remove</a>

    Looks good to me.
    What parameters are you getting at the other end?
    imageid and userid? (case is important)
    What does the address url in the browser show?
    What code are you using to retrieve the parameters?

  • Obtaining custom HTTP GET / POST parameters of variable length in Application Process

    Hi, I'm trying to connect a javascript UI control within my page to an APEX Application Process.
    The control calls the application process via AJAX and appends a variable number of GET / POST parameters to its URL.
    What is the best way to obtain these parameters from within the PLSQL procedure of the process? Or is there a better way to connect my javascript AJAX control to the Database behind my APEX app?
    Thanks,
    Steffi

    Steffi,
    I'm using APEX 4.1 and I've not used Treegrid before. It does look pretty interesting.
    Firstly, I'm not sure if you are aware but GET requests aren't as secure as POST requests. GET simply appends a key/value pair to the server as part of the url which can be easily sniffed. POST request on the other hand sends the data as key/value pairs to the server in the header which makes it harder to intercept.  This is why APEX outputs forms with POST methods.
    Secondly, back to your original question.I'm not sure this is possible with an Application Process. In the passed I've used POST methods to pass values to my Application Process. I have some code using native jQuery if you would like to see how its done. Alternatively, if you convert your application process to a standard pl/sql procedure (i.e SQL Workshop>Object Browser>Procedures) you can call this procedure and pass in values as you would with any PHP page.
    Simple example (untested)
    CREATE OR REPLACE PROCEDURE  "foo" ( my_name varchar(20)  
         , count NUMBER)
    IS  
         p_name varchar(20) := my_name;
         p_count NUMBER     := count;
    BEGIN
    --Do what you want
    --output something
       htp.p(p_count || '.: '|| p_name);
    END;
    The url on the page (or ajax call) would be something like "/pls/apex/{MY SCHEMA}.foo?my_name=Alistair&count=1"
    Of course for text you will need to escape single colons and special characters etc.
    I would really like to help you further so if you could create a working demo using a free workspace on http://www.apex.oracle.com and provide me with demo username/password. I can try and have a better look for you.
    In all honesty, I'm sure you would be looking to create this as a plugin so that you can easily reuse it in various parts of your application and can easily update it or maintain it. I can help you with that as well if you want.
    Alistair
    P.S You might want to update your profile on this forum to provide your name so people dont just see "31742965-2d09-4f42-849f-e39eb2cfbc9e" your profile name

  • How to get SSO userid to URL-based app?

    I'm developing a web-app using Struts that will be accessed by Portal (I guess as a URL-based app). The web-app will not require login. The web-app will not be Portal "aware", except that it requires the SSO userid for auditing/logging purposes.
    I know little about Portal and SSO. How can Portal be configured to send the Portal userid of the logged-in Portal user? Can it send it as a parameter in a GET or POST?
    The version of Portal will be 9.0.2 (or greater).

    This topic is answered in the PDK forum here:
    How to get SSO userid to URL-based app?

  • I get a "the requested URL was not found on this server" when trying to play a song in my iphone

    I have a new iphone5 and after synking my songs and musice. I get a "The requested URL was not found on this server" when I click on a song or a music video. It is almost like itunes did not copy my songs from my account to the new iphone.

    I was having the same problems with my movies and tv shows.  I unchecked them, then rechecked them, and synced all them again.  Presto!  They are all working again.  Thank you.

  • How do I get the Parameters of a Stored Procedure from my Java Code?

    I want to get the parameters in my Java code. How do I do this with Jdbc?
    In ADO it was: myCmd.Parameters.Refresh();
    Any idea what it is in Jdbc?

    no, what I want is to know what parameters are required by my stored proc. So basically I tell it, "My Stored Proc is name 'SomeName'. What are the parameters I need to fill for this proc?" Then it puts those in for me, and then I fill the values. That's what Cmd.Parameters.Refresh() does in VB/C++. So if I had a proc name "MyProc" with:
    @Something int,
    @Another varchar(25)
    Then if I did cmd.StoredProc = "MyProc" (and told it where to find the DB), and then did cmd.Parameters.Refresh(), the cmd would then have those parameters with null values, so i could do:
    cmd.Parameters(0) = 5
    cmd.Parameters(1) = "hello"
    Any idea how to do that in Java/Jdbc?

  • Firefox will not save my user name and password for one of my sites. How can I fix this problem. It is getting annoying having to reenter every time I check this site. Is there a solution.

    I had my user name and password saved for my library site. My grandson hit something and now the saved user name and password are gone. It asks me every time to enter it and it is getting annoying. How do I fix this. I want Firefox to remember these codes.

    You can create a bookmark with the JavaScript code via a right-click on the "Remember Password" link on the squarefree.com website and choose "Bookmark This Link" and select the "Bookmarks Toolbar" as the destination folder for easy access.
    * https://www.squarefree.com/bookmarklets/forms.html#remember_password
    You need to use the "Remember Password" bookmarklet before or after filling the name and password field on the website with the <u>login form</u>, but before submitting the login form by clicking a button on the web page.
    If the site is using autocomplete="off" then you see a number not equal to 0 (i.e. attributes were removed) in the pop-up alert from the bookmarklet and Firefox should offer to remember the name and password via a drop down dialog of the key icon that will appear on the location bar (Firefox 4+) or via an info bar at the top (Firefox 3).

  • Problem in getting the image through URL

    hi all,
    I facing the problem,Inwhich i am unable find the solution...I am using the following code to display the image
    public void doGet(HttpServletRequest request,HttpServletResponse response)
                        throws IOException, ServletException {
                   int data=0;
                   response.setContentType("image/png");
                   ServletOutputStream out = response.getOutputStream();
                   String file = request.getContextPath()+imageNames[0];
                   //String file = "C:/Program Files/Apache Group/Tomcat 4.1/webapps/ImageComm/WEB-INF/images"+imageNames[index];
                   BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
                   System.out.println("the size of the inputStream is..."+in.available());
                   System.out.println("the context path is..."+request.getContextPath());          
                   while ((data = in.read()) != -1) {
                   out.write(data);
    with the above i am not getting any error at the compile time but it was giving exception like FileNotFoundException.
    but the same thing(URL address) when i am copying on the browser it was displayig the image.
    (what might be the reason)
    one more thing when i commented on the url address and try to use the actual realpath address it was displaying the image with out any problem
    can anybody give me the solution like where to keep my images by which i can able to get the images through url address
    thanks in advance
    lakshman

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • How many images per sec can I get from ImageIO.read(url) ??????

    Hello,
    In my program I read images from a url...I'm wondering how many images I can get with ImageIO.read(url) per second..
    Hereby is the code that I'm using:
    import java.awt.*; //Contains all of the classes for creating user interfaces and for painting graphics and images
    import java.awt.event.*;//Provides interfaces and classes for dealing with different types of events fired by AWT components
    import java.awt.image.*;//Provides classes for creating and modifying images
    import java.io.*;//Provides for system input and output through data streams, serialization and the file system
    import java.net.URL;
    import javax.imageio.*;//The main package of the Java Image I/O API.
    import javax.swing.*;//Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
    import java.text.*;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class getPic extends Component{
    private BufferedImage img;
        static int n=0;
        private URL url;
        private DateFormat dateFormat;
        private Date date;
        private String s;
        private String str1= ".jpeg";
        private String str2="C:\\Users\\";
        private String str3;
        private String str4;
          public getPic() {
         try {
                  url = new URL("http://"); //a url that gives a real-time image
                  img = ImageIO.read(url);
                } catch (IOException e) {
               System.err.println("Unable to read file");
    public void savePic(){
    try{
    n++;
    str3=str2.concat(Integer.toString(n-1));
                        str4=str3.concat(str1);
                        ImageIO.write(img, "jpeg" , new File(str4));
                    } catch(IOException e) {
                      System.err.println("Unable to output results");
    @Override
        public Dimension getPreferredSize() {
            if (img == null) {
               return new Dimension(100,100);
            } else {
               return new Dimension(img.getWidth(), img.getHeight());
        @Override
          public void paint(Graphics g) {  //http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Paint.html
            g.drawImage(img, 10, 10, null);//http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html
        public static void main(String[] args) throws IOException {
           JFrame f = new JFrame(" Image without processing!!");
           f.addWindowListener(new WindowAdapter(){//http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/WindowListener.html
                @Override
                    public void windowClosing(WindowEvent e) {
                        System.exit(0);
        int i=0;
        for( ; ; ){
            i++;
            getPic pi = new getPic();
            pi.savePic();
            f.add(pi);
            f.pack();  //Causes this Window to be sized to fit the preferred size and layouts of its subcomponents.
            f.setVisible(true);
         try
            Thread.sleep(1000);
            }catch (InterruptedException ie)
            System.out.println(ie.getMessage());
    }Thank you in advance for your answers
    Joan

    Finally I solved my problem(getting as many images as possible from a url infinitely) using the above code:
    import java.net.*;
    import java.io.*;
    public class UserApplication {
        private static int n=0;
        String url;
      public void UserApplication(){
        public static void main(String[] args) throws Exception {
            UserApplication app= new UserApplication();
            for(;;){
            app.urlStr();
        private void urlStr(){
            try{
                url= "http://mplamplampla/frame.php/";
                HttpURLConnection con=(HttpURLConnection) ((new URL(url).openConnection()));
                BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream("C:\\Users\\mpla\\Desktop\\" + n + ".jpeg"));
                con.setDoInput(true);
                con.setDoOutput(false);
                con.setRequestMethod("GET");
                BufferedInputStream in = new BufferedInputStream(con.getInputStream());
                int bt = 0;
                byte[] buffer = new byte[4096];
                while ((bt = in.read(buffer, 0, 4096)) > -1) {
                  out.write(buffer, 0, bt);
                in.close();
                out.close();
                System.out.println("Image " + n + " saved");
                n++;
                } catch (Exception e) {e.printStackTrace();}
    }

  • My MacBook Air won't stay off. I turn it off and it will wait anywhere from a few seconds to a few hours and turn itself back on. You can see how that can get annoying and I can't seem to solve the problem.

    I turn it off and it will wait anywhere from a few seconds to a few hours and turn itself back on. You can see how that can get annoying and I can't seem to solve the problem.

    There's a slight chance this might help:
    Intel-based Macs: Resetting the System Management Controller (SMC)
    Otherwise it needs to be repaired.

Maybe you are looking for

  • Dump while executing FM based Gen extractor

    Hi, I am getting a dump while executing the FM based extractor in RSA3. below is the dumps error analysis- Error analysis     An exception occurred that is explained in detail below.     The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEG

  • What's happening here: iCloud Photos preparing photos for 'Photos' app?

    This morning I came back from a weekend trip to Prague, where I took a number of photos with my iPhone 6. On my Mac I fired up iCloud Photos to see if everything was imported properly. That was about an hour ago. Since then I am presented with this s

  • Line Graph - can I have more than two levels?

    Post Author: Deepa CA Forum: Charts and Graphs I am working on a line Graph for a client where the client needs the x-axis to show year, then month by Office for expenses. Crystal Reports XI. I can have two levels when I do change of by Transaction m

  • Preserve the table header while scrolling table

    Hi, How do I preserve the table header (giving details of what column contains what data)-- I mean:   |                         v Name      I-number       department to stay on the screen, and have only my table as scrollable? currently my table cont

  • Diplay data in function module

    Hi I am extracting data for PLANT MAINTAINENCE application, it is in master data. Data contains in 8 tables .and display 12 fields in the report and i have to extract data in BW side. So i am using function module to extract the data from R/3 to BW s