How is submit a form using ahref  in a JSP

I have a form inside a iframe. It has 2 buttons. On clicking one button resultant page should open in the parent window(i.e target = parent). On clicking another button resultant page should open in same window (i.e target = self).
In bith case i need to submit the details in that form. I need to do this when java script is disabled. When java script is enabled changing of target window is possible.

I have written a few applications that required this kind of function, and what I ended up with was an applet.
First, I submit to the usual ACTION-URL and after processing the data, my code would determine whether the response should capture the full screen, or appear just withing the frame.
For redirects that capture the full browser window, I would call a page (still within the frame) that would run a Java applet whose only funtion is to send the browser to the new URL, which would be sent to the applet as a param. The applet just needs to know how to send the user to the new URL.
package com.redeye.core.utils;
import java.applet.Applet;
import java.net.MalformedURLException;
import java.net.URL;
* Redirect the user agent to a new URL.
* Usage:
* <xmp>
* <applet
*   code="package.to.Deflector"
*   codebase="path/to/applet/codebase"
*   name="Deflector"
*   height="1" width="1"
*   mayscript>
*     <param
*       name="targeturl"
*       value="http://target.url.here/">
*     <param
*       name="targetframe"
*       value="_self|_top|ANYTHING_ELSE">
* </applet>
* </xmp>
* Parameters:
* <b>targeturl:</b> The target to which the user agent is redirected
* <b>targetframe:</b> name of the frame/window to be redirected
* @author http://redeye.no
public class Deflector extends Applet
     private static final long serialVersionUID = -878236489812416561L;
      * Constructs a new Deflector applet
     public Deflector()
          // Default contructor
      * Initializes the Deflector applet
     public void init()
          super.init();
          try
               String url = getParameter("targeturl");
               String target = (getParameter("targetframe") != null) ? getParameter("targetframe") : "_top";
               if (null != url)
                    getAppletContext().showDocument(new URL(url), target);
          catch (MalformedURLException mue)
               System.out.println("Error in target URL: " + mue.getMessage());
}

