EBS 11i ojspcompile.pl compiled JSP garbled encoding

Source: Internet
Author: User
Tags chop

11i environment, in general JSP is automatically compiled after restarting Apache, but because of some environment settings, you need to manually compile the JSP.


Compilation path for 11i: $JTF _top/admin/scripts/ojspcompile.pl

Compile command: Perl $JTF _top/admin/scripts/ojspcompile.pl--compile-p 16-s xxx.jsp


A simple JSP file test1.jsp, the file encoding format GB2312, the code is as follows:

<% @page language= "java" contenttype= "text/html; charset=gb2312 "%>

Upload to the server $oa_html/sso_oa directory, compile with ojspcompile, compile through, the server $oad_top/_pages/_oa__html/_sso__oa/generate two class files: _test1.class and _test1$__jsp_statictext.class.

Download class to local, anti-compilation, found inside Chinese is garbled, this can explain why the browser access is garbled.


So suspicion is the problem of the compiler, have found that the compiler default compiler encoding is is0-8859-1, so it is considered how to modify the compilation code.


Download $jtf_top/admin/scripts/ojspcompile.pl to local, open after search "Javac" see such a paragraph:

sub javac_internal {my   $osname  = undef;   chop  ($osname  =  ' Uname -s ');   my  ($java _ver)  = &myrun (30,  "$java  -version 2>&1 ");    chomp ($java _ver);    if ($java _ver =~/ 1.5/)    {        if  (($osname  eq  "AIX")  | |   ($osname  eq  "OSF1")         { return  ' exec  javac -nowarn '  }        elsif  ($ISWINNT)  {  return  ' Javac -j-client -nowarn '  }         else { return  ' Exec javac -j-client -nowarn '  }   }     elsif  ($ISWINNT)  { return  ' Javac -nowarn '  }     else { return  ' Exec javac -nowarn '  }} 


The JAVAC command can be encoded, and the Javac command is followed by-encoding GB2312.

Because I am currently using the 11i environment including database-related coding is GB2312, so I changed this to GB2312 code, of course, different environments can also be changed to Utf-8.


The Modified code:

sub javac_internal {my   $osname  = undef;   chop  ($osname  =  ' Uname -s ');   my  ($java _ver)  = &myrun (30,  "$java  -version 2>&1 ");    chomp ($java _ver);    if ($java _ver =~/ 1.5/)    {        if  (($osname  eq  "AIX")  | |   ($osname  eq  "OSF1") #old         { return  ' Exec javac -nowarn '  }        { return  ' exec  javac -nowarn -encoding gb2312 '  }         elsif  ($ISWINNT)  { return  ' Javac -j-client -nowarn '  }else {  return  ' Exec javac -j-client -nowarn '  }   }     elsif  ($ISWINNT)  { return  ' Javac -nowarn '  } #old     else { return  ' exec  javac -nowarn '  }else { return  ' exec javac -nowarn -encoding  gb2312 '  }}


Ensure that the encoding of the JSP file is the same as the encoding of the current setting, and then re-execute Ojspcompile compilation.

Finished, the anti-compilation class in Chinese normal display.



Ojspcompile path to the R12 environment: $FND _top/patch/115/bin, this version has been added by default to the compilation character set of Utf-8.


This article is from the "Long Way to repair ..." Blog, be sure to keep this source http://baser.blog.51cto.com/4153192/1953654

EBS 11i ojspcompile.pl compiled JSP garbled encoding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.