I have been assigned a task to convert a java standalone application to python web application.Recoding the entire module in python language would take a lot of time and effort.Hence I was adviced do a quick wrap up of python and get the code working (jython.org) (Jython is Python wrap for JAVA )..Could any one guide me how to get started as I am new to Python as well as Jython?
1
There are 1 best solutions below
Related Questions in JYTHON
- How do I recursively find and replace only in files named index.php on Linux webserver?
- Delete the extra space after special character in all the lines of text file
- Calling a python function with options from shell script
- bc: prevent "divide by zero" runtime error on multiple operations
- Multiple commands with find and xargs, also accounting for special characters
- How to split a directory into parts without compressing or archiving?
- concat a lot of files to stdout
- Honoring quotes while reading shell arguments from a file
- No laravel sync folders in homestead vagrant on windows
- Grouping commands in curly braces and piping does not preserve variable
Related Questions in JYTHON-2.5
- How do I recursively find and replace only in files named index.php on Linux webserver?
- Delete the extra space after special character in all the lines of text file
- Calling a python function with options from shell script
- bc: prevent "divide by zero" runtime error on multiple operations
- Multiple commands with find and xargs, also accounting for special characters
- How to split a directory into parts without compressing or archiving?
- concat a lot of files to stdout
- Honoring quotes while reading shell arguments from a file
- No laravel sync folders in homestead vagrant on windows
- Grouping commands in curly braces and piping does not preserve variable
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
To get you started:
If you're familiar with Java, then you should be able to get to the Jython prompt no problem. Just execute it like any other
.jar
. If you didn't download the standalone jython.jar, be sure to include the Jython libraries in your classpath.Say your Java application's package is named
com.stackoverflow.q10715162
, and is compiled as a.jar
inC:\jars\your_app.jar
.Then, you can get access to its classes in Jython. At the Jython prompt:
Here,
sys.path
is, among other things, a list of directories where your Jython distribution is looking for compiled modules. By adding your compiled Java application to the list, it will become accessible (more in-depth info is available for this at http://www.jython.org/jythonbook/en/1.0/ModulesPackages.html):By using
dir(yourapp)
you can see the classes you defined in your Java application.dir(yourapp.Class1)
will list all methods, functions, etc. that are within the class.You probably want to read through the first few pages at least of the Jython Book to familiarize yourself with the new syntax. I find it much simpler than Java's.
For making a Jython web app, I've heard
cgi
is by far the fastet way to get started with the least overhead:This tutorial seems helpful: http://www.cs.virginia.edu/~lab2q/lesson_1/. Although it is for Python, almost all of it should be applicable to Jython.
And of course, there are many other Python/Jython web service options if
cgi
doesn't suit you or your project. I've usedweb2py
and really liked it.