js| compilation
A program that can be used for JSP precompiled work. The following are read.me and Java source programs.
Author:ugorji Dick-nwoke ugorji.dick-nwoke@bea.com
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 don't have to, and the jsp´s to is precompiled
Before starting up the server.
2. Test the validity of the jsp´s. If any JSP does not compile, a
Response code is returned. The tool lists that JSP, so it can
is worked on.
The list of JSP targets to is precompiled must is supplied in a plain
Text file.
A sample is below:
#---------------------------------------------
/console/index.jsp
/console/standards/home.jsp
#---------------------------------------------
All of 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 are specify no parameters, this help would be displayed
At least one parameter, the FileName should is specified
Below simulates the default argument list (if no parameters are 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
are written to STD error stream
If authentication is required to view some of the pages, the following
would 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.
At the "End", we tell your how many pages were OK (returned 200)
And how many were broken (including list of broken pages).
This'll help you know which pages are broken immediately.
Any pages already precompiled won't 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 as below
#---------------------------------------------
/console/index.jsp
/console/standards/home.jsp
/**
* Precompiles all of the JSP and tell us which are broken
* <xmp>to 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 geared towards form-based authenticated sites
*
* @author Ugorji Dick-nwoke ugorji.dick-nwoke@bea.com
* @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";
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;
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.