亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > JSP > 正文

jsp預編譯工具

2024-09-05 00:20:30
字體:
來源:轉載
供稿:網友

一個可以進行jsp預編譯工作的程序. 下面是read.me 以及 java 源程序.
author: ugorji dick-nwoke [email protected]
date: jan 16. 2002

---------------------------------------------------
post server startup jsp file compiler and validator
---------------------------------------------------
this utility helps to
1. simulate a precompilation of jsp´s after the server
has already started up.
this way, we do not have to wait for all the jsp´s to be precompiled
before starting up the server.
2. test the validity of all the jsp´s. if any jsp does not compile, a
response code of 500 is returned. the tool lists that jsp, so it can
be worked on.

the list of jsp targets to be precompiled must be supplied in a plain
text file.

a sample is below:
#---------------------------------------------
/console/index.jsp
/console/standards/home.jsp
#---------------------------------------------

all the targets defined in there a hit sequentially, the response code
monitored and such information relayed to the user.

usage:
java testjspfiles <fname>

if you specify no parameters, this help will be displayed
at least one parameter, the filename should be specified

below simulates the default argument list (if no parameters are passed in)
jsp-pages.txt

if form based authentication is required, then send the username and parameters

system properties, passed using the -d flag, are used to set the argument
list. they are listed below:
host the hostname or ip address of the machine
port the port the server is listening on
debug if true, extra information like the actual output string
is written to std error stream
if authentication is required to view some of the pages, the following
will be required.
username the username to login as
password the password for that user
formauthtarget the j_security_check target. by default, it is
/j_security_check. it can be specified as the login
page may vary.

sample usage is below:
java
-ddebug=false
-dhost=localhost
-dport=7701
-dusername=system
-dpassword=system_password
-dformauthtarget=/console/login/j_security_check
testjspfiles
jsp-pages.txt

at the end, we tell you how many pages were ok (returned 200)
and how many were broken (including list of broken pages).
this will help you know which pages are broken immediately.

any pages already precompiled will not precompile again.
thus, there is no performance hit on running this script
multiple times.

**** note ****
the file passed should have the full path of pages to precompile
example scenario:
webapp context-path is /console
to precompile the jsp pages, index.jsp and standards/home.jsp in there
file should be as below
#---------------------------------------------
/console/index.jsp
/console/standards/home.jsp

#---------------------------------------------

enjoy. - ugorji [email protected]

// package weblogic.qa.taskmgr;

import java.util.*;
import java.io.*;
import java.net.*;


