BodyContent.getReader() can't read SJIS code correctly

          I have the JSP file
          <%@ page contentType= "text/html;charset=SJIS" errorPage="error.jsp"%>
          <vcsql:escapesql>SJIS Characters Here</vcsql:escapesql>
          and in the escapesql tag's doAfterBody method,
          I use "bodyContent.getReader()" to read the characters
          and write it to JspWriter. This is fine in WL6.0SP2,
          but I got ??? in WL6.1. And it seems OK when I print
          some Japanese Characters directly using JspWriter.
          public int doAfterBody() throws JspException
          try
          JspWriter out = bodyContent.getEnclosingWriter();
          Reader reader = bodyContent.getReader();
          int ch = reader.read();
          while(true)
          if (ch == -1)
          break;
          else if (ch == '\'')
          out.print("''");
          else
          out.print((char)ch);
          ch = reader.read();
          reader.close();
          }catch (IOException ex)
          return SKIP_BODY;
          Can anyone help me? I guess it is a bug of WL6.1
          Thanks.
          Haining
          

You can't in JSP.
Java runs on the Server. You only have access to the server file system.
You do NOT have access to the client file system. And a good thing too.
Being able to load/edit/delete any file you want to from the client would be a huge security hole.
Just by browsing your website you pick up a file from my computer? I don't think so mate.
If you want the client to send a file, you have to use the standard html component for sending files: <input type="file">
In other words the user has to explicitly choose the file they wish to send to your server.
Your servlet then has to read that file from the request.
There are a couple of components around that help you with that. Check out the [url http://jakarta.apache.org/commons/fileupload/]jakarta commons File upload component.

Similar Messages

  • How  can i run this code correctly?

    hello, everybody:
        when  i run the code, i found that it dons't work,so ,i  hope somebody can help me!
        the Ball class is this :
        package {
        import flash.display.Sprite;
        [SWF(width = "550", height = "400")]
        public class Ball extends Sprite {
            private var radius:Number;
            private var color:uint;
            private var vx:Number;
            private var vy:Number;
            public function Ball(radius:Number=40, color:uint=0xff9900,
            vx:Number =0, vy:Number =0) {
                this.radius= radius;
                this.color = color;
                this.vx = vx;
                this.vy = vy;
                init();
            private function init():void {
                graphics.beginFill(color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
    and the Chain class code is :
    package {
        import flash.display.Sprite;
        import flash.events.Event;
        [SWF(width = "550", height = "400")]
        public class Chain extends Sprite {
            private var ball0:Ball;
            private var ball1:Ball;
            private var ball2:Ball;
            private var spring:Number = 0.1;
            private var friction:Number = 0.8;
            private var gravity:Number = 5;
            //private var vx:Number =0;
            //private var vy:Number = 0;
            public function Chain() {
                init();
            public function init():void {
                ball0  = new Ball(20);
                addChild(ball0);
                ball1 = new Ball(20);
                addChild(ball1);
                ball2 = new Ball(20);
                addChild(ball2);
                addEventListener(Event.ENTER_FRAME, onEnterFrame);
            private function onEnterFrame(event:Event):void {
                moveBall(ball0, mouseX, mouseY);
                moveBall(ball1, ball0.x, ball0.y);
                moveBall(ball2, ball1.x, ball1.y);
                graphics.clear();
                graphics.lineStyle(1);
                graphics.moveTo(mouseX, mouseY);
                graphics.lineTo(ball0.x, ball0.y);
                graphics.lineTo(ball1.x, ball1.y);
                graphics.lineTo(ball2.x, ball2.y);
            private function moveBall(ball:Ball,
                                      targetX:Number,
                                      targetY:Number):void {
                ball.vx += (targetX - ball.x) * spring;
                ball.vy += (targetY - ball.y) * spring;
                ball.vy += gravity;
                ball.vx *= friction;
                ball.vy *= friction;
                ball.x += vx;
                ball.y += vy;
    thanks every body's help!

    ok, thanks for your reply ! I run this code in the Flex builder 3!and the Ball class and the Chain class are all in the same AS project!
      and i changed the ball.pv property as public in the Ball class, and  the Chain class has no wrong syntactic analysis,but the AS code don't run.so this is the problem.
    2010-04-21
    Fang
    发件人: Ned Murphy <[email protected]>
    发送时间: 2010-04-20 23:01
    主 题: how  can i run this code correctly?
    收件人: fang alvin <[email protected]>
    I don't see that the Ball class has a pv property, or that you even try to access a pv property in the Chain class.  All of the properties in your Ball class are declared as private, so you probably cannot access them directly.  They would need to be public.  Also, I still don't see where you import Ball in the chain class such that it can use it.

  • What do you do when you can't read the code on a iTunes gift card?

    What do you do when you can't read the code on a iTunes gift card? I tried taking it back to the store with my reciept, but they said I would have to contact Apple support. Am I out just out $25 dollars?

    See this support article:
    http://support.apple.com/kb/TS1292
    Instructions are at the bottom of that article.
    BTW, this forum is for questions about iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. Normally you want to ask your questions in the general iTunes forums.
    Regards.

  • HT2736 I can't read the code on the back of the card. It was scratched off. How do I redeem?

    I can't read the code on the back of the card. It was scratched off. How do I redeem?
    Pjs

    Try  >  http://support.apple.com/kb/TS1292
    If no joy...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I can't read the code to type when posting on the community page like craigslist

    Hi,
    I'm troubled when posting in craigslist through firefox.
    I cannot read the code or a word to type when posting for a security purpose (spam). This problem has started a couple months ago with Firefox. With Safari, this does not happen.
    Appreciated if you can help me out here because I use firefox as my primary internet browser.

    Basics from the manual are restrt, reset, restore.
    Have you tried each of these?

  • The label was scratched too hard and can't read complete code. How do I get the code? Can it be derived from the serial number on the card?

    Can't read all of code (scratched off). How can I get it?

    See this: iTunes Store: Invalid, inactive, or illegible codes, http://support.apple.com/kb/TS1292

  • HT1711 I can't read my code on my iTunes card who do i contact?

    I can't see the code on my iTunes gift card who do I contact to help me out

    If this page doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

  • Dynamic-side Box? Can't read source code with java

    Hi all,
    I am trying to read a source code of a web page with a java program. I can connect to the page and read a part of the source code without any problems however after a while when it comes to a part where mozilla and opera identifies as "dynamic-side box" my java program fails to read the source code and stops reading the rest of the page.
    Here is the part of the output I get from mozilla:
    <body id="city">
              <script type="text/javascript" src="/js/wz_tooltip.js"></script>
              <div id="container">
                   <div id="container2">
                        <div id="header">
                             <h1>Ikariam</h1>
                             <h2>Antik �a&#287;&#305; Ya&#351;a!</h2>
                        </div>
    <div id="breadcrumbs"><h3>Bulundu&#287;un nokta:</h3><a href="?view=worldmap_iso&islandX=78&islandY=80" title="D�nya haritas&#305;na d�n"><img src="skin/layout/icon-world.gif" alt="D�nya" /></a> > <a href="?view=island&id=2444" class="island" title="Adaya d�n">Sterios[78:80]</a> > <span class="city">ProPolis</span></div><!-- -------------------------------------------------------------------------------------
         ///////////////////////////// dynamic side-boxes. //////////////////////////////////
         //////////////////////////////////////////////////////////////////////////////////// -->
         <div id="information" class="dynamic">
              <h3 class="header">Info</h3>
              <div class="content">And here is the corresponding part in java console output:
    <div id="breadcrumbs">
        <h3>Bulundu&#287;un nokta:</h3>
         <span class="textLabel">Hata!</span>
    </div>
    <div id="information" class="dynamic"></div>
    <div id="mainview">
        <div class="buildingDescription">
            <h1>Hata!</h1>
        </div>
        <div class="contentBox01h">
            <h3 class="header"><span class="textLabel">Hata mesaj&#305;</span></h3>
            <div class="content">
                <ul class="h�bsch">
    <li><a href="http://ikariam.net"></a></li>            </ul>
            </div><!-- end #content -->
            <div class="footer"></div>
        </div><!-- end #contentbox -->
    </div><!-- end #mainview -->Is there a way to skip this dynamic-side boxes in java. Because I need to read an information that is located at the near end of the source code however since it stops when it hits to a dynamic-side box I can't.
    Thanks in advance, regards...

    Hi,
    That is what I was trying in deed! I was trying with a Scanner but I also tried with the link you have given. That also failed. Somehow java stops reading the source when it hits "dynamic-side box". However there has to be a way to skip this. If mozilla can do that, I know that java also can. I wonder how....
    Cheers...

  • I can't read double codes  values through request.getParameterValues()

    Hello Everbody
    I have a simple problem.In the first jsp page have 4 comboBox all have name "photoSize" . option values of comboBox is (3R,4R,4"x6",8"x10"). i read these values in the next jsp pages
    String [] all=request.getParameterValues("photoSize");
    my problem is that when i selected 3R or 4R then values comes as 3R and 4R
    but when i selected the values 4"x6" or 8"x10" its only gave the output as 4 and 8.
    I cann't read these values as 4"x6" or 8"x10" . my requirement is that i have to read values as 4"x6" .or is there any other way to achieve these output.
    please any body help me it is urgent.
    Thanks in advance
    Riaz

    both single and double quotes can easily mess up JSP's so hard to say what exacly is wrong
    example:
    <select value="<c:out value="${avalue}"/>" >
    this will fail with  avalue contains a double quote because in HTMl the string becomes closed.There is no exact solution but i would suggest to not use those String as value for your select BUT use 0,1,2.... as value and then translate those in your code to the dimensions you need, thus avoiding the Quote problem

  • Can BIP read this code??

    my code looks like this, but the deisred results does not show properly . . . it doesnt have an error but the logic that i want doesnt apply :(
    <?xdoxslt:set_variable($_XDOCTX,'vLOB',(//ListOfBipPremeraOpportunityIo14/Opportunity/CompanyLineOfBusiness))?>
    <?if:(xdoxslt:get_variable($_XDOCTX,’vLOB’))=(//ListOfBipAssumptionCompanyQuoteIntegrationObject/CompanyQuoteAssumption/CompanyLineOfBusiness)?>
    <?CompanyDescription?>

    Did u try printing <?xdoxslt:get_variable($_XDOCTX,’vLOB’)?>
    Does this have the expected value?

  • AA 7.0 Document can´t read the file correctly

    Hello , I have a pdf document created for AA 4.0 and higher and if it is read in Adobe Acrobat 7.0 Document it has wrong font (accents). If I open the document in AA 9 or even in ordinary Reader, it is fine . Is there a problem in the document or in AA ? What could be the problem specifically and how to eliminate it ? Thank you in advance for your answer.

    You need to do the updates to AA7. I suspect that you are running 7.0 and that the fonts are not embedded. With 7.0 there was a problem with 4 fonts being in error in the system. The updates are at ftp://ftp.adobe.com/pub/adobe/acrobat/win/. The updates generally need to be installed in order.

  • What do I do if I can't read the code on an iTunes card

    can someone please help me?

    With any luck, the following document may be of some assistance with that:
    iTunes Store: Invalid, inactive, or illegible codes

  • Firefox on 2 independant laptops, not reading website source code correctly, when all correct on Chrome and IE.

    Rebuilt my website in Serif WebPlus X6.<br />
    Using Google Chrome or Internet Explorer the site is displayed correctly as is the source code.<br />
    In Firefox 18.0.1 Code is being read wrongly. Cleared Cache and fault still there. Checked in Wifes laptop – still the same fault on her Firefox and okay on Chrome and IE.<br />
    Code should read - span class="Body-C-C9">“Why won’t the doctors listen”?<pre><nowiki></span></p>
    But firefox is showing - span class="Body-C-C9">“Why won’t the doctors listen”?</span></p></nowiki></pre>
    There are further similar faults throughout the website.<br />
    Why is Firefox not reading the code correctly?<br />
    Please help.

    That is an encoding issue.<br />
    It looks that the page is in UTF-8 Unicode and the server sends this page as a Western or Windows encoding.<br />
    So you see the Unicode characters as the individual bytes that they consist of.
    You can inspect this in Tools > Page Info > General and you can also use the Web Console (Web Developer > Web Console;Ctrl+Shift+K) to check the response header.<br />
    If the server sends a content type via the HTTP response headers then Firefox doesn't honor a meta tag in the file or otherwise switch the encoding.
    *https://developer.mozilla.org/en/Properly_Configuring_Server_MIME_Types

  • How to read binary code chars in pl/sql

    How can I read binary code characters in my script. I need to ignore any binary chars before sending the output to a text file.
    Thanks

    If they are in fact characters in the 1-20 range, you can do somehting like this:
    Create & populate the table:
    create table badChar (
      buf VARCHAR2(1000)
    insert into badChar values ( CHR(0) || CHR(1) )
    insert into badChar values( CHR(2) || CHR(3) || CHR(4) || CHR(5) || CHR(6) || CHR(7) || CHR(8) );
    insert into badChar values( CHR(9) || CHR(10) || CHR(11) || CHR(12) || CHR(13) || CHR(14) || CHR(15) );
    insert into badChar values( CHR(16) || CHR(17) || CHR(18) || CHR(19) || CHR(20) || CHR(21) || CHR(22) );
    insert into badChar values( 'Normal data' );View the data
    SQL> select '*' || buf || '*' from badChar;
    '*'||BUF||'*'
    Normal dataTranslate the data, removing characters with ASCII values of 0-22
    SQL> ed
    Wrote file afiedt.buf
      1  select '*' ||
      2         translate( buf,
      3                    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ||
      4                        CHR(0)  || CHR(1)  || CHR(2)  || CHR(3)  || CHR(4)  || CHR(5)  ||
      5                        CHR(6)  || CHR(7)  || CHR(8)  || CHR(9)  || CHR(10) || CHR(11) ||
      6                        CHR(11) || CHR(12) || CHR(13) || CHR(14) || CHR(15) || CHR(16) ||
      7                        CHR(16) || CHR(17) || CHR(18) || CHR(19) || CHR(20) || CHR(21) ||
      8                        CHR(22),
      9                    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ) ||
    10         '*'
    11*   from badChar
    SQL> /
    '*'||TRANSLATE(BUF,'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'||CHR(0
    Normal dataNote that I assume that the the "valid" values are a-z and A-Z. You can add numbers or other valid characters as needed.
    If you were on Oracle 10g, you could use regular expressions to make this a lot simpler.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • I have a iTunes gift card $20 I cannot read the code to use credit

    I have a iTunes gift card $20. I can't read the code to use credit

    If this page doesn't help then you will need to try contacting iTunes support (you will need to give them as much of the serial number and activation code from the card as you can read) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then iTunes Cards And Codes

Maybe you are looking for