Similar Messages

  • How to submit a form with checkboxes in a page flow?

    I'm having some trouble with a form that contains several checkboxes, and
    how to submit this form within a page flow...
    I have a JSP page containing a form with N checkboxes. The value and
    checked/unchecked status of each checkbox is generated from parsing an XML
    document. Here is the (simplified) code:
    <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
    <netui:form action="doUpdate">
    <x:forEach select="...">
    <input type="checkbox" name="id"
    <x:if ...>checked</x:if> value="<x:out ... />">
    </x:forEach>
    <netui:anchor formSubmit="true" action="doUpdate">Submit</netui:anchor>
    <netui:anchor action="doCancel">Cancel</netui:anchor>
    </netui:form>
    When this form is submitted, the checkbox values are lost -- the following
    code (in the action) produces an empty array:
    String[] prefs = this.getRequest().getParameterValues("id");
    I looked at the <netui:checkbox> tag, but it does not appear to give me a
    way to set the state and value (unless I've missed something).
    Can I submit a form without using a form bean? If I do use a form bean, can
    I set the state and value from my JSP?
    Any suggestions on how to do this (or insights into what I'm doing wrong)
    are welcome...
    -- Craig

    I am new to this, but I think this may solve your problem:
    I am not sure if this is what you are looking for, but you can create a LinkedHashMap
    with the req key/value pairs in the page-calling action in the pageflow and then
    pass that via a getRequest().setAttribute("myCheckboxes",myCheckboxHashMap);
    You can then access it in code using the optionsDataSource portion of the netui:checkBoxGroup
    - ie
    <netui:checkBoxGroup dataSource="{actionForm.thisCheckbox}" optionsDataSource="{request.myCheckboxes}">
    Hope this helps!
    m
    "Craig Coffin" <craig+1268fbec@nfld-dot-com> wrote:
    I'm having some trouble with a form that contains several checkboxes,
    and
    how to submit this form within a page flow...
    I have a JSP page containing a form with N checkboxes. The value and
    checked/unchecked status of each checkbox is generated from parsing an
    XML
    document. Here is the (simplified) code:
    <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
    <netui:form action="doUpdate">
    <x:forEach select="...">
    <input type="checkbox" name="id"
    <x:if ...>checked</x:if> value="<x:out ... />">
    </x:forEach>
    <netui:anchor formSubmit="true" action="doUpdate">Submit</netui:anchor>
    <netui:anchor action="doCancel">Cancel</netui:anchor>
    </netui:form>
    When this form is submitted, the checkbox values are lost -- the following
    code (in the action) produces an empty array:
    String[] prefs = this.getRequest().getParameterValues("id");
    I looked at the <netui:checkbox> tag, but it does not appear to give
    me a
    way to set the state and value (unless I've missed something).
    Can I submit a form without using a form bean? If I do use a form bean,
    can
    I set the state and value from my JSP?
    Any suggestions on how to do this (or insights into what I'm doing wrong)
    are welcome...
    -- Craig

  • How to create arabic forms using adobe central forms

    How to create arabic forms using adobe central forms

    Any luck here? I have just a subset of your challenge, i.e., I want to get forms designed in Designer 8.2/Acrobat 9 to work in Reader 7.0.5
    Thanks!

  • How to submit two forms once  in one jsp page?

    hello all,
    My jsp page includes two forms: one form's action is a File Upload servlet, which process file uploading; another is a general servlet to collect user inputs, such as user name, age, etc.
    Because the file upload servlet is a legacy component, and it was used in many applications. we could not meger it into our business components.
    the system requires the file upload and information collection are submitted once. so we have to submit two forms in one 'Submit' action, at the same time, the information collection servlet need get the information from file upload servlet, such as the uploaded file's url.
    I have tried two methods, but all failed
    1. Upload form has no a 'Submit' button, when user click the 'submit' button of the information collection form, we use a javascript to submit upload form first, then submit information collection form. Failed at: the second submit dose wait for upload finishing, then the second submit interrupt the upload
    2. the javascript only submit upload form, and set HTML body's onUnload event to another javascript that submit information collection form. this time, the file upload sucess, and information collection form sucess at most time. But fail when user click the 'refresh' or 'back' or any navigator buttons of the browser. these action will trigger the page 'unload' event too, but the submit if invalid!
    Please tell me how to.

    chain the both requests!
    - build one mutlitpart request and send it to a servlet that can handle that multipart request (think of using oreilly MultiPartParser).
    - check the input (all requiered fields and files there)
    - if yes store the user fields and create a socket connection from your servlet to the legacy file upload servlet and post the file this way.
    - like this you have full control over the users input and can make sure the file and the fields are just save if all requiered elements are availble.

  • Pls tell me how to submit a form?

    I want to use java class to submit a form to the web server,
    but I can't find which class will be useful for it,
    I find URLConnection can do it but can't set the request mothed
    to "post",HttpURLConnection can do it but it is an abstract class
    and I can't find the subclass,How can I do?

    But the "openLConnection()" method return URLConnection instance.
    Something like: new URL( "http://foo"
    ).openConnection() should return an instance of
    HttpURLConnection.

  • How to create interactive forms using Webdynpro for ABAP

    Hi All,
             I have worked on Webdynpro for ABAP, and now I want to start creating adobe interactive forms using Webdynpro for ABAP. Please provide me with basic examples to start.
    Also Please provide me introduction as how interactive forms are related to ISR senarios.
    Thanks in Advance.
    Phani

    Hi Varun!,
    Can you please send me also the above said step by step tutorial on [email protected]
    and can you please also guide me any configurations to be done on Sneak Preview SP12 before developing the interactive forms.
    Thank you in advance.
    regards
    Ravi

  • How to submit a form in jsp from tag handler class

    I have a form in jsp.I created some more links in the tag handler class.Based on the link we click form action will take place.Now how can i submit the form in tag handler class for the links i created in that class.

    I have a form in jsp.I created some more links in the tag handler class.Based on the link we click form action will take place.Now how can i submit the form in tag handler class for the links i created in that class.

  • How to submit a form as a PDF

    I have created a form using Live Cycle Designer 8 from an existing Word document. I have added a "Submit by Email" button. Unfortunately, the button only submits the data in XML format. I would like submit the entire form as a PDF that can be read in Acrobat Reader.

    You can go edit the XML Source and replace the <br /><submit format="xml" ... with <submit format="pdf"<br /><br />OR (thank you to OP for following)<br /><br />Open as a Livecycle form <br />Drag a button from the pallet onto your form <br />Change the control type to submit <br />On the submit tab [Submit to URL:] enter "mailto:[email protected]" <br />Change the submit as filed to PDF <br />Save <br /><br />BUT when user will be working with the Acrobat free reader, it won't work... you will have to do:<br /><br />Open the form in Acrobat Pro <br />Select advanced menu <br />Click enable usage right in Adobe Reader <br />Save <br /><br />I'm search the forum to find the fix to that, whitout having to extended the user's right....

  • How to run a form using tree node selection??

    hi...
    i have populated a tree with all the form name.There is a particular id for every form.i want to show a form using tree node selection.What i did...i write a trigger in button's click event when the tree node is selected then i get a id.if id=1 then open_form('test.fmx').when i want to execute this code then it is showing the same form 2 times.Can anyone help me to solve my problem?If so plz tell me what code i have to write to show a form using node selection?.

    I've done the same thing, and i think it works fine.
    Check this code (Sorry for the long post, but i cannot find how to attach files.
    PACKAGE menu_pk IS
    --Initialization of the menu.
    procedure Init;
    --Called from WHEN-TREE-NODE-EXPANDED
    procedure Expanded;
    --Called from WHEN-TREE-NODE-ACTIVATED
    procedure ExecuteCommand;
    END;
    PACKAGE BODY menu_pk IS
    MENU_NAME constant varchar2(30) := 'menu.menu';
    cursor c_menu(pRoot in varchar2) is
    select apm_code, apm_parcode, apm_descr, decode(apm_type, 0, Ftree.EXPANDED_NODE, Ftree.LEAF_NODE) apm_type,
    decode(apm_type, 0, 'menu', 1, 'form', 2, 'report') || '.ico' apm_icon
    from app_menu
    where apm_parcode = pRoot
    order by apm_code asc;
    procedure Init is
         new_node ftree.node;
    begin
         for i in c_menu('root')
         loop
    new_node := Ftree.add_tree_node(MENU_NAME, FTree.ROOT_NODE,
    Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
    i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
         end loop;
    end;
    procedure FillNode(pNode in FTree.Node) is
         new_node ftree.node;
    begin
         for i in c_menu(FTree.get_tree_node_property(MENU_NAME, pNode, FTree.NODE_VALUE))
         loop
    new_node := Ftree.add_tree_node(MENU_NAME, pNode,
    Ftree.PARENT_OFFSET, Ftree.LAST_CHILD,
    i.apm_type, i.apm_descr, i.apm_icon, i.apm_code);
         end loop;
    end;
    procedure DeleteNodeChilds is
    node FTree.NODE;
    begin
         loop
    node := FTree.Find_Tree_Node(MENU_NAME, '',
         FTree.FIND_NEXT_CHILD, FTree.NODE_VALUE,
         name_in('system.trigger_node'), name_in('system.trigger_node'));
              exit when Ftree.ID_NULL(node);
              FTree.delete_tree_node(MENU_NAME, node);
         end loop;
    end;
    procedure Expanded is
    begin
         if (FTree.GET_TREE_NODE_PROPERTY(MENU_NAME, :system.trigger_node, FTree.Node_State) = FTree.EXPANDED_NODE) then
         menu_pk.FillNode(name_in('system.trigger_node'));
         else
              menu_pk.DeleteNodeChilds;
         end if;
    end;
    procedure ExecuteCommand is
    cursor c_command(pCode in varchar2) is
    select apm_form, apm_type
    from app_menu
    where apm_code = pCode;
    fCommand c_command%rowtype;
    fMenuCode varchar2(20);
    begin
         -- if it is as menu node then exit.
    if (not FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_STATE) = FTree.LEAF_NODE) then
         return;
    end if;
    fMenuCode := FTree.Get_Tree_Node_Property(MENU_NAME, :system.trigger_node, FTree.NODE_VALUE);
         open c_command(fMenuCode);
         fetch c_command into fCommand;
         close c_command;
         if (fCommand.apm_type = 1) and (fCommand.apm_form is not null) then
              globals.Set_MenuChoice(fMenuCode);
              OPEN_FORM(fCommand.apm_form);--, ACTIVATE, SESSION);
         end if;
    end;
    END;
    The menu table definition follows.
    create table APP_MENU
    APM_CODE VARCHAR2(10) not null,
    APM_PARCODE VARCHAR2(10) not null,
    APM_DESCR VARCHAR2(40) not null,
    APM_TYPE NUMBER(1) not null,
    APM_FORM VARCHAR2(50)
    alter table APP_MENU
    add constraint APP_MENU_PRI primary key (APM_CODE);
    Hope this helps

  • How to submit my builds using Xcode 5.1.1 or later, or Application Loader 3.0 or later?

    I am using Apple Developer to make an app. How can I submit my builds using Xcode 5.1.1 or later, or Application Loader 3.0 or later?

    The controls in your screenshot are Mac controls, not iOS ones. If you have an iOS project, you can't access those controls. If you want to access those controls, create a Cocoa application project and select the xib file Xcode creates.

  • How to have Infopath form use Sharepoint Domain credentials

    I have built a for in infopath which is published to a library on Sharepoint 2013. This form is filled out by certain users and when its completed it gets moved into a subfolder. We then provide a link to a client who has a domain account with restricted
    access to just this folder of sharepoint. They can view this form and any others we put in this folder.
    The form has 2 views. The first is the view our staff sees when filling it out. There are some hidden sections in there for us that the client does not need to see. So there is a second view which is read only and I have taken away the option for them to
    switch views so they can't go back to our internal view.
    What I would like to happen is that the form can somehow detect by the domain login info from sharepoint, what user is opening the form and switch views based on that. What I can't figure out how to do it to have the form pull domain credentials from the
    sharepoint site and use those a a variable when opening the form to set the view.
    I believe I am on the right path what trying to setup a data connection but I am just missing something. I found this great guide http://www.pointgowin.com/seethepoint/Lists/Posts/Post.aspx?ID=55 but now when I open the form I get a warning stating "You
    do not have permissions to access a SharePoint list that contains data required for this form to function correctly." Also I still can't seem to pull the username.
    Can someone help me out? Point me in the right direction? Thanks.

    Hi,
    According to your post, my understanding is that you wanted to have Infopath form use Sharepoint Domain credentials.
    When you use Claims-based authentication, your user name is prefaced by “0#.w|”.  So for example, if your user name is SuesDomain\jdoe then your Claims-based user token will be, without
    the quotes:     “0#.w|SuesDomain\jdoe”
    InfoPath can’t handle that, or more specifically, the UserProfile.asmx method GetUserProfileByName method can’t handle that.  InfoPath tries to pass in your Claims-based user token instead
    of your domain\User Name.
    You have an authentication problem where the currently logged in user is not allowed to hit the web service, so you get an Access Denied 401 authentication error
    To resolve the issue, you can refer to the great blog:
    SharePoint 2013, InfoPath and Claims – GetUserProfileByName
    More information:
    InfoPath over Claims Authentication (SharePoint 2010 & 2013)
    SharePoint 2013 Business Connectivity Services Search and Profile PageMetroStar Systems Blog
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How to create a form using dblink

    dear all
    I am using Ora11g Xe, i have created a dblink of another database user; now i would like to create a form using apex, would anybody can guide me how to go about it? i have tried with normal procedure of creating a form (using client@cmd ie tablename@dblink name) but it didn't work;
    thanks in advance
    uday

    My first preference wouldn't be to use a DB link as opposed to some APIs on the target database that I can call from the form.
    Reason being that there are some things that may best not controlled over a DB link.
    However if you have a really simple case and really have to use this method then in theory you could try creating a synonym pointing to the remote DB object and hopefully Apex should treat it the same as a local object.
    Warning, I've never tried it :-).

  • Submit a form using class

    Hello Guys,
    I have a project where I need to pass a form using my class to online APIs.
    I read about JAXB and XML Schema, they can do that (I guess). But I don't know where to start.
    Thanks,
    Dreamcaster

    Yup, the request is made via HTTP POST and the response like that but in XML format. I found an example on the documentation.
    <form method="post" action="https://api.payment.com/deposit">
         Username: <input type=text value="userone"/>
         Password: <input type=text value="P@ssw0rd"/>
         Amount: <input type="text" value="50"/>
         <input type="submit" value="deposit" />
    </form>This will return a XML response. What I need to do is not that kind of form from my JSP, instead a class that will pass the same parameters to the URL and then the resulting XML will be parsed.

  • How to call interactive form using webdynpro abap.

    Hi Sap Guru's,
    I have Created Invoice Interactive form using SFP Transaction , now my requirement is ,
    Need to Call that invoice form using webdynpro abap by passing invoice number(vbeln) from the screen.
    please suggest .
    thanks

    Hi Suresh,
    Refer <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/aa/940ee5331b4b8fa0a6cb6714dc5db4/frameset.htm">Interactive Forms in WDA.</a>, this is the best one .
    Welcome to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/interactiveforms">Interactive Forms.</a>.
    Do post your queries on Interactive Forms in SAP Interactive Forms by Adobe.
    Rgds,
    - anto.

  • How to integrate adobe forms using webdynpro-abap

    Hi All,
    How to integarte adobe forms with webdynpro -abap(se80).
    Thanks & Regards
    Suman

    Hi suman,
       First you have insert a element interactive form in the view.
    In the properties of the interactive form you have properties called datasource and pdfsource.
    You have to give the data which you want to display in the datasource throught binding.
    These data you have to get it from the context. For pdfsource it should be xstring.
    There is one more property called templatesource, when you give a name and double click. It automatically goes to SFP and you can create the form of your purpose. While creating it will ask for context. That context will be the same which you have declared in the view or component controller.
    Regards,
    Arun.

Maybe you are looking for

  • Need advice & answers about updating DV7 Processor

    I've had an HP Pavilion dv7t Intel Core 2 Duo T6400 2.0GHz 4GB 320GB 17.3" for a little over a year. (I have no idea what the processor # is) Recently the fan started getting louder so I took it in to be cleaned b/c my hands are paralyzed and I can't

  • How can I contact a human to get a statement of some kind to get a reimbursement from my company?

    How can I contact a human to get a statement of some kind to get a reimbursement from my company?

  • How to assign work centre in OM

    Hi, In organizational structure how to assign work centre. it is necessary to assign cost centre to org structure.how ? President has to be given personnel no.? if employee is reporting to two superiors of different depts or different regions ,how th

  • Macbook pro boot problem!

    hi all ! I have a MacBook Pro 15" Model A1260 and I replaced tha logicboard because was damaged. from that time I can't install any windows version via bootcamp; everything goes fine until restart; after restarting I got this screen (see attachement)

  • Paragraph tag not included in catalog.

    fm11 in win7. In the document I'm working on, some lines appear to be in a paragraph tag named "RegName". But this "RegName" can not be found in the catalog, ie if I click on the arrow to select the paragrah tag, "Regname" is not included. Thanks for