Problem with encoding..pls have a look at this.

i'm getting data posted to a servlet in this format.
Content-Type: application/octet-streamContent-Transfer-Encoding: binaryΦ♥ ☻ ☻
♥ d e ╚ ╔ ,☺ -☺ ?☺ �☺ ⌠☺ ⌡☺ X☻ Y☻ ╝☻ ╜☻ * ☺ ♂ * S P E C C Y
~☻☺ ♥ ♀ ▬ ☺ � S P E C C Y ~☻☻ ☺ ☻ ♂ � ▼ ☻ B S P E C C Y ~☻☺ ♥ ♦ ♫ ↑ " ☺
how can i get the string equivalent of this.?
i tried the following codes to receive the data.
InputStream in = request.getInputStream();
BufferedReader br = new BufferedReader(     new InputStreamReader(in));
     String strdata=null;
        String receivedData="";
         do
              strdata=br.readLine();
              if(strdata!=null)
                   receivedData+=strdata;
              System.out.println(strdata);
         while(strdata!=null);
         byte[] receivedDataBytes=receivedData.getBytes();Also i tried this
BufferedInputStream bis=new BufferedInputStream(in);
         bis.read(data, 0, 330);still its not working...pls help!!!

yes i'm the server.
client is a hardware device and it posts data to the url which is a servlet.
the client sets some custom headers and the body
i was able to read the headers set by the client.
but the body part comes like this.
Content-Disposition: form-data; name="data"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binarythese were also there in the body part but i was able to read them as meaningful strings..
i need to submit the status by today.
i can't say them that i could read the data...
i need to tell soem valuable reasons..
pls help!!

