Get sendError message using getResponseMessage

I could get the response code, but I can't get the message I set on the servlet side using sendrror(code, message).
For example, if I set code to be 404 and message is "ABC", I will get "Not Found" as message, not "ABC" on the client side. I want to pass some customized error message from server to my java client (not browser), how can I do that? It seems that the message is canned according to the response code, no matter what you set on the servlet side using sendError method.
Thanks.

First, make sure you didn't send any content to the client before calling that method, since by calling it, you're setting a header (the response status code).
Second, you can't use the method sendError with a client that does not communicate using the HTTP protocol.
Third, if you're using IE 5.0 as the client , that browser will replace your stuff with its own 404 error page. The solution would be to go to the Tools/Internet Options/Advanced/ and disable the box 'Show friendly HTTP error messages '.
Try that and repost if problem subsists, along with the server you're using.

Similar Messages

  • Get error message using adobe reader

    I keep getting a message error that says Adobe blocked for this web site.  Why?  Does Apple have a reader I can use for all pdf's?

    Karla8040,
    what is the exact text of the message error that you’re getting?

  • Getting a message using messageID

    Hi all,
    I wanna use messageID to reach messages because the message no(relative order of the message) may change. It is ok to get messageID's of messages but I could not see any method to get a message from the server by messageID. Messages may be taken by UID or messageNo in JavaMail. Is it possible to get messages using MessageID's? Should I perform a searc based on messageID to get message?

    You need to remember that:
    1. Not all messages will have Message-IDs.
    2. Message-IDs are not guaranteed to be unique.
    While these situations are rare, you need to decide whether that's
    something that your application can handle.
    If you're using IMAP, you'll be much better off using UIDs.
    If you're using POP3, you'll also be much better off using UIDs.
    While an IMAP server can fairly efficiently search by Message-ID,
    when using POP3 all the message headers will need to be downloaded
    to the client and the search will be performed on the client, which is
    fairly expensive for large numbers of messages.

  • Function module to get error message, using MSGNR, MSG ID, MSGV1...etc...

    Hi There,
         I have BDC, in return it gives me message number, message ID, msgv1,...... etc. I want to get the original message using these values.
    Please can you tell me which function module should I use.

    Hii
    Call the FM
    <b>FORMAT_MESSAGE</b>
    <b>Reward if Helpful</b>

  • Getting Error Message using Formatted Search

    Hi,
    I am using formatted search for validating a particular field, and that happens fine.  Kindly let me know if I can also display error messages using the same formatted search.
    If yes, what am I to include in the formatted search, and if No, please let me know the alternative.
    Thanks in advance.
    Satish.

    Hi Satish,
    if you validate the value of a field and intend to rise an error message on detection of invalid values in a separate window or in the status line there is no way to do it with Formatted Searches (as far as I know)!
    You could use the following methods as simple workarounds if you don't want to program a solution with the SDK:
    1. Solution
    You can display the text of an error message in the field you validate; of course, the invalid data then is overwritten with your error message, but you could construct the message from fixed text parts concatenated with the data found in the field.
    Be sure to save the original data of the field in your query before you do anything else. This way you sustain the field data in case the data is valid!
    Example:
    DECLARE @save AS ....
    SET @save = $[xxxxx]
    IF $[xxxxx] test on invalid data
      SELECT 'Error: Invalid data: ' + $[xxxxx] -- in case of error
    ELSE
      SELECT $[xxxxx] -- no error - sustain valid data
    END
    2. Solution:
    You define a sepate User Defined Field (UDF) for potential error messages - that's the way I often programmed it for our own applications. Suppose that the Formatted Search is connected to this UDF and the field to validate is field 'xxxxx'. The Formatted Search is triggered (auto-refresh) on change of field 'xxxxx':
    IF $[xxxxx] test on invalid data
      SELECT 'Error: Invalid data: ' + $[xxxxx] -- in case of error
    END
    May be that there are minor syntactical errors or missing type conversions in the code above - but I hope it gives you an idea on how to solve your problem without SDK programming!
    Good luck!
    Frank Romeni

  • Equium A60: I get error message using explorer.exe

    Everytime I try to open an image file using Paint or Fax/Image viewer, or I try to drag a file into a folder I get the following error message:
    "Windows Explorer has encountered a problem and needs to close. We are sorry for the inconvenience"
    The error report says:
    "AppName: explorer.exe AppVer: 6.0.2900.2180 ModName: rpcrt4.dll
    ModVer: 5.1.2600.2180 Offset: 000847a6"
    Also I cannot open webpages that open in new IE windows. Norton Internet Security 2005 also would not open, but did claim to be active in the background.
    Does anyone have any advice for me?
    I've tried all the help for explorer.exe problems on helpwithwindows.com but nothing they suggested worked - such as spyware, malaware removal. I've run a few online virus checks - since Norton won't work I had to try the online scans.
    The laptop was bought last year, and we've lost the recovery CDs - so if we need them, then where can we get replacements?
    Many thanks,
    Jonathan

    Hi
    Well, this sound like a OS software malfunction. It's possible that some registry entries or/and data files are corrupted and damage.
    However, the best solution is to recover the OS.
    The other possibility is to use the "system restore" tool of Win XP.
    Then you can try to roll back the OS to the early point. But if it doesnt work so the new installation is needed.
    regards

  • OMG.  All people who get the message "use itunes to restore", click here!!!

    ok, this may not work for you, but it worked for me!
    by the way, i discovered this on my own, no thx to anyone else.:P
    ok, when it says that use itunes to restore"uitr, as ill call it", plug it into ur comp.
    ok, now, itll say to restor the ipod, blabla, then click restore, and the message that pops up, DONT CLICK OK YET!!!!!
    it totally messes it uP!!!
    instead, look at ur ipod screen. u should(hopefully), see a screen with the apple, and a little bar at the bottom that is filling up. wait till it fills up, then the screen will flash and whatnot, and then, when something happens, u will click ok. itll revert to factory settings and all, but u just have to sync ur ipod, and the music will go back in.
    FOR THOSE OF U WHO R WORRIED ABOUT LOSING UR MUSIC, DONT WORRY, IT WONT BE LOST, U WILL STILL HAVE IT, TRUST ME COMPLETELY.
    DO THIS B4 CALLING APPLE, THEY WILL NOT BE ABLE TO HELP U LIKE I AM, TRUST ME....I CALLED THEM:p LOL.
    :D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D
    have a nice day!:)
      Windows XP  

    Is this a recurring problem with you're iPod? I have a 2nd Gen. Nano, hardly used, maybe twice and this has happened 3 times to me already. I get it to work and then at some point it happens again. How are you handling it or are you just dealing with the problem?
    Dell   Windows XP  

  • Trying to convert word to pdf and getting error message using Ver. 7

    I what sent a word doc by a correspondent of mine which I tried to convert to a pdf. I right clicked the doc on my desk top and chose "convert to PDF". It looked as it has all the other times but after it had opened word it came up with an error window/message of "Missing PDFmaker files." "Do you want to run the installer in repair mode?" and then a yes or no button. If I hit no it closes everything if I hit yes it acts like it's installing something and after a while it tells me that the computer needs to be restarted for changes to take affect. I have run it twice now and it doesn't change anything.
    can someone give me any tips on this?
    D

    You did not indicate the version of WORD. If it is WORD 2007, then you can not do this function with AA7. Try opening the file in WORD and printing to the Adobe PDF printer. If that works, then look for the PDF Maker options in WORD (create PDF). If you find them, then try that. If they do not show but the print worked, then you indeed have an issue with PDF Maker - probably either the macro is not activated in WORD or the version of WORD is 2007.

  • I keep getting error messages using Mail

    error: the message could not be appended to the outbox
    the message could not be moved to the mailbox trash
    Any ideas?

    Back up all data.
    Select the named mailbox in the mailbox list, then select
    Mailbox ▹ Rebuild
    from the menu bar. Try to delete the message again.

  • When I login I get a message "aosnotifyd wants to use your confidential information stored in "my name" in your keychain." How do I know if it is safe to allow this? Can anyone advise please?

    Every time I login I get the message "aosnotifyd wants to use your confidential information stored in "my name" in your keychain." How do I know if it is safe to allow this? Can anyone advise please?

    My immediate reaction is to deny.
    Have you downloaded or installed any application that may relate to the abbreviation AOS? It may not necessarily be the application's name, could be the developer or distributor.
    As it's occuring at log-in, go to System Preferences > Accounts > your account > Login Items and look for a related item. If there's one there, right-click (or ctrl click) on it and select Reveal in Finder. That will show you where the originator of the item is on your system and should give you more of a clue as to what it is.
    I'd remove the item from login items anyway (highlight and click the minus sign at the bottom of the window). There shouldn't be anything trying to use your keychain info to notify anyone.

  • HT204053 I want to play newly purchased music but cant, i get the message "You can use iTunes Match on this computer with just one Apple ID every 90 days. (mobileme family pack is the problem i think)

    I purchase a new album on my phone but then cannot download it to my laptop -  I get the message:
    "You can use iTunes Match on this computer with just one Apple ID every 90 days. All I can think is that the problem stems from purchasing a mobileme family & some of the music being my daughters. (she is 9 & I need to be ble to listen to more than Katy Perry & Justin Bieber) Please help! :-(

    Welcome to the Apple Community.
    Youll get that message when you change the iTunes account you are logged into, you can't keep changing it.

  • I am in the middle of a job using CS 6, but at the same time opening the Creative Suite apps.  I created an InDesign file in CS 6, saved it, and now I can't open it. I'm getting this message: Cannot open file because it was saved with a newer version of A

    I am in the middle of a job using CS 6, but at the same time opening the Creative Suite apps.  I created an InDesign file in CS 6, saved it, and now I can't open it. I'm getting this message: Cannot open file because it was saved with a newer version of Adobe InDesign CC (10.1). You must use that version or later to open the file." AARRGGHH! So how do I access the file?

    Sounds like you opened and saved it in CC, so now you need to go back to CC and either complete the project there, or export to IDML to take it back into CS6.

  • Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/Users/scottmcdonald/Desktop/Screen Shot 2012-03-14 at 9.39.52 PM.png

    Haven't been able to use pages for a while.  Keep getting following message.  Have tried reinstalling iWork, but no luck.  Same problems with Keynote and Numbers/

    Have you moved Pages from its installed location? Or just dragged a copy to your current system?
    It can't find some of its resources apparently.
    Peter

  • Not able to get the message from Queue using MQ adapter

    HI
    Using Mq adapter am able to put the message in a queue and am able to get the message if i select the schema type as opaque, but am not able to get the message if i specify any schema type and am getting timed out exception.
    Kindly help to proceed with this issue.

    Hi,
    Am also facing the same issue.
    I would be thankful if anyone can provide the solution

  • I am extremely upset. I purchased my iPad in SA and I am traveling in Greece. When I want to make use of the free apps, I get a message that the app is not available in the SA store. What is the point of having an iPad if you cannot use it worldwide?

    I am extremely upset. I purchased my iPad in SA and now I am in Greece. I cannot download free apps as I get a message that the apps are not available in the SA store and only in US stores. When I change to the US store the same thing happens. What is the point of having an iPad if I cannot use it worldwide??? I feel that I wasted my money purchasing it as I specifically purchased it to use when I travel. How can I get access to all the available apps and why are they restricted.

    You can use your iPad worldwide. However, each AppleID is tied to
    a specific country's store. To use the AppStore in any country, you
    must be in that country and have a credit/debit card issued by a financial
    institution in that country with a verified billing address in that country.
    It is the developer's choice which AppStores he makes his app available
    from, and some countries prohibit certain apps.
    To make a purchase from the US store (including downloading a free app
    available in the US store), you must be in the US and have card issued
    in the US with verified billing address in the US.
    You can use your purchases from the SA store worldwide, but you
    cannot make purchases in other than the SA store unless you meet
    the aforesaid conditions.

Maybe you are looking for

  • SWF file is not working in Portal PROD System

    Hi All,           We have written custom mxml script in Adobe Flex 3 which displays the list of applications stored in the DB. Then we have posted that .swf file into our Portal KM and then we have created one URL iView with the location from KM. The

  • Opening a protected pdf document on my iPhone

    I can access a website at work using Safari, but the document I want to read is a pdf with a password req'd to open it....I can't get the usual dialogue box to appear that will let me enter the password...any ideas?

  • 0 dBm download power

    I've been having intermittent broadband speed problems for a couple of weeks now. My BT home hub 2 has been reset daily in an attempt to fix. I realise this probably doesn't help as my IP profile has been reduced to 572kbps download and will take atl

  • Error when using ant

    When I use ant to compile, I always get this message: C:\WINDOWS\system32\ntvdm.exe Error while setting up environment for the application. Chose 'Close' to terminate the application. [Close] [Ignore]

  • How to pass a command string and  file content in a socket?

    socket = new Socket(host.getHostIp(), host.getFilePort()); BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("c:/test.xls"))); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())); bw