Jython Interactive Servlet Console YOU WILL NEVER KNOW IT EXECLLENT!!! GOOD
2012-02-28 20:56
555 查看
Jython Interactive Servlet Console
Questions or Feedback? Send email to Vishal Goenka
accessible using a web browser.
deployable in a web server for web applications, so testing/troubleshooting in a running Web container is not an
option with the standard Jython Interactive console.
a Servlet, so it has access to the HttpServletRequest and such, which is useful for certain applications. However,
it is not interactive, it requires you to have access to the server so you can upload the file after modifying it,
and it requires that you explicitly print anything you want to see in the output. The Jython
Interactive Servlet Console on the other hand does not give you access to HttpServletRequest objects and
such, since it does not expose a servlet interface. However, it offers the interactivity and ease of use of a
normal Jython console in a web environment.
You may enter any arguments in the command window at the bottom and submit, or simply enter submit to start Jython
without any command arguments. These arguments are a subset of the arguments accepted by the command line version
of the Jython Console. Note: Any file arguments will be relative to the server path, rather than the client
path.
assumes that you are familiar with Jython somewhat. You may use the binary
download of jython.jar that contains the Java code for the servlet or build Jython from its CVS
sources. Copy the following files relative to the webapps directory.
Next merge the web.xml.fragment from the binary download with your
application's web.xml to register the Jython Interactive Servlet Console. Finally, copy your existing jython
registry file in the WEB-INF/lib directory and modify the paths according to the server environment.
You may also copy the lib directory from your existing jython installation as it is under
WEB-INF/lib.
You are now ready to access the Jython Interactive Servlet Console by entering the URL that you associate with
it in the web.xml. It should default to http://your.server.com/app-prefix/jython.
merge the code for the Jython Interactive Servlet Console. There are only two Java source files required by the
Jython Interactive Servlet Console. These files are:
The HTML/JSP files are deployed at the root of the webapp, but are not required during the build.
with relevant help.
file. On Unix/Linux environments, simply use jar to unzip the file.
This download is Not an official distribution. It was built from the CVS source of Jython on
November 15, 2003 using JDK 1.3.1. It contains the following files:
If you wish to merge this with the official binary download, you can unjar jython.jar from this distribution
and include org.python.util.InteractiveServlet*.class and org.python.util.Text2Html.class in
your existing jython.jar. It may work if there are no conflicting changes, but I cannot guarantee that.
retain the copyright in the source code. This code comes with no warranty, whatsoever. It is provided "AS IS",
and you must use it at your own risk.
If you are one of the Jython authorities yourself, and would like this to be included in the codebase, please
send me an email at vgoenka@hotmail.com.
Jython Interactive Servlet Console
[Download] [License]Questions or Feedback? Send email to Vishal Goenka
Q> What is Jython Interactive Servlet Console?
A> It is an interactive Jython Console implemented as a Servlet, hence executable in a web server andaccessible using a web browser.
Q> Why do I need it?
A> Well, I often use Jython for debugging/testing my Java application code. The command line version isn'tdeployable in a web server for web applications, so testing/troubleshooting in a running Web container is not an
option with the standard Jython Interactive console.
Q> How is this different from the Jython Servlet?
A> The Jython Servlet can be used to run your Jython code in a WebServer as a servlet. It compiles asa Servlet, so it has access to the HttpServletRequest and such, which is useful for certain applications. However,
it is not interactive, it requires you to have access to the server so you can upload the file after modifying it,
and it requires that you explicitly print anything you want to see in the output. The Jython
Interactive Servlet Console on the other hand does not give you access to HttpServletRequest objects and
such, since it does not expose a servlet interface. However, it offers the interactivity and ease of use of a
normal Jython console in a web environment.
Q> How do you invoke Jython in this environment?
A> When you access the Jython Interactive Servlet Console, you will see the usage screen as follows:Use the following syntax to pass any command line arguments to the Jython Interpreter, or simply press the submit button to launch the interpreter without any arguments. Syntax: [options] [-jar jar | -c cmd | file ] [args] Options and arguments: -i : inspect interactively after running script -S : don't imply `import site' on initialization -v : verbose (trace import statements) -Dprop=v : Set the property `prop' to value `v' -c cmd : program passed in as string (terminates option list) -W arg : warning control (arg is action:message:category:module:lineno) -E codec : Use a different codec the reading from the console. file : program read from script file --help : print this usage message and exit --version: print Jython version number and exit args : arguments passed to program in sys.argv[1:]
You may enter any arguments in the command window at the bottom and submit, or simply enter submit to start Jython
without any command arguments. These arguments are a subset of the arguments accepted by the command line version
of the Jython Console. Note: Any file arguments will be relative to the server path, rather than the client
path.
Q> How do I install the Jython Interactive Servlet Console?
Installation requires some knowledge of the web.xml deployment descriptors used for servlet deployments andassumes that you are familiar with Jython somewhat. You may use the binary
download of jython.jar that contains the Java code for the servlet or build Jython from its CVS
sources. Copy the following files relative to the webapps directory.
JyCommandWindow.html JyConsole.jsp JyConsoleFrame.html JyLauncher.jsp JyTitleWindow.html WEB-INF/lib/jython.jar
Next merge the web.xml.fragment from the binary download with your
application's web.xml to register the Jython Interactive Servlet Console. Finally, copy your existing jython
registry file in the WEB-INF/lib directory and modify the paths according to the server environment.
You may also copy the lib directory from your existing jython installation as it is under
WEB-INF/lib.
You are now ready to access the Jython Interactive Servlet Console by entering the URL that you associate with
it in the web.xml. It should default to http://your.server.com/app-prefix/jython.
Q> How do I build the Jython Interactive Servlet Console?
A> You must download the jython source from its CVS repository and make sure you can build jython before youmerge the code for the Jython Interactive Servlet Console. There are only two Java source files required by the
Jython Interactive Servlet Console. These files are:
src/org/python/util/InteractiveServlet.java src/org/python/util/Text2Html.java
The HTML/JSP files are deployed at the root of the webapp, but are not required during the build.
Q> How do I use the Jython Interactive Servlet Console?
A> Using the Jython Interactive Servlet Console is quite intuitive. See the following screen shot, annotatedwith relevant help.
Download
Download the binary distribution, which is packaged as a zipfile. On Unix/Linux environments, simply use jar to unzip the file.
This download is Not an official distribution. It was built from the CVS source of Jython on
November 15, 2003 using JDK 1.3.1. It contains the following files:
JyCommandWindow.html JyConsole.jsp JyConsoleFrame.html JyLauncher.jsp JyTitleWindow.html WEB-INF/lib/jython.jar web.xml.fragment
src/org/python/util/InteractiveServlet.java src/org/python/util/Text2Html.java
If you wish to merge this with the official binary download, you can unjar jython.jar from this distribution
and include org.python.util.InteractiveServlet*.class and org.python.util.Text2Html.class in
your existing jython.jar. It may work if there are no conflicting changes, but I cannot guarantee that.
License
You are welcome to use the source code or the binary distribution in any manner you deem fit as long as youretain the copyright in the source code. This code comes with no warranty, whatsoever. It is provided "AS IS",
and you must use it at your own risk.
If you are one of the Jython authorities yourself, and would like this to be included in the codebase, please
send me an email at vgoenka@hotmail.com.
相关文章推荐
- Sometimes you will never know the true value of a moment until it becomes a memory
- All You Will Never Know
- Just do it and never give up,then you will find that things become better
- cheap moncler unless you never know regarding it
- You Never Really Learn Something Until You Teach It
- http://www.ityouknow.com/springcloud/2016/12/30/springcloud-collect.html
- You will know my name
- Physical and Logical Block Corruptions. All you wanted to know about it. (文档 ID 840978.1)
- You will never understand love if you are always sane
- one day you will know
- Everything you never wanted to know about kobjects, ksets, and ktypes
- It Will Never Look Like That Peter
- Everything you never wanted to know about kobjects, ksets, and ktypes
- (美文分享)Beautiful Testing:Was It Good for You?
- This view is not constrained, it only has designtime positions, so it will jump to (0,0) unless you
- I know you will read this
- AS- This view is not constrained vertically. At runtime it will jump to the left/(0,0) unless you
- You will never walk alone ( YNWA——Song of Liverpool )
- It will cause a new session when you use lazy loading collection, and the collection will assicated with the new session and the
- (美文分享)Beautiful Testing:Was It Good for You?