/**
* precompiles all the jsp and tell us which are broken
* <xmp>to see usage information: java weblogic.qa.taskmgr.testjspfiles</xmp>
* fname is the list of files with the paths of jsp files to precompile
* host and port are the server host and port respectively
*
* currently, this is only geared towards form-based authenticated sites
*
* @author ugorji dick-nwoke [email protected]
* @version 1.0, august 3, 2001
*/
public class testjspfiles
{
private static string help_message = null;

public boolean debug = false;
public list jspfiles;
public string host;
public int port;
public string username;
public string password;
public string cookiestring;
public string formauthtarget = "/j_security_check";

// set the help message
static {
string lsep = system.getproperty ("line.separator");
help_message =
"usage: " + lsep +
"java [-dhost=] [-dport=] [-dusername=] [-dpassword=] [-dformauthtarget=] testjspfiles <fname> " + lsep +
"defaults:" + lsep +
" -dhost=localhost" + lsep +
" -dport=80" + lsep +
" -dusername=" + lsep +
" -dpassword=" + lsep +
" -dformauthtarget=/j_security_check" + lsep +
" file should be of the form below:" + lsep +
"#---------------------------------------------" + lsep +
"/console/index.jsp" + lsep +
"/console/standards/home.jsp" + lsep +
"#---------------------------------------------" + lsep +
"";
}

public string tostring () {
string s = host + ":" + port + " [user/pass=" + username + "/" + password + "]";
return s;
}

public void run ()
throws exception
{
cookiestring = getcookiestring ();
if (debug) system.err.println (cookiestring);
list badfiles = new arraylist ();
list goodfiles = new arraylist ();
int numgood = 0;
int numbad = 0;

int sz = jspfiles.size ();
for (int i = 0; i < sz; i++) {
string file = null;
try {
file = (string) jspfiles.get (i);
int respcode = getresponsecode (file);
if (respcode == 200) {
system.out.println ("good: " + file + " --- got respcode " + respcode);
goodfiles.add (file);
numgood++;
}
else {
system.out.println ("error: " + file + " --- got respcode " + respcode);
badfiles.add (file);
numbad++;
}
}
catch (exception exc) {
system.out.println ("error: " + file + " --- got exception " + exc);
badfiles.add (file);
numbad++;
}
if (debug) {
system.err.println ("=============================================");
}
}

// output stats
system.out.println ("good files: " + numgood);
system.out.println ("bad files: " + numbad);
system.out.println ("---------------------------------------");
for (int i = 0; i < numbad; i++) {
system.out.println (badfiles.get (i) );
}

}

public int getresponsecode (string file)
throws exception
{
int respcode = -1;
socket s = new socket (host, port);
printwriter out = new printwriter( new outputstreamwriter( s.getoutputstream() ) );
string target = file + "?jsp_precompile=true";
out.print ("get " + target + " http/1.0" + " ");
out.print ("cookie: " + cookiestring + " ");
out.print ("connection: close ");
out.print ("host: " + host + " ");
out.print (" ");
out.flush ();
bufferedreader buffreader = new bufferedreader( new inputstreamreader( s.getinputstream() ) );
string line = buffreader.readline();
if( line != null ) {
stringtokenizer st = new stringtokenizer( line.trim() );
st.nexttoken();
respcode = integer.parseint (st.nexttoken());
}
while( (line = buffreader.readline()) != null ) {
if( line.trim().length() == 0 ) break;
}
stringbuffer buf = new stringbuffer ();
while( (line = buffreader.readline()) != null ) {
buf.append (line).append (" ");
}
if (debug) {
system.err.println (target);
system.err.println (respcode);
system.err.println (buf.tostring () );
}
buffreader.close ();
out.close ();
s.close ();
return respcode;
}

public string getcookiestring ()
throws exception
{
string cookieline = null;
string c = null;
socket s = new socket (host, port);
printwriter out = new printwriter( new outputstreamwriter( s.getoutputstream() ) );
string target = formauthtarget;
// out = new printwriter (system.out, true);
out.print ("post " + target + " http/1.0" + " ");
out.print ("connection: close ");
out.print ("host: " + host + " ");
out.print ("content-type: application/x-www-form-urlencoded " );
string poststring = "j_username=" + username + "&j_password=" + password;
out.print ("content-length: " + poststring.length() + " " );
out.print (" ");
out.print (poststring + " " );
out.print (" ");
out.flush ();
bufferedreader buffreader = new bufferedreader( new inputstreamreader( s.getinputstream() ) );
string line = null;
while( (line = buffreader.readline()) != null ) {
if (debug) system.err.println (line);
if( line.trim().length() == 0 ) break;
if( line.tolowercase().startswith( "set-cookie:" ) ) {
cookieline = line.substring( "set-cookie:".length() ).trim();
int semicolon = cookieline.indexof( ";" );
if( semicolon != -1 ) {
cookieline = cookieline.substring( 0, semicolon ).trim();
}
break;
}
}
buffreader.close ();
out.close ();
s.close ();
return cookieline;
}

public int getresponsecode0 (string file)
throws exception
{
httpurlconnection urlconn = null;
try {
string target = file + "?jsp_precompile=true";
url url = new url ("http", host, port, target);
urlconn = (httpurlconnection) url.openconnection ();
urlconn.connect ();
// inputstream is = urlconn.getinputstream ();
// while ( is.read (b) != -1 ) { }
int respcode = urlconn.getresponsecode ();
return respcode;
}
finally {
try { if (urlconn != null) urlconn.disconnect (); }
catch (exception exc2) { }
}
}

/** <xmp>usage: java weblogic.qa.taskmgr.testjspfiles <fname> <host> <port> </xmp> */
public static void main (string[] args)
throws exception
{
if (args.length == 0) {
system.out.println (help_message);
system.exit (0);
}

string fname = "jsp-pages.txt";
string thost = "localhost";
int tport = 80;
string tuser = null;
string tpass = null;
string tformauthtarget = "/j_security_check";
boolean tdebug = false;

string tmpstr = null;
if ( (tmpstr = system.getproperty ("host") ) != null)
thost = tmpstr;
if ( (tmpstr = system.getproperty ("port") ) != null)
tport = integer.parseint (tmpstr);
if ( (tmpstr = system.getproperty ("username") ) != null)
tuser = tmpstr;
if ( (tmpstr = system.getproperty ("password") ) != null)
tpass = tmpstr;
if ("true".equals (system.getproperty ("debug")) )
tdebug = true;
if ( (tmpstr = system.getproperty ("formauthtarget") ) != null)
tformauthtarget = tmpstr;

if (args.length > 0)
fname = args [0];
if (args.length > 1)
thost = args [1];
if (args.length > 2)
tport = integer.parseint (args [2]);
if (args.length > 3)
tuser = args [3];
if (args.length > 4)
tpass = args [4];

filereader fr = new filereader (fname);
bufferedreader br = new bufferedreader (fr);
list files = new arraylist ();
string line = null;
while ( (line = br.readline () ) != null ) {
line = line.trim ();
if (line.length() == 0 || line.startswith ("#") )
continue;
files.add (line);
}
fr.close ();
br.close ();

testjspfiles test = new testjspfiles ();
test.host = thost;
test.port = tport;
test.jspfiles = files;
test.username = tuser;
test.password = tpass;
test.formauthtarget = tformauthtarget;
test.debug = tdebug;

system.out.println ("file&: " + fname);
system.out.println ("testjspfiles: " + test);
test.run ();

}


}

