WebLogic Scripting Tool command line editing
When you’re a newbee to WebLogic, and in this case especially the WebLogic Scripting Tool (WLST) it’s a good thing to explore the capabilities of the WLST by browsing and navigating through the MBean stucture. With the use of easeSyntax() navigating makes it easier to navigate, because you can browse in a UNIX/Linux like way.
Another thing is, In a UNIX/Linux Â environment, WLST does not provide any command line editing capabilities. However, you can use a 3rd party tool like JLine to provide line editing in WLST.
JLine provides the following editing capabilities:
- Command history
- Line editing
- Custom key bindings
For more information about JLine refer toÂ http://jline.sourceforge.net/index.html
To use JLIne with WLST, follow these steps.
Download JLine fromÂ http://jline.sourceforge.net/downloads.html
Unzip the file and put the jline jarÂ into a directory on your machine. Add the jline jar to the server’s CLASSPATH
Run JLine as follows
java jline.ConsoleRunner weblogic.WLST
Alternatively, you can edit the $WL_HOME/common/bin/wlst.sh and then add jline.ConsoleRunner before weblogic.WLST
(where $WL_HOME is the WebLogic Server home – like Â /app/oracle/Middleware/wlserver_10.3)
The default keys in JLine are:
- UP ARROW and DOWN ARROW to move within the command history
- CTRL-N and CTRL-P to move within the command history
- LEFT ARROW and RIGHT ARROW to move within a command
- CTRL-B moves to the previous character
- CTRL-G moves to the previous word
- CTRL-A moves to the beginning of the line
- CTRL-F moves to the next character
- CTRL-E moves to the end of the line
- CTRL-U deletes all characters before the cursor
- CTRL-W deletes the word before the cursor
On UNIX systems JLine will execute the stty command to initialize the terminal to allow unbuffered input, using the jline.UnixTerminalÂ class.