I looked into this about a week or two ago for another poster and it appears that the work folder is hard coded. The other folder locations can be configured via system properties, but I have not found a way to change the work folder location.
I think this folder name/location is not controlled by JBoss but is controlled by Tomcat/JBossWeb. The tomcat documentation http://tomcat.apache.org/tomcat-5.5-doc/config/context.html helped. Search for workDir on that page.
So all you have to do is edit the %JBOSS_HOME%/server/< serverName>/deploy/jboss-web.deployer/context.xml as follows:
<Context cookies="true" crossContext="true" workDir="/home/jaikiran/myworkfolder" > .... other stuff that's already in that file
The path is the absolute path. So in this case, the work folder will be configured to /home/jaikiran/myworkfolder.
For JBoss 4.0.4, the location of the context.xml will be %JBOSS_HOME%/server/< serverName>/deploy/*tomcat*.sar/context.xml.
P.S: I also found another way to configure this in the %JBOSS_HOME%/server/< serverName>/deploy/jboss-web.deployer/conf/web.xml file, by passing as init-param a "scratchdir" property (search for scratchdir in that file) to the org.apache.jasper.servlet.JspServlet. But that one assumes that the folder will be present by default and it will not create one if the folder does not exist.
Thanks a lot jaikiran and PeterJ, the problem is sovled.