Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

EBS 11i ojspCompile.pl compiles jsp garbled encoding

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report