Get the App
SLTechnology News&Howtos  ›  Database  › 

EBS 11i ojspCompile.pl compiles jsp garbled encoding

Shulou Source: shulou.com Published: 2022-06-01 21:49:37 10月02日 Update

11i environment, generally speaking, jsp is compiled automatically after restarting apache, but because of some environment settings, you need to compile jsp manually.

The compilation path of 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, file encoding format GB2312, the code is as follows:

Test garbled

Upload it to the server $OA_HTML/SSO_OA directory, compile it with ojspCompile, and generate two class files under the server $OAD_TOP/_pages/_oa__html/_sso__oa/: _ test1.class and _ test1 $_ jsp_StaticText.class.

Download class locally, decompile, and find that the Chinese in it is garbled, which explains why browser access is garbled.

So it is suspected that it is a problem with the compiler, and it is found that the default compilation code of the compiler is IS0-8859-1, so we are considering how to modify the compilation code.

Download $JTF_TOP/admin/scripts/ojspCompile.pl locally, open it and search for "javac" to see this 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 specify the encoding, just add-encoding GB2312 after the javac command.

Because the 11i environment I am currently using, including database-related coding, is GB2312, I have changed this to GB2312 coding, and 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'}}

Make sure that the encoding of the jsp file is the same as the currently set encoding, and then re-perform the ojspCompile compilation.

It is done, and the Chinese language in the decompiled class is displayed normally.

The ojspCompile path of the R12 environment: $FND_TOP/patch/115/bin, and the compiled character set utf-8 has been added by default in this version.

Tags: Compile code environment file garbled command code server compiler path utf-8 Chinese service different same done generally speaking two big work character Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi MySQL Linux OPPO Reno