Why does sendRedirect modify my url

Hi,
Why does sendRedirect change my url.
If I'm on the page www.mywebsite.com/something.jsp
and I use the response.sendRedirect("somethingElse.jsp").
Now the url that I can see on the browser is mywebsite.com:72394/somethingElse.jsp
What can I do to keep my nice url without the port number?
Thanks
Vinz The Worst.

Thats because sendRedirect takes a full (absolute) URL as its parameter. Use request.getRequestURL() to get the original URL and construct the new one from that. You can also roll your URL from the getScheme(), getServerPort() etc. functions.
Regards,
Silvio Bierman

Similar Messages

  • Why does Firefox remove the URL from the query string?

    Hello there,
    I've writing a servlet to read data from a file stored on a server. I'm using an HTTP <INPUT TYPE=file > element to locate the file to be read. When I run the servlet using IE as the browser it works fine. When I try running it using Firefox, the path to the file is not included in the query string. The full URL to the file shows up in the file input text field but then mysteriously disappears from the query string. Without the path, the servlet can't locate the file and the servlet fails. How do I get Firefox to include the path in the query string or is there some other workaround for this problem. I want my servlet to work on all types of browsers.
    thanks,
    grant

    Well you may also ask it the other way. Why does Microsoft send the full path file with the input type="file" component?
    The purpose of this control is to upload a file from the client to the server. That file is sent with the request.
    It does not allow you to browse server files at all. Most probably you are working on your developer machine where the client IS the server, so it works right now.
    It won't once they're seperate.
    <input type="file"> is the wrong tool to use to browser the server. You need to write your own html pages to do that.
    Cheers,
    evnafets

  • RH 9 - Why does RH modify my ssl settings?

    I'm using RH 9.0.2.271.
    The Background: We have a large help system (approx 2200 topics) that we have to generate into PDFs one per chapter. We also need to do this in various target languages as well once we get them back from our localization department. So, I created an SSL per chapter in our English project (38 in total), and each SSL is setup to output a single PDF:
    The idea is use RH's batch generate, and have all 38 PDFs get generated. We then bundle them up into a zip and provide them to our customers. It works great in the English. We sent our English RH project off for localization and the translators translated the necessary files.
    About SSL and printdoclayout.xml Files: I've looked into the SSL files in a text editor, and the SSL files for printed outputs do not specify themselves what gets sent to the .doc or .pdf. Instead, when you create the SSL, RH also creates a unique xml file with this name printdoclayout(n).xml, where n is a number that increments for each additional printable SSL you have and the SSL contains a reference to use that XML. The printdoclayout.xml actually contains the chapter structure that gets sent to the printable output:
    Within the <tocstructure> element, it contains the hierarchy of what to export. (Note that even though it has <chapter> and <page> elements, those are misnomers since they're really just topics references with <chapter> for a book-style entry that contains a subtopics. The important thing is that in this example, the xml matches what I have in the Chapter Layout list of the Print Document Content dialog box shown above:
    How We Work with Localized Files:  We send off the entire RH project to the translators. They give us back the necessary files (.htm, .hhk, .hhc and so on). This time we also asked them to translate the name attributes in each <chapter> and <page> element of each printdoclayout.xml file, because RH draws from those strings during the printable output generation, and we didn't want it to pull in the English strings from the original XML files. When we get the file's back from our localization department, we make a copy of the English RH project that was localized and we use that as a base. We then copy the files they send back to us into it, overwriting what's in the English. We then modify the RH project settings to match the target language. Then we generate the desired output.
    The Problem: Now we're getting the localized projects backs, but when we try to generate the printable outputs from a localized RH project, RH no longer respects what I originally defined in the 38 SSLs/xmls. Instead of trying to output a single chapter per SSL, it's trying to output ALL chapters in each SSL. For example, notice what happens when I open up the same layout in the localized Chinese. (Notice the blue highlight in the left side of the Print Document Content dialog box, showing that ALL the chapters are now somehow selected.)
    I don't understand why merely opening up the SSL causes it to select ALL the topics for the generation, especially when the underlying (localized) .xml file still shows the correct chapter output as shown here:
    It seems like there's another setting or file or perhaps just a bug that's telling it to grab all chapters and topics. In fact, it looks like the entire SSL is pretty much wiped out. My section layout and the style settings need to be redone as well.
    Anyway, the workaround I came up with, is we have to go back into each layout (38 of them) in each target language and select again the proper chapter per layout (as well as fix the section layout and style settings). It's a time-consuming and error-prone manual fix, especially since in some target languages, like Chinese where I don't read the characters and could easily get lost and choose the wrong chapter.
    Thanks in advance for any ideas.
    Message was edited by: Jared Hess. To resize some images and add additional info.

    Peter, thanks for responding. We ran into this problem in other languages as well. I'm just using Chinese here since that's the one I'm currently working on. I don't think the partially localized items at the bottom would cause a problem. I think those were intentionally ignored by our translators.
    Although, I wonder if modifying the underlying printdoclayout.xml file causes RH to want to reset the printable layout file (SSL). I haven't tested that theory yet.
    I also wonder if is there a file somewhere that affects how the SSL is generated? So I started looking through the different file types in my project folder and looking at them in Notepad++. The .pss file does contain references to the SSLs. For example, there's this:
    [Target:01_Getting Started]
    SSLayoutType=7
    ActionID For Generation=1013
    ResultFileName=!SSL!\printable\01_Getting_Started\01_Getting_Started.doc
    Remove Folder with prompt=1
    CreateProjectTime=14:32, September 17, 2014
    CreateProjectUser=Jared.hess
    SupportMas_MPJ=1
    ViewFileName=!SSL!\printable\01_Getting_Started\01_Getting_Started.doc
    ResultStatus=0
    BuildTimeHi=30397110
    BuildTimeLow=-2083350864
    But I don't see how this affects anything.

  • Why does CAPI make OCSP URL Retrivel for Expired Certificates

    Hello,
    I have noticed in our online responder logs that expired certificates are being checking for revocation. We publish OCSP URL's by Group Policy. Is it intended for CAPI to check expired certificates for revocation? What would be this point of this. Is it
    possible to disable this?
    --Dan

    Hi Dan,
    Based on my knowledge, I can’t find the solution to resolved this issue.
    To receive better support, it is recommended to post in the TechNet Security forum.
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserversecurity
    The professionals there will be glad to help you.
    Thanks for your understanding.
    Best regards,
    Fangzhou CHEN
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Why does ipad say no url found when i am paid up with provider

    Ipad continues to say no url found when I am paid up with a provider. 

    Hi David,
    Windows Vista is not a supported/ tested platform for Acrobat 11.
    Please check the tech specs at: Tech specs | Adobe Acrobat XI Pro
    Regards,
    Rave

  • Why is it that now, when I click on a link for a website I've saved, it does NOT show the URL in the address bar? I can't drag it to an email to share the link.

    Why is it that in these newer versions of Firefox (I have 21.0), when I open a link that I've saved, it does NOT display the URL in the address bar any more?
    I can't drag and drop the link into an email, and I can't see the actual web address I'm connected to for reference OR for security purposes. Why was this changed?
    It becomes necessary to reveal the properties of the URL link I've saved, using the Windows "Properties", then copying and pasting the URL into the Firefox address bar, before I can do anything with it.

    No changes have been made and no problem with extensions has interfered with the URL appearing in Firefox before. Only with the last few new versions of Firefox has this cropped up. Also, the link opens correctly - it just doesn't display the URL in the address bar, instead it just reads (in gray) "Search or enter address." How could another extension interfere if Firefox is the sole program associated with .htm, .html files?

  • Why does iTunes freeze up for minutes at a time when modifying INFO (CMD-i) ?  My files are not corrupted after it is done like many other threads i have readed.

    Why does iTunes freeze up for minutes at a time when modifying INFO (CMD-i) ?  My files are not corrupted after it is done like many other threads i have readed.  Sometimes it's changing the title of a movie or editing the season and episode number of a TV show ect.....

    Yup same here
    I am running the latest iTunes, the latest updates to the OS and on an iMac 3.4GHz Quad core i7 with 8GB of RAM and the music stored on local HDD.
    Still locks up iTunes for between 2 minutes up to 20 minutes.
    Really annoying.
    If you find a fix please, please let me know, I have just been throwing hardware at it with no joy at all

  • Why does my Safari homescreen shortcut on my iPad NOT have a url address bar or the ability to open a new tab?

    Why does my Safari homescreen shortcut on my iPad NOT have a url address bar on top or the ability to open a new tab?  When I open my homescreen shortcut and click on a link which would normally open a new tab I get the white screen od death ( in Safari).  ???
    thanks.
    pedro

    1. Settings>Safari>Clear History, Cookies and Data
    2. Hold the Sleep/Wake and Home button down for about 10 seconds until you see the Apple Logo

  • Why does Bridge always sort images by rating instead of by date modified?

    Why does Bridge always sort images by rating instead of by date modified?
    This drives me bonkers.  Everytime I look for an image I've been working on, I go to Bridge and I'm always presented with the images sorted by rating instead of by date.
    Then I click on the microscopic sized, extremely tiny arrow that allows one to choose 'sort by date modified' and I resort them to find the file I need.  So that's always 3 extra clicks to find the image.
    WHY can't Bridge sort images by date modified and STAY that way every time I come back?
    Thanks for any help.
    I know I could just keep the recent files rated the highest, but still, I'm wondering if there's a way to make it work the way I'd like it to work?
    jn
    p.s.  Note to Adobe: Please make the selection button for sorting images arrow larger than a fraction of the size of the period at the end of this sentence.  Thanks.

    WHY can't Bridge sort images by date modified and STAY that way every time I come back?
    By default it does stay at the latest selected sort order so this could mean it is due to your install.
    First of all try to reset the preferences for Bridge, hold down option key while restarting Bridge and choose reset preferences. This sets it all to default. First try if the problem is solved then set prefs again to your own custom wishes.
    Also check and repair permissions for the OSX itself (Apple has disk utility in the utility folder for this job, and there are other 3th party applications)
    And be sure to have the latest update for Bridge. (Bridge CS5 should be 4.0.5.11)
    In addition to the method Tai Lao pointed you already to there is a third option, use right click mouse button in content window and the pop up menu has also the sort option at the bottom of the row

  • Why does a Yahoo7 search result replace some URLs since I switched to Mavericks?

    Why does this window <https://au.search.yahoo.com/yhs/errorhandler?hspart=gt&hsimp=yhse-gt&q=related-info-hrd.appspot.com%2Fstatic%2Frelated-information-mvc-1.3.&type=769480> replace many of my URLs such as <http://www.theguardian.com/environment/2014/sep/22/rockefeller-heirs-divest-fossil-fuels-climate-change> ?
    Its really annoying and started since I updated to Mavericks. I may have also updated Firefox since then.
    Is there a solution?

    Hi jscher2000, Thanks so much. Indeed, that did solve the problem! I didn't want to go to another browser, and you help me to see that knowing a bit about add-ons isn't so scarey and out of my range of understanding.
    Have a nice day!

  • Why does firefox 4 incorrectly validate the url input?

    Why does Firefox 4, HTML5 validation for URL input elements require the http:// prefix?
    Is there a way around it?

    The arrow to open the tab history of the Back and Forward buttons has been removed in Firefox 4.
    Use one of these methods to open the tab history list:
    * Right click on the Back or Forward button
    * Hold down the left mouse button on the enabled Back or Forward button until the list opens
    You can look at this extension:
    * Backward Forward History Dropdown: https://addons.mozilla.org/firefox/addon/backforedrop/

  • Why does it say movie being modified try again later

    why does it say movie being modified try again later

    why does it say movie being modified try again later

  • Why does my session ID change actionResponse.sendRedirect()?

    Any ideas why my session ID would change after executing actionResponse.sendRedirect(<insert absolute url to a page in the same application>)?
    50% of the time my session id persists after sendRedirect(). The other 50% of the time the session id changes. This happens without making any changes to the application.
    Any ideas are welcomed.

    actionResponse.sendRedirect() supports 1)absolute URL and 2)full URI. try with full URI.
    Apart from these,why do you need to do the redirection ? If requires that,you can do it very well using taskflow.
    Regards,
    Hoque

  • Why does JRockit updates lag behind Sun's?

    If I understand correctly, JRockit's class libraries are exactly the same as Sun's.
    Sun has already released update 8 for their 1.5.0 JRE, and JRockit is still at update 6, which means that the class library bugs fixed in update 7 and 8 are still present in JRockit.
    Why does JRockit updates lag behind Sun's? Judging by [url http://forums.bea.com/bea/message.jspa?messageID=600038245&tstart=0]this post, this lag is measured in months!
    Doesn't the VM development happen separate from the class libraries? It should be possible to release a new JRE with the "stable", QA'd JRockit VM and the newest class library (with all its bug fixes) within a week or so, instead of months.

    The class libraries are almost identical, correct. But a JDK update from Sun almost always contains changes in other components than just the class libraries. Some of these affect JRockit, in particular the native libraries (AWT, I/O, etc). Changes in the class libraries may cause performance or stability regressions.
    With every release of JRockit we certify our JDK (Sun classes + JRockit JVM + other components) on a large number of platforms. We did a count earlier this year and came up with around 80 different combinations of JDK level, OS and hardware that we have to test in every release by the end of this year.
    On these platforms we run a huge set of tests, including performance and stress tests. Even though a large part of our QA is automated, it is simply not possible to run everything in parallel so there is a certain minimum amount of time this certification takes. On top of that we have a set of time-consuming tests that have to be run manually.
    To summarize it is simply not possible to do this without some lag. And JRockit has a much quicker uptake than almost all other 3rd party JDK providers (many of them with JVMs based on Sun HotSpot). One example is that it took IBM almost 18 months to get their first J2SE 5.0 implementation out of the door.

  • Why does the iPhone convert animated .GIF images?

    I saved a bunch of animated .GIF files on my iPhone.
    When I imported them onto my computer, they were all single framed .JPG files.
    Why does the iPhone convert the images, and is there any way to prevent this?
    Thanks!

    you can play gif in webView ,just the same way you load a jpeg or png..
    NSString *path = [[NSBundle mainBundle] pathForResource:@"santa" ofType:@"gif"];
    NSURL *url = [NSURL fileURLWithPath:path isDirectory:NO];
    /* Load the request. */
    [myWebView loadRequest:[NSURLRequest requestWithURL:url]];
    the gif that is locally saved will be loaded.

Maybe you are looking for