Similar Messages

  • SCOM - -500 Internal Server Error - There is a problem with the resource you are looking for, and it cannot be displayed

    Hi There,
    Need your assistance on the issue that we are facing in prod environment.
    We are able to open web console from remote machine and able to view monitoring pane as well as my workplace folders from console . Able to view and access alerts and other folder in the monitoring pane. We are able to view and access My Workplace folder
    and able to view the reports in Favorite Reports folder. But when I click on run Report we  are getting the below error  "500 Internal Server Error - There is a problem with the resource you are looking for, and it cannot be displayed."
    In our environment we have 3 servers one is SQL server and two are SCOM servers. Please advise how to fix this issue. Do we have to do any thing from SQL End?
    Errors: Event ID 21029: Performance data from the OpsMgr connector could not be collected since opening the shared data failed with error "5L".
     Event ID 6002 : Performance data from the Health Service could not be collected since opening the shared data failed with error 5L (Access is denied.).
    Regards,
    Sanjeev Kumar

    Duplicate thread:
    http://social.technet.microsoft.com/Forums/en-US/7675113e-49f0-4b3a-932b-4aceb3cfa981/scom-500-internal-server-error-there-is-a-problem-with-the-resource-you-are-looking-for-and-it?forum=operationsmanagerreporting
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • 502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream cont

    I am getting error while accessing url of lyncweb.domain.com, dialin.domain.com and meet.domain.com pointing to RP server.
    502 - Web server received an invalid response while acting as a gateway or proxy server.
    There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    When i try with https://lyncfrontend.domain.local:4443 and https://lyncfrontend.domain.com:4443 both opens but when i open the external domain name i get certificate .
    ARR version installed is 3.0
    To throw more light on the configuration:
    Lync 2013 implemented, internal domain name is : domain.local and external domain name is : domain.com
    All servers in VMs are with 4 core processor, 24gb ram, 1TB drive.
    Frontend : Windows 2012r2 with Lync 2012 Standard Edition - 1 No (192.168.10.100)
    Edge : Windows 2012 with Lync 2012 Std - 1 No 
    (192.168.11.101 DMZ) in workgroup
    ISS ARR Reverse Proxy 3.0 : Windows 2012 with ARR and IIS configured. (192.168.11.102)
    Certificate : Internal Domain root CA for internal and External (Digicert).
    Internal Network : 192.168.10.x /24
    External Network (DMZ) : 192.168.11.x /24
    Public Firewall NAT to DMZ ip for firewall and RP server. So having two public IP facing external network.
    Edge has : sip.domain.com, webconf.domain.com, av.domain.com
    IIS ARR RP server has : lyncdiscover.domain.com, lyncweb.domain.com, meet.domain.com, dialin.domain.com
    Have created SRV record in public : _sip.tls.domain.com >5061>sip.domain.com, _sipfederationtls._tcp.domain.com>5061>sip.domain.com, _xmpp-server._tcp.domain.com>5269>sip.domain.com
    Installed frontend server using MS Lync server 2013 step by step for anyone by Matt Landis, Lync MVP.
    Internal AD Integrated DNS pointing Front-end
    Type of Record FQDN
    IP Description 
    A sip.domain.com
    192.168.10.100 Address internal Front End  or Director for internal network clients 
    A admin.domain.com
    192.168.10.100 URL Administration pool
    A DialIn.domain.com
    192.168.10.100 URL Access to Dial In 
    A meet.domain.com
    192.168.10.100 URL of Web services meeting
    A lyncdiscoverinternal.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to internal users
    A lyncdiscover.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to external users  
    SRV Service: _sipinternaltls Protocol: _tcp Port: 5061
    sip.domain.com Record pointer services to internal customer connections using TLS 
    External DNS pointing Edge & Proxy
    Type of Record FQDN
    IP Endpoint
    A sip.domain.com
    x.x.x.100 Edge
    A webconf.domain.com
    x.x.x.100 Edge
    A av.domain.com
    x.x.x.100 Edge
    SRV _sip._tls.domain.com
    sip.domain.com: 443 Edge
    SRV _sipfederationtls._tcp.domain.com
    sip.domain.com:5061 Edge
    A Meet.domain.com
    x.x.x.110 Reverse Proxy
    A Dialin.domain.com
    x.x.x.110 Reverse Proxy
    A lyncdiscover.domain.com
    x.x.x.110 Reverse Proxy
    A lyncweb.domain.com
    x.x.x.110 Reverse Proxy
    In IIS ARR proxy server following server farms are added and configured as per link ttp://y0av.me/2013/07/22/lync2013_iisarr/
    In proxy server had setup only following server farm : While running remote connectivity web service test : meet, dialin, lyncdiscover and lyncweb.
    The client inside works fine internally and through vpn. Login with external client also working fine. But we are getting error in MRCA as follows.
    a) While testing remote connectivity for lync getting error : The certificate couldn't be validated because SSL negotiation wasn't successful. This could have occurred as a result of a network error or because of a problem with the certificate installation.
    Certificate was installed properly.
    b) For remote web test under Lync throws error : A Web exception occurred because an HTTP 502 - BadGateway response was received from IIS7.
    HTTP Response Headers:
    Content-Length: 1477
    Content-Type: text/html
    Date: Wed, 14 May 2014 10:03:40 GMT
    Server: Microsoft-IIS/8.0
    Elapsed Time: 1300 ms.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

  • Problem with iOS7 : I have a message on my screen "This phone is not registred as a developper phone..." or something like that, can you help me because I download the iOS7 Beta even if I was not a developper. Thank you very much if you help me.

    Problem with iOS7 : I have a message on my screen "This phone is not registred as a developper phone..." or something like that, can you help me because I download the iOS7 Beta even if I was not a developper. Thank you very much if you help me.

    JaillotJb wrote:
    I download the iOS7 Beta even if I was not a developper.
    if you downloaded it and are not a developer, then we are not allowed to help you here.  sorry.

  • Hi am having problems with iTunes,I have all my music on my 4s but I bought the iPhone 5 today.us there any way that I can transfer music over to my new phone without using the library?as it doesn't seem to be on my PCM anymore.

    Hi am having problems with iTunes,I have all my music on my 4s but I bought the iPhone 5 today.is there any way that I can transfer music over to my new phone without using the library?as it doesn't seem to be on my PC anymore.i reset my pc and save my iTunes to a hard drive but can't access it.Need help please

    " When I did this, my library showed all the music I have "purchased" from itunes but did not have the music that I downloaded a long time ago through itunes from my old CDs."
    Correct.
    " How can I get that music to show up in my library now on my new computer?  "
    Copy it from your old computer or your backup copy of your old computer.
    The sync is one way - computer to ipod.

  • TS1398 since i update my iphone4 to ios6 i have a problem with my wi-fi i never had this problems before .

    since i update my iphone4 to ios6 i have a problem with my wi-fi i never had this problems before .

    If it is grey and/or won't allow you to slide it to the on position, follow these steps... More than likely you will need to get it serviced.
    iOS: Wi-Fi settings grayed out or dim
    Follow these steps to resolve the issue:
    Restart your iOS device.
    Make sure that airplane mode is off by tapping Settings > Airplane Mode.
    Reset the network settings by tapping Settings > General > Reset > Reset Network Settings.
    This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings.
    Make sure that your device is using the latest software. To do so, connect your device to your computer and check for updates in iTunes.
    If you still can't turn Wi-Fi on, please contact Apple for support and service options. If you can turn Wi-Fi on but are experiencing other issues with Wi-Fi, see how to resolve those Wi-Fi issues.

  • HT204152 hello i have a problem with app store cant download program get this error verification required and no accept my visa card

    hello i have a problem with app store cant download program get this error verification required and no accept my visa card

    what i can start to download and updated programs

  • Over the course of many years I seem through using different computers to have several apple ids and three email addresses, this is causing problems with synchronising, I have an iPod, iPhone and ipad

    Over the course of many years I seem through using different computers to have several apple ids and three email addresses, this is causing problems with synchronising, I have an iPod, iPhone and ipad

    Hi there
    Sorry for hijacking your thread as put by Dahveed. However I have resolved my issue so I thought I'll share it with the rest of you.
    I checked for the error 3194 in youtube and I found some good videos that tell you how to resolve the problem. The issue I was facing was the actually (I know because I have resolved it now) the communication between my computer and apple server which can be fixed as following (if you are using windows):
    There is file in following directory:
    C:\Windows/system32/drivers/etc/hosts
    The file normally has no extension and it is in file format. You need to open it and make sure that every line that has apple server id starts with "#". In my case one of the line started directly with the ip address and then gs.apple.com.
    Perform your restore/update after that and hopefully it should be resolved (mine did).
    Cheers

  • Can you have a look at this video and give advice please?

    Hi Guys,
    Can you have a look at this video-
    http://www.youtube.com/watch?v=UA0x3bQUW-g
    I shot it for a friend at a hotel. Can you let me know if if works ok / stutters etc. on your computer.
    I edited hdv pal / ppro cs3 then adobe media encoder to H 264 1280 x 720 25fps bitrate min 2 max 4. keyframes 25.
    It looks pretty bad i think at the normal youtube. It looks a lot better when you hit the 'watch in hd' but begins to stutter.
    Do you have any advice?
    Many thanks
    scott

    First, thank you for doing a very nice piece. I'm a tad bit tired of the "in-your-face" skateboarding pieces. The young lady is also "easy on the eyes."
    Second, I looked at the piece in both resolutions, and also after all buffering had completed. The only things that I saw were one Transition at about the 1/4 point that seemed to have about a 1-frame "glitch," or something. Two of the Titles also did not seem to fade-up/move-in at the same pace, or with the same smoothness as the others. Even looking at movement, like the flag (again near the 1/4 mark - sorry that I did not write down the exact TimeCode), I did not notice any stuttering. I'd better get this out of the way right now, I'm viewing on my laptop's 17" 1680x1050 nVidia GeForce 8800M GTX-512MB display, with full hardware acceleration.
    Not sure what you, and Dan, are seeing. I'm usually a pretty critical observer, though might be missing something important. If you can give me a TimeCode and where, in the frame, you're both seeing the problems, I'll be glad to give it another go.
    Good luck,
    Hunt
    PS I like the mood that both the visuals and music convey. My wife also made note of the URL, for our next trip to the UK in October.

  • Material staging in WM - Jurgen please have a look at this

    Dear Jurgen,
    I'd kindly like to ask you to please have a look at this issue.
    Re: Requesting urgent reply
    Thanks in advance,
    Csaba
    (sorry for sending message this way...)

    I answered in the other thread.

  • Having problems with a message saying a script in this movie is causing adobe to run slowly if it continues to run, your computer may become unresponsive

    Having problems with a message saying,A script in this movie is causing adobe flash player to run slowly if it continues to run, your computer may become unresponsive. Do you want to abort script. And my system seems to freeze. What can I do

    Here is the download page for Click-to-PlugIn:
    http://hoyois.github.com/safariextensions/clicktoplugin/

  • Problem with encoding and charset for downloading a file

    Hi guys, I have a problem and I beg for your help, I am 1000% frustrated at this point.
    I have a servlet which have to do something and give a file log to the final user. Coding the logic for that took me about 5 minutes, the problem is that the given file doesnt shows properly in notepad (Default app to open txt files). I have tried every way I have read over the internet and absolutely nothing works.
    After trying about 20 different ways fo doing this without success, this is my actual code:
    Charset def=Charset.defaultCharset();
    OutputStreamWriter out = new OutputStreamWriter(servletOutputStream,def);
    for (String registry:regList) {
    out.write(registry+"\n");
    out.close();
    the page gives the file to the user, I can download or open it, when I open it this is the result
    registry1registry2registry3registry4registry5registry6registry7...
    and I am expecting:
    registry1
    registry2
    registry3
    registry4
    registry5
    If I open it with wordpad or notepad++ the file looks fine, but I cant achieve that notepad reads it correctly. I have spent about 10 hours on this and at this point I just dont know what to do, i have tried Windows-1252, UTF-8, UTF-16, the Default one. I have tried to set this enconding on the response header with no luck. Any help will be very appreciated.
    Thanks in advance.

    >
    I have a servlet which have to do something and give a file log to the final user. Coding the logic for that took me about 5 minutes, the problem is that the given file doesnt shows properly in notepad (Default app to open txt files). I have tried every way I have read over the internet and absolutely nothing works.
    If I open it with wordpad or notepad++ the file looks fine, but I cant achieve that notepad reads it correctly. I have spent about 10 hours on this and at this point I just dont know what to do, i have tried Windows-1252, UTF-8, UTF-16, the Default one. I have tried to set this enconding on the response header with no luck. Any help will be very appreciated.
    >
    Your file likely uses *nix style line endings and use a single LF (0x0A) as the end of each line.
    Notepad doesn't recognize a single LF as the end of line; it expects CRLF (0x0D0A). The encoding isn't the issue.
    If you have to use Notepad you will need to add code to find all of the LF characters and insert a CR character in front of them.

  • Problems with encoding when creating link in mail

    A user inputs some text in a field at a webpage.
    From this I build a mail that has a link that looks like this:
    http://www.domain.com/a/controller/action/?name=[INPUT VALUE]
    My problem is that when I try to get the value in the receiving action, using params.name, it does not so good. The real problem is about odd characters like our swedish �,�,� for example.
    What I have tried to do when building the link is to use URLEncoder.encode([INPUT VALUE], 'UTF-8') and then using URLDecoder.decode(params.name, 'UTF-8') but it does not work at all. Is there any other way I should attack this problem?

    def name = "Mattias Sands�ter";
    def email = params.email;
    name = URLEncoder.encode(name, 'UTF-8');
    println(name)
    def message = http://domain.com/a/b/download/?name=" + name
    MailSender.sendMail(email, "Subject", message);{code}
    {code}def download = {
    println(params.name)
    println("download after decode" + URLDecoder.decode(params.name, 'UTF-8')){code}
    The first println looks fine, it says Mattias+Sands%C3%A4er
    The second println looks horrible, Mattias Sands��ter
    The third looks the same.
    Then I send this to my gsp(jsp) page and wants to put this in a standard textfield, but it of course looks like Mattias Sands��ter there too.
    This is on a linux-server, on my local computer, everything works as expected.
    Whatever it its, something happens to the name-variable when it is clicked on in the e-mail. It looks good in the e-mail, get pasted in the address-field in the browser correctly, but when retreiving the variable with params.name it is screwed
    Edited by: sandsater on Jul 8, 2008 8:44 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem With ButtonUI in an Auxiliary Look and Feel

    This is my first post to one of these forums, so I hope everything works correctly.
    I have been trying to get an axiliary look and feel installed to do some minor tweaking to the default UI. In particular, I need it to work with Windows and/or Metal as the default UI. For the most part I let the installed default look and feel handle things with my code making some colors lighter, darker, etc. I also play with focus issues by adding FocusListeners to some components. I expect my code to work reasonably well no matter what the default look and feel is. It works well with Motif, Metal, and Windows, the only default look and feels I've tested with. What I'm going to post is a stripped down version of what I have been working on. This example makes gross changes to the JButton background and foreground colors in order to illustrate what I've encountered.
    I have three source code files. The first, Problem.java, creates a JFrame and adds five buttons to it. One button installs MyAuxLookAndFeel as an auxiliary look and feel using MyAuxButtonUI for the look and feel of JButtons. The next button removes that look and feel. The next button does nothing except print a line to System.out. The next button installs MyAuxLookAndFeel as an auxiliary look and feel using MyModButtonUI for the look and feel of JButtons. The last button removes that look and feel.
    The problem is, when I install the first auxiliary look and feel, buttons are no longer tabable. Also, they cannot be invoked by pressing the space button when they're in focus. When I remove the first auxiliary look and feel everything reverts to behaving normally. When I add the "Mod" version, button tabability is fine. The only difference is I've added the following code:
    if ( c.isFocusable() ) {
       c.setFocusable(true);
    }That strikes me as an odd piece of code to profoundly change the program behavior. Anyway, after adding and removing the "Mod" look and feel, the tababilty is forever fixed. That is, if I subsequently re-install the first look and feel, tababilty works just fine.
    The problem with using the space bar to select a focused button is more problematic. My class is not supposed to mess with the default look and feel which may or may not use the space bar to press the button with focus. When the commented code in MyModButtonUI is uncommented, things behave correctly. Even the statement
    button.getInputMap().remove( spaceKeyStroke );doesn't mess things up after the auxiliary look and feel is removed. So far I've tested this with JRE 1.4.2_06 under Windows 2000, JRE 1.4.2_10 under Windows XP, and JRE 1.5.0_06 under Windows XP and the behavior is the same.
    All of this leads me to two questions.
    1. Is my approach fundamentally flawed? I've extended TextUI and ScrollBarUI with no problems. This is the only problem I've encountered with ButtonUI. My real workaround for the space bar issue is better than the one I've supplied in the example, but it certainly is not guaranteed to work for any arbitrary default look and feel.
    2. Assuming I have no fundamental problems with my approach, it's possible I've found a real bug. I searched the bug database and couldn't find anything like this. Of course, this is the first time I've tried seasrching the database for a bug so my I'm doing it badly. Has this already been reported as a bug? Is there any reason I shouldn't report it?
    What follows is the source code for my example. It's in three files because the two ButtonUI classes must be public in order to work. Thanks for insight you can provide.
    Bill
    File Problem.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Problem extends JFrame {
       public boolean isAuxInstalled = false;
       public boolean isModInstalled = false;
       public LookAndFeel lookAndFeel = new MyAuxLookAndFeel();
       private static int ctr = 0;
       public static void main( String[] args ) {
          new Problem();
       public Problem() {
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(250, 150);
          setTitle("Button Test");
          JButton install = new JButton("Install");
          JButton remove = new JButton("Remove");
          JButton doNothing = new JButton("Do Nothing");
          JButton installMod = new JButton("Install Mod");
          JButton removeMod = new JButton("Remove Mod");
          this.getContentPane().setLayout(new FlowLayout());
          this.getContentPane().add(install);
          this.getContentPane().add(remove);
          this.getContentPane().add(doNothing);
          this.getContentPane().add(installMod);
          this.getContentPane().add(removeMod);
          install.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isAuxInstalled ) {
                   isAuxInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          remove.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isAuxInstalled ) {
                   isAuxInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          doNothing.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                System.out.println( "Do nothing " + (++ctr) );
          installMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isModInstalled ) {
                   isModInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          removeMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isModInstalled ) {
                   isModInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          setVisible(true);
       class MyAuxLookAndFeel extends LookAndFeel {
          public String getName() {
             return "Button Test";
          public String getID() {
             return "Not well known";
          public String getDescription() {
             return "Button Test Look and Feel";
          public boolean isSupportedLookAndFeel() {
             return true;
          public boolean isNativeLookAndFeel() {
             return false;
          public UIDefaults getDefaults() {
             UIDefaults table = new MyDefaults();
             Object[] uiDefaults = {
                "ButtonUI", (isModInstalled ? "MyModButtonUI" : "MyAuxButtonUI"),
             table.putDefaults(uiDefaults);
             return table;
       class MyDefaults extends UIDefaults {
          protected void getUIError(String msg) {
    //         System.err.println("(Not) An annoying error message!");
    }File MyAuxButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.multi.*;
    import javax.accessibility.*;
    public class MyAuxButtonUI extends ButtonUI {
       private Color background;
       private Color foreground;
       private ButtonUI ui = null;
       public static ComponentUI createUI( JComponent c ) {
          return new MyAuxButtonUI();
       public void installUI(JComponent c) {
          MultiButtonUI multiButtonUI = (MultiButtonUI) UIManager.getUI(c);
          this.ui = (ButtonUI) (multiButtonUI.getUIs()[0]);
          super.installUI( c );
          background = c.getBackground();
          foreground = c.getForeground();
          c.setBackground(Color.GREEN);
          c.setForeground(Color.RED);
       public void uninstallUI(JComponent c) {
          super.uninstallUI( c );
          c.setBackground(background);
          c.setForeground(foreground);
          this.ui = null;
       public void paint(Graphics g, JComponent c) {
          this.ui.paint( g, c );
       public void update(Graphics g, JComponent c) {
          this.ui.update( g, c );
       public Dimension getPreferredSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getPreferredSize( c );
          return this.ui.getPreferredSize( c );
       public Dimension getMinimumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMinimumSize( c );
          return this.ui.getMinimumSize( c );
       public Dimension getMaximumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMaximumSize( c );
          return this.ui.getMaximumSize( c );
       public boolean contains(JComponent c, int x, int y) {
          if ( this.ui == null ) {
             return super.contains( c, x, y );
          return this.ui.contains( c, x, y );
       public int getAccessibleChildrenCount(JComponent c) {
          if ( this.ui == null ) {
             return super.getAccessibleChildrenCount( c );
          return this.ui.getAccessibleChildrenCount( c );
       public Accessible getAccessibleChild(JComponent c, int ii) {
          if ( this.ui == null ) {
             return super.getAccessibleChild( c, ii );
          return this.ui.getAccessibleChild( c, ii );
    }File MyModButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.plaf.*;
    public class MyModButtonUI extends MyAuxButtonUI
       static KeyStroke spaceKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0 );
       public static ComponentUI createUI( JComponent c ) {
          return new MyModButtonUI();
       public void installUI(JComponent c) {
          super.installUI(c);
          c.setBackground(Color.CYAN);
          if ( c.isFocusable() ) {
             c.setFocusable(true);
    //      final JButton button = (JButton) c;
    //      button.getInputMap().put( spaceKeyStroke, "buttonexample.pressed" );
    //      button.getActionMap().put( "buttonexample.pressed", new AbstractAction() {
    //         public void actionPerformed(ActionEvent e) {
    //            button.doClick();
    //   public void uninstallUI(JComponent c) {
    //      super.uninstallUI(c);
    //      JButton button = (JButton) c;
    //      button.getInputMap().remove( spaceKeyStroke );
    //      button.getActionMap().remove( "buttonexample.pressed" );
    }

    here is the code used to change the current look and feel :
    try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
             catch (InstantiationException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (ClassNotFoundException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (UnsupportedLookAndFeelException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (IllegalAccessException e)
                  System.out.println("Error occured in .. " + e.toString());
             Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
             Fenetre fen = new Fenetre();
             fen.setSize(dim.width, dim.height);
             fen.setResizable(false);
                 fen.setLocation(0, 0);
                  fen.setVisible(true);

  • Problem with encoding of xml document

    while parsing an xml document with SAX parser, i found that encoding of the xml document received as input stream is "ISO-8859-1" . After parsing certain fields has to be stored in the mysql table where table character set is "utf8" . Now what i found that ceratin characters in the original XML document are stored as question mark (?) in the database.
    1. I am using mysql 4.1.7 with system variable character_set_database as "utf8". So all my tables have charset as "utf8".
    2. I am parsing some xml file as inputsream using SAX parser api (org.apache.xerces.parsers.SAXParser ) with encoding "iso-8859-1". After parsing certain fields have to be stored in mysql database.
    3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - � and the problem is that words like can�t are shown as can?t by database.
    4. I notiicied that parsing is going on well and character code is 146 while parsing. But when i reterive it from the database using jdbc it shows character code as 63.
    5. I am using jdbc to prepared statement to insert parsed xml in the database. It seems that while inserting some problem occurs what is this i don't know.
    6. I tried to convert iso-8859-1 to utf-8 before storing into database, by using
    utfString = new String(isoString.getBytes("ISO-8859-1"),"UTF-8");
    But still when i retreive it from the databse it shows caharcter code as 63.
    7. I also tried to retrieve it using , description = new String(rs.getBytes(1),"UTF-8");
    But it also shows that description contains character with code 63 instead of 146 and it is also showing can�t as can?t
    help me out where is the problem in parsing or while storing and retreiving from database. Sorry for any spelling mistakes if any.

    duggal.ashish wrote:
    3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - ’ and the problem is that words like can’t are shown as can?t by database.http://en.wikipedia.org/wiki/ISO8859-1
    Scroll down in that page and you'll see that the character code 146 -- which would be 92 in hexadecimal -- is in the "unused" area of ISO8859-1. I don't know where you got the idea that it represents some kind of apostrophe-like character but it doesn't.
    Edit: Actually, I do know where you got that idea. You got it from Windows-1252:
    http://en.wikipedia.org/wiki/Windows-1252
    Not the same charset at all.

Maybe you are looking for

  • Mail opens two Safari windows when I click on a link in email

    When I click on a link in Mail, it opens in Safari -- that's the way I have it setup. Yet, the problem is that it opens two windows in Safari, one empty and one with the content of the link. This is the second problem I have with Mail. The second one

  • I want to exclude certain vendors up front of proposal creation from F110

    Hi,      I want to exclude certain vendors up front of proposal creation from T.code F110. Meaning - I would use the range 850000 - 999999, but I would also like to exclude for example vendor #'s  912271, 912771, 959281 from this proposal. Currently

  • Icloud keychain wrong number

    Hi, I'm running OSX 10.9.4 on my Macbook IOS 8.0.2 on my iPhone 6 When I try to activate iCloud keychain and I fill in my password and security code, it then sends a message to an old phone number for verification. I tried changing it on my computer

  • Doubt in Tablespaces

    Hello all, The production system is on SAP R/3 4.7 oracle 10.2.0.4 windows 2003 enterprise server(32-bit). I have the following doubts. 1) The tablespaces in the system are dictionary managed tablespces. I have encountered frequent performance proble

  • SP2013 - What better to use for custom webservice creation, which will be save filled in Infopath form to sharepoint library

    Client use SharePoint 2013. I have to develop a custom webservice for this SharePoint. Webservice will receive some information as request, will fill in a InfoPath form (on based existing infopath template from library) with this information and save