RE: IE 5 on Mac is incompatible with TC 4?
On Fri, 8 Mar 2002, Randy Layman wrote: I haven't been following this thread but it seems like you are saying that Tomcat should be modified to work correctly with IE 5. The problem with that is that Tomcat is an reference implementation of a particular spec (JSP/Servlet) which dictates how things have to work - it is the reference by which all others are implemented. It can't change to accommodate bugs or special features of client software. Who cares if it's a reference implementation? If it doesn't work with current mainstream browsers then it is useless. No company running a ecommerce site wants to alienate all Mac IE5 users. It would be idiotic, not mention bad business. Tomcat must work with all current mainstream browsers (at least NS and IE) on all all major platforms for it to be useful. Typical sers do not upgrade their browsers. So everything else must be upgraded to work with them, bugs and all. My $0.02 -- Joe Laffey | Want to convert subnet masks between different LAFFEY Computer Imaging | notations, or figure the number of IPs in a block? St. Louis, MO | Whatmask-It's FREE - www.laffeycomputer.com/wm.html -- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: AW: IE 5 on Mac is incompatible with TC 4?
On Fri, 8 Mar 2002, Ralph Einfeldt wrote: I don't copletly agree with that. As long as you don't break specs it is possible to do something in tomcat to deal with errors in browsers. (Like missbehavior in the headers of a http request) If a browser has a bug that you can't deal with, without breaking the spec there isn't much you can do. I understand your concern over the specs. But users don't care about specs, neither do manager, CEOs, or the bean counters. They care about profits. And alienating users with your website is NOT a way to increase profits ;-) There might also be browser bugs that you can't avoid at all. E.G. if a browser doesn't send a cookie under certain conditions, what would you suggest to change on the server side to change that. (I don't know if this happens here) I too know nothing about the issue, and have not tested it to see if it even exists. (Perhaps I should have kept my mouth shut in the first place.) I simply wanted to point out that hold spec up as Holy Grail doesn't do any users any good at all. There will always be incompatibilities. The industry has tried forever to have specs, guidelines, and requirements. There have always been exceptions. Unless you control ALL the software involved, or have the full cooperation of those who do (MS, cooperate? yeah, sure...) things will have to be adjusted to fit. If this is indeed a bug in IE5 Mac then it should be documented as an incompatibility prominently on the Tomcat website. This way developers won't look like idiots when their clients call screaming that their daughter can't even order products from their website from her iMac! The prudent developer will find a workaround or choose something other than Tomcat. In this case you don't have to alienate all Mac IE5 users because there is workaround: using encodeUrl(). Which should be used anyway, because otherwise you will alienate all users that disable cookies. (Which will be more than Mac OS 9 users with IE 5) If this works then yes, it is a good solution. (Not requiring cookies is always a good solution, but it costs more time/money.) However, IMHO, the Tomcat docs ought to reflect this incompatibility prominently so the developer know that they will have to waste hours working around it. Again, I have no idea if a bug really exists. I am simply making noise because I think that money is more important than specs to most developers and definitely to most suits. I will now be quiet. I hope I haven't offended you or anyone on the Tomcat team. I think Tomcat is a good project. -- Joe Laffey | Want to convert subnet masks between different LAFFEY Computer Imaging | notations, or figure the number of IPs in a block? St. Louis, MO | Whatmask-It's FREE - www.laffeycomputer.com/wm.html -- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Preventing Proxy Servers From Hitting JSP Pages?
Hi All, Every day I get hundreds of hits on my JSP pages from proxy servers who are trying to determine if the links are still good. This is great for my static pages, but on pages with forms and processing logic it causes havoc. For example, if I have 3 pages of forms and the final page adds something to my database, hitting just the second page throws errors. I know that there is a pragma directive I need to add to each page, but isn't there also something that can be added to the HTTP header each time. And if so, what is the easiest way to add this to every outgoing header? You can send out HTTP headers saying not to cache (PRAGMA: no-cache, etc), but I think you way want to implement some other scheme. If your program cannot handle random calls to ANY page then you may be in trouble. I would suggest checking the REFERER header and redirecting clients to the main page if the referer is NOT the page it is supposed to be. Note that this is NOT a security measure (referer is easily forged), but it can help with this situation, or people who have bookmarked pages. You can also use a session ( either servlet sessions or one you devise yourself) and embed that in urls (could even be as simple as the current time in millis). Then if that sessesion has expired (or too much time has passed in the case of the time thing) then you send the client to the main page. Note that adding the current time to your requests pretty much makes them non-cacheable anyway. Also note that most proxy servers will not cache POST requests or GEt requests with the ? char in them (i.e. with a query string). By adding ?t=timeinmillis you make it less likely to be cached. Also, the browser itself will not cache the page between calls because the time will be different each time it is generated. Note that two clients COULD receive the same current time in millis due to the threading issues of servlets. This is not a problem unless you make it one. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out! ''+. .+'''+. .+'''+. .+'''+. .+''+. \ / \ / \ / \ / \ `+...+' `+...+' `+...+' `+...+'`+..
Re: How to avoid of displaying the homepage file path
On Thu, 21 Jun 2001 [EMAIL PROTECTED] wrote: Messages with Subject ´Homepage´ are not accepted here (Homepage.HTML.vbs) Heh.. That's a real intelligent way to fileter messages!! Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out! ''+. .+'''+. .+'''+. .+'''+. .+''+. \ / \ / \ / \ / \ `+...+' `+...+' `+...+' `+...+'`+..
RE: Tomcat vs JServ
On Thu, 19 Apr 2001, [iso-8859-1] Benoît Jacquemont wrote: You shouldn't use JServ anymore. Tomcat comes in replacement of JServ. And actually, JServ is kind of dead because, as Milt Epstein said, there won't be any other development on JServ. So no more enhancement will be made to the engine. I have a jServ box that has run with no problems of any kind for over a year and a half. To me that says a lot of jServ. Does the latest release of Tomcat finally support the automatic starting up of Tomcat (not manual)? What about speed? In some casual tests my jServ system runs faster than Tomcat. Has anyone done any real benchmarks? Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Tomcat vs JServ
On Thu, 19 Apr 2001, Tim O'Neil wrote: JServ is dead code. Don't use it. Tomcat is that same code's successor. I hardly think that code being dead should put it into a "Don't use it" category. JServ is stable as hell and that means a lot. Sure, it only support JSDK 2.0, but you can do a lot with that. Most of my clients still use Jdk 1.1.x, and these are Fortune 500 companies! Don't knock tried and tested software. Also, the beauty of Open Source is that if you find a bug you can fix it yourself. I do this all the time (and submit the patch). Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Dates in Java
On Fri, 6 Apr 2001, Ryan wrote: I have a simple question about the Date object (or similar object) I have a mySQL table with a DATETIME cell. I want to get the date from this cell (formatted like so: e.g. 2001-03-23 13:04:59) and retrieve the date that is exactly 7 days earlier than the retrieved date. What is the easiest way to do this? I noticed a lot of method deprecations in the specs and I am having trouble using the Date object. First off, when dealing with dates related to SQL calls, always use the setDate() and getDate() functions of the PreparedStatement and ResultSet respectively. These will format the date correctly for the underlying RDBMS and they take and return a java.sql.Date. Note that a java.sql.Date is different from a normal java.util.Date. You will need to use these full class designations in your code to distinguish them. To get a date that is 7 ddays prior use the Calendar class. Use getInstance to get a Claendar instance. Set the Calendar's time to the original date then do a cal.add(cal.DAY_OF_MONTH, -7) (where cal is the name of your Calendar object). Note that I don't have the docs in front of me right now, so that might not be exaclty the syntax. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Fuzzy Math
This script works fine under Rh 6.2 Apache 1.3.19 mod_jk JDK 1.3_fcs Tomcat 3.2 Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: hashtables in session
On Tue, 3 Apr 2001, Bo Xu wrote: teh j wrote: Hi guys just wondering if it was possible to store Hashtable objects in the implicit session object? thanks Jason [...] Hi :-) I remember I have seen several emails in Servlet-List about it, it is possible, and I remember perhaps it is better to make all the key-value object Serializable, and perhaps it is better to notice which classloader loads those object. That's right: You can store ANY object in the session object if you need to. These object are required to be serializable (implement java.io.Serializable), though most servlet engines will let you slide without this. However, it is a very bad idea to have any session object, especially a large one, not serializable. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Confusing Problem with SQL Query in Tomcat
On Mon, 26 Mar 2001, Hunter Hillegas wrote: I just tried this again, replacing the ? with a test value and it works so the problem is the pst.setString() call. I know the String I'm passing to setString is valid because I can print it to the screen just find... Is preparedStatement.setString() buggy? It has always worked fine for me. Try adding some whitespace around your "?" in the string. I thought I remember encountering a problem when there were no spaces around the "?". I always add spaces just to be sure. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Confusing Problem with SQL Query in Tomcat
On Mon, 26 Mar 2001, Hunter Hillegas wrote: I have a strange problem with my Servlet app running in Tomcat 3.2.1 on Linux. The method posted below takes a String and uses it in conjunction with a PreparedStatement to create a query. I've added debugging code to the method to print output to the screen to help me but I can't figure it out. Basically the query is returning nothing. When I run the query from the SQL command line (PostgreSQL 7.1) it returns one row. When I substitute the actual String in the query instead of using setString, it doesn't work. I'm kind of baffled... The counter I have set for debugging returns 0 and the output of the String that's brought into the method matches the one I use in the query that runs properly on the command line. Any help would be appreciated. I do all sorts of DB access in other parts of my app and it works just fine. Hunter Here is the method: private boolean artistExists (HttpServletRequest request, HttpServletResponse response, String artistName) throws IOException, ServletException { Connection con = null; PreparedStatement pst = null; ResultSet rs = null; boolean artistExists = false; //DEBUG response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("Input Artist Name: " + artistName + "BR"); int counter = 0; //END DEBUG try { con = myBroker.getConnection(); pst = con.prepareStatement("SELECT * FROM artist_info WHERE upper(name) = upper(?)"); Does Postgres have any equalsIgnoresCase support? If so, might be faster than this. pst.clearParameters(); No need for clearParameters(). The setString will override any old parameters (if their were any). pst.setString(1, artistName); rs = pst.executeQuery(); while (rs.next()) { out.println("Is the inputted name: " + artistName + " equal to: " + rs.getString("name") + "?BR"); //DEBUG counter++; //DEBUG [snip] My guess is that it has something to do with the rs.getString(java.lang.String) call. Try rs.getString(int) instead to narrow it down. (The int is the column number. I would highly suggest doing something like "SELECT name, column2, column3, FROM table WHERE whereclause" instead of doing "SELECT * ...". If all you want is the name then only SELECT that. You also might not want to call rs.getString() on the same column twice. Use a temp var instead. (The Sun docs say not to do this for "maximum portability." The docs also say to read columns from left to right, which is why I suggested SELECTing actual columns in a know order instead of using *.) If you get this to work please let us know how. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Confusing Problem with SQL Query in Tomcat
On Mon, 26 Mar 2001, Hunter Hillegas wrote: pst.clearParameters(); No need for clearParameters(). The setString will override any old parameters (if their were any). Can't hurt though, can it? Don't think so, but why make extra method calls ;-) My guess is that it has something to do with the rs.getString(java.lang.String) call. Try rs.getString(int) instead to narrow it down. (The int is the column number. I would highly suggest doing something like "SELECT name, column2, column3, FROM table WHERE whereclause" instead of doing "SELECT * ...". If all you want is the name then only SELECT that. You think? The counter isn't getting incremented at all, suggesting that rs.next() is evaluating to false, thus suggesting the query is returning 0 rows... Hmmm... My bad. I should have read that part of your note more carefully. Now I am a little confused... You tried pasting a plain SELECT string with no "?"s in the prepareStatement string? Are you certain that the connection pool works right? Try it with a plain connection that you establish right there in the code perhaps. What happens when there is more than one row in the DB that matches your WHERE clause? Then does it work? if so, is it mssing one row, or complete? Is it possible that you have a non-committed transaction from a command line client that is holding up this SELECT with a lock? (It should give an exception.) Do you not see an exception? If not, are you sure your exception reporting code works right? Here is an interesting quote from the Sun docs on ResultSet: " The column name option is designed to be used when column names are used in the SQL query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names were used there is no way for the programmer to guarantee that they actually refer to the intended columns." This might explain not being able to get the data, but it doesn't seems to explain why the rs.next() would be false. Do column numbers start at 0 or 1? I will try changing the query and using the column number... For some reason they start at 1. Note that this should be faster than the string anyway. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- Need to do multi-file string replacement in Un*x, but don't want to mess with sed? Try rpl. It's a free text replacement utility with source. http://www.laffeycomputer.com/rpl.html -- Check it out!
Re: Encrypting password
On Tue, 13 Mar 2001, Francisco M. Marzoa Alonso wrote: Well, we want to avoid SSL if possible. Certificates for the servers aren't that cheap, and we could potentially have quite a few servers. As we're a startup company, I don't really want to commit ourselves to get SSL, seeing as with SSL is only partly about encryption - its more to do with making sure yiour dealing with trusted parties. As far as I known, you do NOT need Certificates, you can run SSL encryption without them, certificates are just for identify without doubt that a server is who it says. By other side, you can create your own certificates but they'll be not signed by a h... certification authority. It will WORK without certificates, but the user will get big warning messages that something fishy is going on. This would scare off a large number of users (myself included). Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Cache problem with IE
On Tue, 13 Mar 2001, Zsolt Koppany wrote: Hi, with the code below I can get netscape not to cache a jsp page but it does not work with Internet-Explorer. Does anybody know why? response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache");\ Mac, or PC? What version? IE Mac has a lot of cache problems. For one, it will not send a pragma: no-cache header to a proxy even when the user tries to do a super reload. This is a bug that I have reported multiple times. MS claims that this is correct behavior.. uh BS! The PC version will set this header! Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Cache problem with IE
On Tue, 13 Mar 2001, Zsolt Koppany wrote: No, there is no proxy, everything runs in a simple LAN. You can also try adding the following at the top of your HTML document: (in the HEAD) META HTTP-EQUIV="Pragma" CONTENT="no-cache" Though I don't know why it wouldn't work from the servlet. Have you tried telnetting to your box and issuing an HTTP request manually? Perhaps the headers are not actually getting set. This can happen if you send any output to the output stream before setting the headers. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Cache problem with IE
On Tue, 13 Mar 2001, Zsolt Koppany wrote: I do it from a JSP and not from a servlet and the page look like: %response.setHeader("Cache-Control", "no-cache");response.setHeader("Pragma", "no-cache");% OK, Try telnetting to your box and issue the HTTP command: GET /root/relative/path/to/file HTTP/1.0 (two returns) Then look at the header (which will be at the top and may scroll off the screen). You can also try the HEAD command instead of GET. You might also try HTTP/1.1 instead of 1.0 and see what the responses are. If you get headers like the ones you set ("Pragma: no-cache", etc.) then the problem is with the browser not honoring them. In this case try the META versions instead. If you do not get those headers than your JSP container is not setting the headers for some reason. When you telnet look also for other headers like max-age and expires. You may have your server configured to set these for the file. The browser may be using these instead. Turn off Expires for the directory or location in question. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Encrypting password
On Mon, 12 Mar 2001, DONNIE HALE wrote: The problem with this approach is that, without a challenge-response, having the MD5 digest of the password is as good as having the password. Donnie [EMAIL PROTECTED] 03/12/01 10:05AM You could also use a little javascript to send password coded with md5 and verify in servlet the password for this user via md5 is equal to the password string you received : ie: http://pajhome.org.uk/crypt/md5/index.html Of course, you have the server send a random number (or better a date, since it will never repeat). The hash is applied to the password combined with the date. This gets sent to the server and the server know what it sent out so it can calculate what the hash value should be. This is how APOP works. THis, naturally, does nothing to conceal the DATA in transit, but it does a fairly decent job (though not infallable) of concelaing the password. Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Encrypting password
On Mon, 12 Mar 2001, GOMEZ Henri wrote: The problem with this approach is that, without a challenge-response, having the MD5 digest of the password is as good as having the password. What is the challenge-response ? The MD5/SHA1 digest is good over secure line. 1) Store in DB or LDAP only the MD5 digest of user password 2) Use SSL from browser to httpd/tomcat server. 3) Send on the SSL link, user log and md5 password and check in servlet/JSP that for that user the password (md5) and the DB/LDAP content are the same. If you are using SSL then why even bother hashing the password? I think the original poster said he/she could not use SSL (but I may be mistaken). Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Encrypting password
On Mon, 12 Mar 2001, Byung Jin Chun wrote: JMHO, but I think the point is if you have ssl available, why send a digest, and if you don't, then you are sending the md5 digest in the clear where it can be sniffed. This is why you use the challenge-reposne. The server gives a challenge (like the current time in millis). The server stores this. The client combines the challenge with the passowrd (with concatenation, or other technique). THIS combined string is hashed. This hash is sent to the server. The server can calculate the same hash because it sent out the challenge in the first place. Like APOP... Joe Laffey LAFFEY Computer Imaging St. Louis, MO -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
www authentication FYI
This is an FYI for people devloping servlets/JSP for use under Tomcat and JRun. Tomcat works fine when using the Sun recommended way of setting www-authenticate headers using setHEader followed by sendError with an UNAUTHORIZED code. JRun, on the other hand (sorry, don't know the version, but it is running Servlet API 2.1) need you to call setHeader followed by setStatus(int) with the UNAUTHORIZED code (401). If you call sendError jRun will not send the www-authenticate header and you will not be prompted for a password in IE. Netscape will prompt you for a password for "unknown" instead of for the Realm specified in the header (because the header is not sent). I am sending this because I figure a lot of people are doing devlopment under Tomcat, but their servlets may be deployed using other servlet containers... Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Here you have, ;o)
Hehe... I love it when people send worms to mailing lists. I feel sorry for all the Outlook users... Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: rs.next() problems with mm.mysql/JDBC 2
On Mon, 12 Feb 2001, Randy Layman wrote: --- ResultSet rs = stmt.execute(sql); String userId = rs.getString("userid"); String status = rs.getString("accountStatus"); Your code snippet really shouldn't have worked. The fact that it did looks to be a bug in the 1.x drivers. You might be able to write some form of script that looks for ResultSet rs = and then add rs.next() on the next line. Not the best solution and it won't get all of your code, but its a place to start. You would also want to check the return value of rs.next() to be sure there is actually something there! (Read The Friendly Manual on rs.next() if you are confused.) Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: Recommendations for JSP development tools?
On Fri, 9 Feb 2001, [iso-8859-1] Stefán F. Stefánsson wrote: JBuilder works well also. It's got Tomcat integrated into it. The free, open-source written-in-Java text editor named jEdit also works real nicely for editing JSPs. http://jedit.sourceforge.net/ Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
running as non-root/auto mode?
What is the easiest way to have tomcat startup at boottime running as user www? Also, can we now use the non-manual auto-startup mode that worked with ApacheJServ1.0? (Where Java starts up automagically)?? Thx, Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Multiple tomcat processes
I could not find this in the faq... I launch Tomcat (3.2.1 under linux JDK 1.3) and I launches a bunch of processes. However, it does not appear that it is using the memory that it should if these were all independent processes. Are these just threads, or what? Thx, Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: Recovering from oversize upload exception ?
On Fri, 19 Jan 2001, Tal Dayan wrote: We are trying to use the Oreilly servlet package to service requests from a form that is used to upload files. The form contains buttons, checkboxes, radio buttons, and several 'file' fields. When request size is larger than the max size we allow, the constructor new MultipartParser(req, 10, true, true) throws an exception, reporting about the size violation. I just re-wrote the O'Reilly stuff to throw an exception of my own creation (SizeTooBigException or something like that). It is very easy to do... I can sedn you what I did if you want. IMHO, this should be included in the real package. Joe Laffey LAFFEY Computer Imaging St. Louis, MO - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: file upload servlet
I think that you can not mix parameters and file when you use MultipartRequest ( from Jason') to handle multipart/form-data. Regards, I have no problem mixing them. Be sure you have encoding="multipart/form-data" in your FORM tag. Joe Laffey St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: can jsp handle multipart/form-data ?
On Tue, 12 Dec 2000, John D. Smith wrote: I try to make a jsp page that handles a file upload. The problem i face is that i get a Internal Server Error from apache when i submit FORM enctype="multipart/form-data" ... to a jsp as action. Sending the same to php / cgi works fine. Question is: Is my server(apache/tomcat) misconfigured or doesn't jsp handle that kind of requests ? Here's what I discovered about this issue: I am using the multipart classes from Jason Hunter (with Java Servlet Programming from O'Reilly... I am using the latest version from the website.) The problem is that if you use a multi-part request, but then do not treat it as such (by reading the ServletInputStream) then you will get the INternal Error. I found that the Multipart classes do not read the input stream if the file is too large (i.e. the check for the larger file is done before the reading of the entire stream). This is a good idea in general, but leads to the error. I am working on some enhancements to the multipart classes that fix this. I have a working version now, but it is not too generic . (i.e. it has been hacked quickly to work with my project.) I can share this... If you are insterested let me know. Joe Laffey LAFFEY Computer Imaging St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? -
Re: RES: multipart requests and file uploads problems on the Apachec onnection
On Fri, 8 Dec 2000, Jose Euclides da Silva Junior - DIGR.O wrote: -BEGIN PGP SIGNED MESSAGE- Even in NT environment? Thank you. I have had no problems mixing the two [regarding mixing file uploads with regular form data in multipart requests] I have had it work under NT (Apache with Tomcat). Though I mainly use Unix, it should work anywhere like most server-side Javastuff. Joe Laffey LAFFEY Computer Imaging St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? -
Re: writing jsp output to a file
On Mon, 13 Nov 2000, John Ellis wrote: All you need to do is create a virtual browser: URL pageYouWant = new URL(completeRequestString); InputStream in = pageYouWant.openStream(); // burn off the header from in, then write the rest to a file... This will all be done, of course, in a completely seperate JVM than your Tomcat JVM. It sounds like an ineresting application of jsp. What if you compile your ordinary JSP into a servlet (by executing it normallY). Then go to the compiled servlet and replace "out" with a normal DataOutputStream or FileWriter. Remember that your JSPs all get converted to servlets, which encapsulate the HTML portions of the JSP page into out.print() statements. If you had to do this a lot I bet you could hack a copy of Tomcat or GNUJSP pretty easily so that it did this be default. Joe Laffey LAFFEY Computer Imaging St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? -
/servlet under NT
By some miracle I got this working under Mac OSX (BSD style), but now I need it under NT. I have some existing apps that require the serverts to by accessed under http://www.yourcompany.com/servlet/com.your.company.servlet So I need to setup a "/servlet" context right? I want these servlets (class files) to reside in "C:\Program Files\Apache Group\Apache\htdocs\servlets" I do not want anything in the TOMCAT_HOME tree. I also want JSP files to work from any web directory (think this works). So my question is, where do I put this? Do I use forward slashes or backslashes? On my OS X box I edited tomcat.properties to add a new zone called "servlets". I defined a properties files "servlet.properties" that specified a repository in the right directory. I then added "ApJServMount /servlet /servlets" to my tomcat.conf (which is included in httpd.conf). This worked fine. Is there some new way to do this with Tomcat? The way I am trying is more of a mod_JServ way. Thanks! Joe Laffey LAFFEY Computer Imaging St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? -