# top level files
/console/index.jsp
/console/help.jsp

# other stuff
/webapp1/thankyou.jsp
/webapp2/thankyou2.jsp
 



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产91在线播放九色快色| 亚洲丝袜av一区| 永久555www成人免费| 欧美小视频在线观看| 欧美电影免费观看网站| xxxxx成人.com| 中文在线资源观看视频网站免费不卡| 韩国19禁主播vip福利视频| 亚洲成avwww人| 亚洲国产精彩中文乱码av在线播放| 黑人巨大精品欧美一区二区免费| 91欧美激情另类亚洲| 亚洲第一色在线| 成人激情视频在线| 成人黄色中文字幕| 久久久精品中文字幕| 九九热这里只有精品免费看| 欧美精品久久久久久久免费观看| 亚洲一区二区三区在线视频| 久久久久久久国产精品视频| 国产成人精品亚洲精品| 国产综合视频在线观看| 午夜伦理精品一区| 国外成人免费在线播放| 日本成人激情视频| 国产精品久久久久久久一区探花| 在线观看免费高清视频97| 夜夜嗨av一区二区三区免费区| 国产一区欧美二区三区| 国产精品日韩在线一区| 欧美日韩国产成人在线观看| 国产精品久久久久久久久久久久久久| 亚洲精品www| 欧美成人一区二区三区电影| 国产亚洲xxx| 一区二区三区回区在观看免费视频| 91九色国产视频| 丝袜情趣国产精品| 亚洲最大中文字幕| 欧美xxxx18性欧美| 国产精品久久99久久| 国产精品视频久| 日本久久精品视频| 日本乱人伦a精品| 久久资源免费视频| 国产在线观看一区二区三区| 精品久久久精品| 国产v综合v亚洲欧美久久| 日韩av黄色在线观看| 欧美裸体视频网站| 国产手机视频精品| 日韩网站在线观看| 国产视频精品自拍| 国产成人高清激情视频在线观看| 欧美亚洲成人网| 欧美老女人性视频| 日韩国产中文字幕| 色噜噜狠狠色综合网图区| 日日摸夜夜添一区| 国产亚洲在线播放| 久久免费观看视频| 最近日韩中文字幕中文| 国产一区二区精品丝袜| 国产成人精品视频| 日韩美女在线观看一区| 日韩在线精品视频| 国产97免费视| 中文字幕成人在线| 精品久久久在线观看| 亚洲美腿欧美激情另类| 在线看片第一页欧美| 92裸体在线视频网站| 91久久久精品| 中文字幕精品一区久久久久| 91久久精品国产91性色| www.久久久久| 秋霞av国产精品一区| 日本久久久久久久久| 精品日本高清在线播放| 欧美日本亚洲视频| 亚洲欧洲激情在线| 国产午夜精品美女视频明星a级| 久久夜色精品国产欧美乱| 国产精品视频免费在线观看| 国产精品高精视频免费| 亚洲激情国产精品| 亚洲欧美中文日韩v在线观看| 国产成人精品久久| 日日骚久久av| 91精品久久久久久久久青青| 欧美一区二区大胆人体摄影专业网站| 精品国偷自产在线视频| 中文字幕精品av| 国产97人人超碰caoprom| 一区二区三区四区在线观看视频| 91啪国产在线| 中文字幕一精品亚洲无线一区| 日本久久久久久久| 日韩亚洲精品视频| 日韩一区二区久久久| 91wwwcom在线观看| 孩xxxx性bbbb欧美| 亚洲午夜未满十八勿入免费观看全集| 夜夜嗨av色综合久久久综合网| 欧美美女15p| 亚洲字幕在线观看| 亚洲视频在线播放| 亚洲黄色免费三级| 欧美日韩一区二区在线| 久久的精品视频| 中文字幕在线亚洲| 欧美性猛交xxxx乱大交极品| 亚洲精品v天堂中文字幕| 亚洲国产日韩精品在线| 国产精品扒开腿做| 日韩av在线免费看| 搡老女人一区二区三区视频tv| 三级精品视频久久久久| 亚洲一区二区三区在线视频| 国产精品久久77777| 国语自产偷拍精品视频偷| 久久久久久久久中文字幕| 日韩av在线最新| 国产在线观看不卡| 青草青草久热精品视频在线观看| 欧美大片在线免费观看| 国语自产精品视频在免费| 成人激情视频在线播放| 日韩视频在线观看免费| 国产精品99久久久久久白浆小说| 欧美亚洲在线播放| 中文字幕在线观看日韩| 91在线观看免费观看| 欧美高跟鞋交xxxxxhd| 国产欧美精品一区二区三区介绍| 精品久久香蕉国产线看观看亚洲| 久久精品国亚洲| 在线播放亚洲激情| 亚洲人成毛片在线播放| 视频在线观看99| 在线日韩中文字幕| 国产精品欧美亚洲777777| 国产美女精品视频| 国产精品久久久久久搜索| 亚洲一区二区三区成人在线视频精品| 久久99视频精品| 欧美日韩成人在线视频| 色综合影院在线| 精品成人69xx.xyz| 日本91av在线播放| www.欧美精品| 国产欧美va欧美va香蕉在| 亚洲国产精品嫩草影院久久| 久久99久久99精品免观看粉嫩| 国产日韩欧美中文在线播放| 日韩欧美在线观看视频| 日本人成精品视频在线| 中文字幕亚洲欧美日韩在线不卡| 日韩在线欧美在线| 草民午夜欧美限制a级福利片| 欧美激情免费观看| 久久久av亚洲男天堂| 日本在线观看天堂男亚洲| 久久久精品2019中文字幕神马|