irclog2html for #tomcat on 20041115

00:33.58*** join/#tomcat Big_Bozz (~Big_Bozz@user-4269.l6.c1.dsl.pol.co.uk)
00:46.15*** join/#tomcat travlin (~allenst@csel.cs.colorado.edu)
01:47.09*** join/#tomcat aTypical (~Jason@24-205-15-144.mpk-eres.charterpipeline.net)
01:47.12aTypicalHello, everyone.
01:47.49aTypicalAnyone awake?
01:51.47caskeynope
01:52.36aTypicalcaskey, :-P
01:54.34aTypicalI'm having a problem with paths inside a jsp file.  I'm trying to call a file ../webapps/jarproj2/WEB-INF/etc/ProductList.txt, but it keeps responding resource not available.
01:55.05aTypicalDo you know how I go about diagnosing the problem?
01:55.08Big_BozzaTypical: how are you trying to call the file?
01:55.27aTypical<% String myFile = "../webapps/jarproj2/WEB-INF/etc/ProductList.txt"; %>
01:56.14Big_Bozzwell - that just sets myFile equal to the string.  Could you try to paste the whole JSP file to pastebin.com?
01:56.23aTypicalSure.
01:57.33aTypicalhttp://pastebin.com/119963
01:58.30Big_BozzaTypical: What does the method ProductIO.readAll look like?
02:00.38*** join/#tomcat Cyberether (~bob@adsl-156-107-217.asm.bellsouth.net)
02:00.58aTypicalHere it is - http://pastebin.com/119964
02:01.46CyberetherAnybody here ever used the embedded version of Tomcat?  I'm stuck with an issue and have some questions.
02:01.55Big_BozzaTypical: bad bad coding! :-) you are not catching the exceptions when trying to open the file.
02:02.09Big_BozzaTypical: Try catching the IOException from the file reader and see what the problem is.
02:03.56Big_BozzaTypical: I bet that it is looking from a different location and therefore can't open the file.  Try using a absolute path instead - if it works, then that is your problem.
02:04.59aTypicalBig_Bozz, it worked once.  I then changed the jsp to put a border="1" on the table, closed and restarted tomcat and it no longer works.
02:05.29aTypicalAlthough, I'll readily admit I'm a crummy programmer.
02:05.31aTypical:-)
02:05.42aTypicalBe right back...wife is calling me.
02:06.30Big_BozzaTypical: Try looking in the log file to see if anything particular happens when you try to access that file.
02:07.31*** join/#tomcat gascowboy (~gascowboy@adsl-156-107-217.asm.bellsouth.net)
02:23.46aTypicalOK, I'm back.  Big_Bozz, I'll check that, thanks.
02:24.35Big_BozzaTypical: Usually you will be able to see if an exception was through making the resource unavailable.
02:25.31Big_BozzaTypical: You can also try uncommenting suspicious lines and see if it will run.  However, I think you will find the problem in the log file.
02:30.28aTypicalI don't see any errors.
02:32.00aTypicalWow.  I stopped it again and this time it worked.  That's just freakin crazy.
02:34.06Big_Bozzwell, there might have been a problem with Tomcat not having re-compiled the JSP file into a servlet - and causing some kind of clash between the JSP file and the previously generated servlet.
02:34.13Big_Bozzsounds a bit odd though.
02:34.58aTypicalBig_Bozz, this may sound dumb but it appears to fail reading the file if I execute startup.sh from outside the ~/tomcat/bin/ directory.  Have you ever heard of that?
02:35.22Big_Bozzfail reading what file?
02:35.43aTypicalThe ProductList.txt file.
02:36.54Big_Bozzwell, that is probably because you have a relative path in the program. So it is looking at the relative path from where you started tomcat.
02:37.32sundstuck on what?
02:37.39aTypicalIs that how the path works?  I didn't realize it was relative to where I started the application.  I just assumed it was relative to a default tomcat location.
02:37.40Big_BozzI suggest that you use something like   getClass().getResourceAsStream("filename_relative_to_package_level") instead.
02:45.58sundany of you know a way to capture what a webapp via Tomcat sends out to POST to a remote site?
02:48.14Big_Bozzsund: hmm, that doesn't sound like an easy thing to do as you are sending the request to a remote site. Actually don't think it is possible (unless you have run some sort of network sniffer that can decode the forms)
02:48.56sundnone of the Valves or filters  can capture such?
02:49.35Big_Bozzdon't know about Valves, but Filters are only executed when a request comes in to the local server - not when they are going out.
02:50.28sundumm I thought filters have access to HttpResquest and HttpResponse with Filters
02:51.10Big_Bozzsund: You do, but they are still both local.  They have access to the Request made by the user, and the Response that they send back to the user.
02:52.05sundoh okay
02:53.00Big_BozzOnce you send a form using POST the request is placed on the (remote) server - and the local server has nothing to do with that - so unless you sniff the network I don't see how you could.
02:53.40Big_BozzUnless ofcourse you do something tricky by first sending the request to the local server, and then the local server forwarding that request to the remote server. Was that the kind of thing you were thinking about?
02:54.15Big_Bozz(I talk too much today -- trying to avoid writing my culture and change management reports...)
02:55.45aTypicalBig_Bozz, that sounds nasty.  I feel for you.  Next quarter I'm taking "History of Economic Thought."  Your reports sound equally exciting.
02:56.00Big_BozzIn the case mentioned about you can use filters to do that...  So in your form you would simply set the action to a local request - and when the form is submitted the filter grabs the Request/Response and you do something with it, and then forward it to the remote server.
02:56.53Big_BozzaTypical: yeah, if I had know that this kind of nasty report was involved in the module I would never have chosen it. Would have chosen something easy like microprocessor programming.
02:57.06aTypical:-)
02:59.55sundBig_Bozz: yeah the initial request is to a servlet running on Tomcat then the servlet POST  to a remote site and processes the response and then forwards it to the browser
03:00.21sundso it seems a candidate for a Filter..i just have not written lots of Filters
03:00.42Big_Bozzsund: Ah alright - then it should not be a problem.  Just write a filter that examines the Request and Response objects then.
03:01.05Big_Bozzsund: Filters are pretty much straight forward.   There is some nice examples onjava.com
03:01.36sundokay I'll look there again.
03:02.06Big_Bozzbut how come you don't just pick the values before you POST them from the servlet?
03:04.40sundI didnt write the servlet, actually its a component in cocoon, that i dare not to look inside..lol
03:05.54Big_Bozzah.. hmm.. then you will have to have that servlet still send another local request that the filter now picks up, examines and then forwards to the actual remote site.
03:06.19sundright
03:06.48sundi guess i just have to slow learn to decode what tcpdump provides
03:06.50Big_Bozzit would be more efficient to crack open the servlet and do some manipulations - but that is up to you :-)
03:07.23Big_Bozzsund: there are some tools that uses tcpdump that will decode http stuff.
03:07.57Big_Bozzsund: though I can't remember what they are called...
03:07.59sundokay, ill look into that too
03:08.51sundi tried using the TCPMON from axis, but thas only between my browser and tomcat,
03:09.36sundanyways thanks
03:09.44Big_Bozzsund: is it just for testing or do you need to manipulate the data in any way?
03:13.36sundjust for testing, once i know what data is being sent out, then i can hopefully learn what parameters i need to tune
03:14.47sundits a webservices aka SOAP? i think its not sendng out the correct <tags> or namespaces, thats why am getting faults
03:14.48Big_Bozzahh ok - cause then you can just set the form action to the local server and then just look at it from there?
03:15.39sundI suspect its not sending the right parameter to POST or its missing some namespaces
03:16.39sundthese webservices is picky if its not the right namespace or you POST and its missing a <tag>
03:16.50aTypicalBig_Bozz, were you serious about tomcat setting its beginning path to whereever I start it from?
03:16.55Big_Bozzah - well, why don't you create a separate RPC program, send the request to that service, and then check if you sent the right thing?!
03:18.02Big_BozzaTypical: I think so yeah.  Basically you should always avoid using relative paths.  use the getResourceAsStream() instead.
03:18.17sundBig_Bozz: i may have to resort to that..I was hoping to just use whats there
03:18.55Big_Bozzsund: you can create a very simple RPC in php (just a matter of a few lines I guess) - just for testing purposes.
03:19.00aTypicalOK.  Thank you.
03:19.13sundaTypical: I think i have experience that too, specially if its a servlet calling a support class
03:19.47Big_BozzaTypical: here is a bit of info on using getResourceAsStream(): http://mindprod.com/jgloss/getresourceasstream.html
03:20.05aTypicalI'm in an .html file trying to call a servlet.  It just doesn't want to cooperate with me.  Actually, come to think of it, can I call a servlet from an .html file?
03:20.32Big_BozzaTypical: what do you mean by calling a servlet? from a link or form?
03:20.37sundpsoting yeah
03:20.46aTypicalUsing it as the action in a form.
03:20.57sundPOSTing from a n .html  yes
03:21.01Big_BozzaTypical: yeah that is not a problem - as long as you got the right path
03:21.07aTypical:-)
03:23.39aTypicalhttp://localhost:8080/jarproj2/WEB-INF/classes/servlet/servlet.ControllerServlet - This is the path in the Address bar.  It is correct.  However, I'm still receiving a "Status 404" saying "resource not available."
03:24.07Big_Bozznope - you can't access anything in WEB-INF from the browser
03:24.18Big_Bozzyou have to create a servlet mapping in web.xml
03:24.22Big_Bozzand then use that mapping
03:25.04aTypicalHuh?  My ProductList.txt file is located under WEB-INF/etc/ and I can access it with no problem.
03:25.29Big_Bozzyep - but that one is accessed on the server side (from within a JSP file - which is executed before it is sent to the browser)
03:25.52aTypicalHow about if I change Adm.html to Adm.jsp.  Would it work then?
03:26.12Big_BozzNope - cause the action tag is still executed on the browser (client-side)
03:26.21aTypicalAh.
03:26.41aTypicalservlet mapping it is then.
03:26.42Big_Bozzyou will have to update web.xml   (located in  WEB-INF)   you declare the servlet first, then you declare a servlet mapping to that servlet.   and then you can access the servlet using that mapping
03:27.17aTypicalBig_Bozz, can the mapping be a relative path like I was trying to use?
03:27.58aTypicalSorry, the reason I'm stuck on relative mapping is that I have to turn this in to an instructor who is using windows while I'm using Linux.
03:29.06Big_Bozzon the client side you wouldn't even have to worry about absolute or relative paths..   as long as you just put in the mapping you declare in web.xml
03:29.40aTypicalI don't understand.  Let me read up on mapping.
03:29.49Big_Bozzfor the loading of the ProductList.txt file it would be better to use getResourceAsStream() as you will be able to locate the file using the package name (hence avoiding file system references)
03:31.51Big_Bozzanyways - I'm off for bed.. need some rest..    laters!
03:54.28*** join/#tomcat MarkT (~Mark@markt.user)
04:48.16*** join/#tomcat chsh (~someone@d150-200-142.home.cgocable.net)
05:19.27*** join/#tomcat J4V4 (~java_pro@adsl-217-131-246.bgk.bellsouth.net)
09:39.41*** join/#tomcat harpoon (~harpoon@x78.vpn.hrz.tu-darmstadt.de)
10:22.18*** join/#tomcat joered (~chatter@213-156-52-102.fastres.net)
10:48.45*** join/#tomcat cutmasta (~cutmasta@62.225.134.190)
10:48.49cutmastahi
10:49.12cutmastahow can i disable cookies for session managament in my web.xml ?
10:49.30cutmastaso that my webapp only uses sessionid`s?
12:26.40*** join/#tomcat harpoon (~harpoon@x4.vpn.hrz.tu-darmstadt.de)
13:01.51*** join/#tomcat Big_Bozz (~Big_Bozz@user-4269.l6.c1.dsl.pol.co.uk)
13:43.30*** join/#tomcat bb (~bb@bb.user)
13:45.16bbhi. is it possible to catch all 40x and 50x and have it handled by a servlet?
13:45.37bbi mean the http errors ...