Friday, June 03, 2005

TextPad 'tool' definition to open generated .java file based on currently open .jsp file

Set this up as a Tool in TextPad, and dropped the sed script (at the bottom of this post) into my cygwin home directory's bin directory (~/bin/), and now I easily open the .java file that tomcat generated when it last compiled the .jsp that I'm currently editing. This is helpful for debugging sometimes, when the compilation error message does not include the .jsp file line number, just the .java file line number.

Command:
c:\cygwin\bin\bash.exe

Parameters:
-c "'/cygdrive/c/Program Files/TextPad 4/textpad' \
`echo '$File' sed -f ~/bin/GeneratedJava.sed`"

Initial Folder:
c:\

Checked options:
Run minimized
Close DOS window on exit


~/bin/GeneratedJava.sed contents:
#!/usr/bin/sed -nf

s/path\\to\\my\\jsps/apache\\tomcat5\
\\work\\Catalina\\localhost\\mywebappname\
\\org\\apache\\jsp/

s/\.jsp/_jsp.java/

0 comments: