Tuesday, July 31, 2007

Change Default Page of Tomcat

In Tomcat 5.5 you have to add the following line INSIDE your HOST element in ther server.xml

<Context path="" docBase="myApp" debug="0"/>

This is better than copying your application in the ROOT directory.
When googling around for this problem I also found the following solution (which works, but is real stupid):
The default Application, which is situated in the ROOT directory is precompiled so they recommended to uncomment the following in .../ROOT/WEB-INF/web.xml:

<!--
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
-->


to remove the precompilation. When you now edit the index.jsp it takes effect. So you only have to add a redirect in the index.jsp and voila :-)

Friday, July 13, 2007

Install JadClipse

You need it seldom, but it's nice to have one: a Decompiler.
JadClipse is a plugin for eclipse to implement jad into the Eclipse-IDE
First you need to downlod jad (1.5.8g) and JadClipse (i took JadClipse 3.2.4 for Eclipse 3.2).
Extract the downloaded jad*.zip to your preffered location.
Copy the downloaded net.sf.jadclipse_3.2.4.jar to your eclipse plugins directory and restart Eclipse with the -clean parameter (on windows: eclipse.exe -clean).
Go to Windows --> Preferences --> Java --> JadClipse and check the "Path to decompiler" that it points to the Jad-Executable (on windows: jad.exe)
Next check the File Association of *.class files under Windows --> Preferences --> General --> File Associations that they point to JadClipse.
Have Phun :-)

Monday, July 09, 2007

Automated FTP-Put in Shell-Script

If you want to make an automated FTP-Put just use the next few lines in your Shell-Script.

#!/bin/sh
echo -e "open ftp.example.com\nuser ftpuser ftppasswd\nbin\ncd toDirectory\nput file.example" |ftp -n