Can I do a POST with servlet without displaying form?

Hello,
I currently have a page (page1.jsp) that requires user to enter some values and click button to submit (POST) the data. That brings up a second page (results.jsp)that displays data based on what was entered on the first page.
Now I need to be able to invoke the results.jsp page directly via a servlet and pass it the values that would have been entered on the form page (page1.jsp).
The simplest thing to do would be to just pass the data in a query string but I don't have that option in this case.
How can I simulate a POST in my servlet and pass the parameters to results.jsp as if the user had entered them on the page1.jsp page?
Thanks in advance for any help!

Greetings,
Now I need to be able to invoke the results.jsp page directly via a servlet and pass it the values that
would have been entered on the form page (page1.jsp).There are essentially two ways to invoke another resource from a servlet: via call to request.sendRedirect, and through a RequestDispatcher:
A 'redirect' sends a response back to the client instructing it initiate a new request to the specified resource. To send data through a redirect requires sending it as query parameters. Since the client is initiating a new request with this information, that means the query parameters, along with the rest of the new location request URL, shows up in the browser's 'location' bar.
A 'dispatch' involves the other resource within (or, as part of) the current request, and without the client's intervention or knowledge. ;) Passing along data in a dispatch provides the capability of adding the data to the request object as attributes - though, not as 'parameters' :( - which the other resource may then get. However, as implied, the data passed along this way will not be available to the other resource as 'parameters' (which, presumably, is how it is currently expecting them), but only as 'attributes'. Therefore, the other resource would require modification to also look for the data this way. However, as with a call to sendRedirect(String location), a call to servletContext.getRequestDispatcher(String path) allows sending the data as query parameters which, unlike in a 'redirect', do not show up in the client browser! ;)
Presuming that the other resource is in context with the servlet then, in most cases, using a RequestDispatcher is the recommended way.
The simplest thing to do would be to just pass the data in a query string but I don't have that option
in this case.Presuming that it is not an option because it should not be seen in the client browser, then it may still be passed this way using a 'dispatch' without worry. :) Otherwise, passing the data as request attributes in a 'dispatch' and modifying the other resource is required.
How can I simulate a POST in my servlet and pass the parameters to results.jsp as if the user had
entered them on the page1.jsp page?If it absolutely must be sent in a POST request, then the alternative to the above is to manually call the other resource using an HttpURLConnection (or, better, try the Jakarta Project's 'Commons HttpClient' package ;). A search of this forum will yield many examples (usually in relation to applet-servlet communication, but that fact is otherwise irrelevant ;).
Thanks in advance for any help!Regards,
Tony Cook

Similar Messages

  • How can I open a document with applescript without the doc. window opening.

    How can I open a document with applescript without opening the document window and speak the text of the document?  I can get it to open the file but the doc window always opens up. 

    try
              set pathToMyFolderOnDesktop to ("Macintosh HD:Users:jodyconnor:Desktop:") & "Dsource:" as alias
              set rnd to (random number from 1 to 6)
              set rndFileName to (rnd as text) & ".scpt"
              set FullPath to pathToMyFolderOnDesktop & rndFileName as text
              set myScript to load script (FullPath as alias)
      run script myScript
    on error the error_message number the error_number
              display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
              return
    end try
    This code answered my question:  Hats off to Digimonk from stackoverflow and Darrick Herewe from stackoverflow.

  • How can I restore my iphone with icloud without the setup assistant?

    How can I restore my iphone with icloud without using the setup assistant? If this is not possible, how do open the setup assistant?

    Settings, general, reset, erase all contenet and settings, then you will restore from icloud.

  • FBR2 post with reference without copying XREF1 + XREF2

    Hello experts,
    Is there a way to use FBR2 (post with reference) without copying XREF1 + XREF2 to the the new document ?
    Thank you in advance,
    Dan

    Thank you Mauri,
    The problem is that if I will use substitution I might delete data that the user entered in XREF1+2,
    while my goal is to delete only the data that was copied from the original document.
    Regards,
    Dan

  • Premiere CS5 import avi clips without sound. How can I import avi clips with sound without convert?

    Dear Adobe Forum,
    I have the following problem, please help:
    I would like to import avi clips in adobe premiere. All clips have the same avi codec. But unfortunately my adobe premiere does not import the sound of a few
    avi clips. It is wired because about 10 out 70 avi clips which have all the same avi codec does not work with sound in premiere CS5. In the timline premiere import the video and audio line but there are no audio waves in the about 10 avi clips. additonally premiere plays the 10 avi clips in the source monitor without sound. Furthermore when I open the 10 avi files without adobe premiere they have sound, but with premiere there are no sound in the 10 avi clips.
    What can I do, so that I can import all avi files with sound. I do not want to convert each of the avi files because then they have not a good quality and it is to complicated and it takes to much time to convert all files in this video project and in the other video project in my future.
    Consequently How can I import all avi files so that they have immediately sound? Do I have to change some premiere settings?
    Thank you in advance
    Leonardo

    Now I show you details of 2 files:
    the first video clip which you can import with sound (works):
    Video:
    1280 x  720
    data rate: 4259 kBit/s
    total bitrate: 4387 kBit / s
    Single bit rate: 29 single images / second
    Format                           : AVI
    Format/Info                      : Audio Video Interleave
    File size                        : 63.5 MiB
    Duration                         : 2mn 1s
    Overall bit rate                 : 4 388 Kbps
    ID                               : 0
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : [email protected]
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 4 frames
    Format settings, GOP             : M=3, N=15
    Codec ID                         : H264
    Duration                         : 2mn 1s
    Bit rate mode                    : Variable
    Bit rate                         : 4 248 Kbps
    Maximum bit rate                 : 4 001 Kbps
    Width                            : 1 280 pixels
    Height                           : 720 pixels
    Display aspect ratio             : 16:9
    Frame rate                       : 29.970 fps
    Color space                      : YUV
    Chroma subsampling               : 4:2:0
    Bit depth                        : 8 bits
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.154
    Stream size                      : 61.4 MiB (97%)
    Audio:
    Bitrate: 128 kBit/s
    Channels: 2 (stereo)
    sampling rate: 48 kHz
    ID                               : 1
    Format                           : AAC
    Format/Info                      : Advanced Audio Codec
    Format version                   : Version 4
    Format profile                   : LC
    Format settings, SBR             : No
    Codec ID                         : FF
    Duration                         : 2mn 1s
    Bit rate                         : 128 Kbps
    Channel(s)                       : 2 channels
    Channel positions                : Front: L R
    Sampling rate                    : 48.0 KHz
    Stream size                      : 1.85 MiB (3%)
    Alignment                        : Aligned on interleaves
    Interleave, duration             : 21 ms (0.64 video frame)
    the second video clip which you can import without sound (doesn't work with sound):
    Video:
    1280 x  720
    data rate: 4278 kBit/s
    total bitrate: 4406 kBit / s
    Single bit rate: 29 single images / second
    Format                           : AVI
    Format/Info                      : Audio Video Interleave
    File size                        : 69.3 MiB
    Duration                         : 2mn 11s
    Overall bit rate                 : 4 407 Kbps
    ID                               : 0
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : [email protected]
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 4 frames
    Format settings, GOP             : M=3, N=15
    Codec ID                         : H264
    Duration                         : 2mn 11s
    Bit rate mode                    : Variable
    Bit rate                         : 4 267 Kbps
    Maximum bit rate                 : 4 001 Kbps
    Width                            : 1 280 pixels
    Height                           : 720 pixels
    Display aspect ratio             : 16:9
    Frame rate                       : 29.970 fps
    Color space                      : YUV
    Chroma subsampling               : 4:2:0
    Bit depth                        : 8 bits
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.154
    Stream size                      : 67.1 MiB (97%)
    Audio:
    Bitrate: 128 kBit/s
    Channels: 2 (stereo)
    sampling rate: 48 kHz
    ID                               : 1
    Format                           : AAC
    Format/Info                      : Advanced Audio Codec
    Format version                   : Version 4
    Format profile                   : LC
    Format settings, SBR             : No
    Codec ID                         : FF
    Duration                         : 2mn 11s
    Bit rate                         : 128 Kbps
    Channel(s)                       : 2 channels
    Channel positions                : Front: L R
    Sampling rate                    : 48.0 KHz
    Stream size                      : 2.01 MiB (3%)
    Alignment                        : Split accross interleaves
    Interleave, duration             : 21 ms (0.64 video frame)
    Consequently, as you can see, they have both nearly the same information
    Both video clips have the following audio codec:
    AAC
    In the folder where all raw video clips exist there are a few new files with the codec ending: .AVD ("the name of the file".AVD)
    But the 2 video clips mentioned above does not have any files like .AVD oder something else like that. But the first one works and the second one doesnt work.

  • Can I update my iPhone with iTunes without any sync ?

    Hi everybody, I have a simple question, i want to know if can update my iPhone from iOS 6 to iOS7 with iTunes without any sync between iPhone/PC, because my MacBook Pro was stolen the last month and my iPhone was sync with the Mac.
    Thanks

    Although you aren't getting the "Unable to verify update" error mentioned in this article, you might try the same troubleshooting steps to see if they help with your problem: http://osxdaily.com/2013/11/15/fix-unable-to-verify-update-error-ios/.

  • How can I get a MacBook with a dead display to display to an HDMI monitor upon bootup?

    I have a MacBook with a dead display that I'd like to use as a desktop.  I also have a 23" monitor with VGA and HDMI input.  I am using the DVI adapter on the MacBook, and a DVI to HDMI converter to connect to the monitor.  The problem is that when it boots, it's extending the desktop over onto the monitor rather than mirroring or using that as the primary display, which is unhelpful.
    Is there a way to get it to use the external HDMI monitor as the primary? 
    Do I need to buy a mimi-DVI to VGA adapter to accomplish this?
    I know this works if I connect the MacBook to a monitor with DVI input.  The problem is that my only options are VGA or HDMI for my current monitor.
    Thanks!

    Yes. Use a Mini DisplayPort to dual-link DVI adapter.
    (71350)

  • Can not modify the layout for my Default Display Form, inside an issue tracking list. the form will be blank after adding the cusotm styles

    I am working on an Issue Tracking list inside SharePoint 2013. but when a user clicks on an item , the description field will occupy only a small area of the page , while most of the page will be blank as follow:-
    so using F12 Developer Tools on IE i detect the marckup for the Description field as follow:-
    where it is mentioned that it have a Width=350, so i add a Script Editor web part to the displayform and i specify the following to expand the field from 350 to 1000:-
    <style>
    #SPFieldNote
    {width: 1000;
    <style>
    but the result is that the display form will display nothing when clicking on an item as follow:-
    Of course if i remove the ScriptEditor web part the form will be shown again..
    so can anyone advice from where i can force the default display item view to occupy the whole page size ? Thanks

    Hi John,
    Since width is mentioned in 'td' itself, so using styles we can't overwrite the width. For that you can implement javascript or jQuery code to set the width on td element.
    $('#SPFieldNote').width('1000px');
    Regards,
    Brij K

  • How can I send XML to a servlet without a WebService?

    I have created some XML on my Flex app now I want to send it
    back to the Servlet, any suggestions on how to do this?
    I don't have a web service setup, so I just need to do this
    without a webservice.
    I appreciate an help!!!!

    Hi,
    You can use HTTPService or RemoteObject.
    If you are using HTTPService, then it is very similar to Form
    post from a HTML page. HTTPService will allow you to select the
    method (POST/GET) in which you want to send the data to the server.
    You can add parameters with the data and the send the request to
    the server. On the server side, you can either use JSP/Servlet/ASP
    or any other server side scripting technology and access the
    parameters using request.getParameter("<parameter name>").
    Please find more details on how to pass parameters at the URL
    below.
    http://livedocs.adobe.com/flex/3/html/data_access_5.html#200238
    If you are using RemoteObject, then you need to have
    BlazeDS/LCDS on the server which will allow you to invoke methods
    in any Java class. When invoking any method you can pass arguments
    as you were invoking that method from another Java class. Please
    find more details on how to use RemoteObject at the URL below.
    http://sujitreddyg.wordpress.com/2008/01/14/invoking-java-methods-from-adobe-flex/
    Hope this helps.

  • How can i send data POST with a html link in a textfield

    Hello,
    This is my problem : I generate (from a php script) html
    links in a textfield. I would like for each link to send data with
    the POST method to an other script.
    My problem is that the getURL("lien", "", "POST") function
    can be use only by a movieclip or button event ... and not from a
    html link ...
    How can i do it ?
    Have you a small idea???
    Thanks ....

    yes, thanks but now my problem is in my function associated
    to this link :
    function SendPost()
    var toto="toto";
    getURL("
    http://127.0.0.1/board/scheduledfirst.php",
    "_blank", "GET");
    The function is executed but after in php i can get anything
    with echo ($_GET["toto"]); echo ($_POST["toto"]);
    Why ?

  • Can I share itunes library with iOS, without Home Sharing?

    Hi All,
    I have shared my library with my local network via preferences > sharing on my macbook. However, cannot see the shared library in my iOS device music app. Is it possible to access a shared library without having to set up Home Sharing? Perhaps a third party app can do it?
    Cheers,
    Sam

    itunes has two different ways of sharing music
    1) clicking on file , home sharing and turning on home sharing, and entering your apple id. this is required for iphone, ipods and ios devices you are only allowed to share to 5 computers this way. this allows you to import songs to your itunes client  from your itunes server. and each compuer needs to be logged into your itunes account
    2) clicking on itunes, preferences, clicking on share tab, and cicking on "share my library on my local nework " this will not allow itunes libraries to be shared with ipods, iphones or ios devices. itunes cleints will not be alllowed to important songs from your itunes server. however itunes clients do not have to be logged into apple at all. they don't even need to be authorized to play music. they will prompt for your itunes account if you try and play a song that has DRM, but if the music has no DRM they will play fine
    your only allowed 5 computers associated with an apple id. upgrading your music collection to itunes plus or using itunes match #2 might be able to save your precious itunes computer slots
    i have them both turned on

  • Creating invoice and posting  with FB60 (Without PO reference)

    Hi All,
    I need to create vendor invoice (without PO reference) as we do using FB60.
    How it can be done?
    Is there any BAPI which can be used ?
    I have used BAPI_INCOMINGINVOICE_CREATE to create vendor invoice with PO reference.
    Is the same BAPI we can use for creating invoice without PO reference? how to use ? or any other solution.
    Thank you very much....

    Hi Ashvender,
    Thanks for Replying....
    You are right we create IV with PO reference using MIRO and
    We create FI invoice by FB60 i.e without PO reference. But i want to upload data from excel sheet for without PO reference for FB60 as per given template below
    <b>Invoices with no reference to PO - FB60 format</b>
    Vendor       Date         reference        header txt    Bus area    G/L account    
    tax code   TAX amnt   Amount     WBS code                  Cost centre   Value 
    5000000    20.09.06    reference123     headertxt      1001          418002             v2             17.50         117.5        0506-PR-000001-CAP   4100             117.5
    Apart from BDC is there any BAPI we can use?

  • How can i sync my iphone with itunes without erasing its data?

    my computer crashed and i had to reinstall my windows,now i want to sync my iphone with the new itunes(with the same apple id) but it says all data should be erased from the device....is there some way to sync the iphone without the data being erased?

    Hello, I had this problem A few times. But there isn't A way I know. Keep the music on your computer and add them back after is what I do.

  • Can I install Windows 7 with Bootcamp without a disk

    I purchased Windows 7 Home Premium when I also purchased Parallels 7.  My main objective was to use the Windows partition for games that Mac doesn't have (Everquest II for example).  I had no trouble installing Windows with Parallels but the games I want to play work very poorly on the virtual machine.  Is there any way that I can junk Parallels and install Windows using Bootcamp?  Note:  Windows was downloaded from the Parallels web site.  I am using a MacBook Pro with Lion, early 2011, Intel 2.2 GHz i7 processor with 4 GB memory.  Another 4GB memory is in the mail but hasn't arrived yet.  All software is up to date.  Another question.  Would upgrading to Mountain Lion solve the problem?  Please, if there is anyone who knows the answer, give me instructions on how to ditch Parallels for Bootcamp.  Thanks.

    You can install Windows in BootCamp (it will be a fresh installation) and you can remove the existing VM installation. Windows will run faster in Boot Camp than it will in a VM (parallels is a VM).
    Please note that MacBook Pro's have 2 ram slots, and they will both be occupied with a 2G chip in a standard configuraton, there will be nowhere to install the other 4G that is in the mail. Return it and order 2 x 4G chips and remove the 2 x 2G chips already fitted.

  • Can iPhoto work in tandem with Bridge without making duplicate copies?

    I recently purchased an iPad and want to move some photo collections on to it. I currently use Bridge to manage my collection of many thousands of images, but it obviously does not let me easily sync with any kind of i-device. I am hoping that iPhoto can behave in a manner similar to iTunes in that it can act solely as a database and point at the original image residing with the structure create by Bridge.
    I do not want to keep two copies of the images, those in Bridge and another set in iPhoto. I see under advanced settings, there is an option under "importing" to copy items to iPhoto library. By unselecting this, will I achieve my goal of simply pointing at the original file?
    I suppose I can dump Bridge altogether, and just use iPhoto, but I am not sure I am ready to that as of now.

    I do not want to keep two copies of the images, those in Bridge and another set in iPhoto. I see under advanced settings, there is an option under "importing" to copy items to iPhoto library. By unselecting this, will I achieve my goal of simply pointing at the original file?
    Yes -- and no
    Yes you can reference the originals photos by unchecking that option
    No - you will have problems
    - if you move the "original" iPhoto will lose access to it
    - if you edit the photo in iPhoto the edited version will be in iPhoto and Bridge will not know anything about it
    - if you every upgrade your hardware or replace it due to failure iPhoto will have problems
    LN

Maybe you are looking for

  • Reliability analysis metric calculation executable stopped working and was closed

    JUST BROWSING WHEN RECEIVING THIS ERROR: Reliability analysis metric calculation executable stopped working and was closed I HAVE TO COMPLETELY TURN OFF COMPUTER TO RESOLVE

  • Y560p BIOS Bug

    Hello. I am using Linux with my y560p. We have an issue with gpe18. It is causing high CPU usage and freezes on display while system is idle. There is a bug report on Linux Kernel: https://bugzilla.kernel.org/show_bug.cgi?id=61051 Lan Tianyu from Int

  • Save Spool File to Local PC

    Hi there, We have run our P60 program which has created a spool file which can be seen in SP01 as a PDF file. When I go into the menu SPOOL REQUEST => Forward => the save as local file is greyed out : I need to download this file to my local PC. Does

  • UI errors in MSP application

    Hi, After I have upgraded the CRM Mobile 4.0 SP06 to SP07, When I launch the Mobile Sales Pharma Application, I get logged in but I get the error that Tile set not found whenevr I click on any of the options. I tried to deploy the UI chnages using up

  • Screen sizes of 17" and 20"

    Can someone who has one post the actual screen sizes, W and H (in inches) of the 17" and 20" iMac. thx :{)