Mime-mapping to trigger e-mail client
I've got RFC822 e-mail messages stored in a database. I'd prefer *not* to write (or rely on) an email-to-HTML converter. Instead, I'd like to serve the content as-is and have the client's browser recognize the mime type and trigger an e-mail client. My question is, what mime-mapping will produce this behavior? Thanks!
Re: Mime-mapping to trigger e-mail client
So, I tried setting the servlet response content type to message/rfc822. With Netscape Nav 7.2, it prompts me to open the default application (suggesting MS Outlook Express, which is my default e-mail app). I click OK and get the e-mail content in all its glory. With IE 6, it simply displays the (rich text) content. This is fine. However, if I want to view any attachments, I have to Save target as... and then open the saved file to access the attachments. Does anyone know of the appropriate response headers to force IE to trigger the e-mail client? - Original Message - Sent: Sunday, March 06, 2005 9:50 AM Subject: Mime-mapping to trigger e-mail client I've got RFC822 e-mail messages stored in a database. I'd prefer *not* to write (or rely on) an email-to-HTML converter. Instead, I'd like to serve the content as-is and have the client's browser recognize the mime type and trigger an e-mail client. My question is, what mime-mapping will produce this behavior? Thanks!
Re: Wild Card Hosting
There are some domain-name-registrars/DNS-providers that allow you to set up a wildcard host where their domain name servers will dynamically redirect HTTP requests. For example: http://*.domain.tld/ could be redirected to something like http://mywildcardhost.domain.tld/%SERVER_NAME%/ where %SERVER_NAME% would take on the whatever host was originally used in the HTTP request. It's then a simple task of using a wildcard url-pattern/ servlet mapping (/* in this example) to direct the request accordingly. This obviates the need to customize Tomcat code. However, you'll probably need a nominal monetary outlay to use the services of said DDNS provider. Read more: http://www.changeip.com/
[Way off topic] Getting MSOutlook calendar to interface with Tomcat-served data
I'd like to serve calendar/event info to the calendar in MS Outlook (or is that LookOUT!?). I know that it's possible to create output that can be statically imported, but I'd like to make it as easy as possible to periodically/on-demand synchronize Outlook with a Tomcat server.
RE: [Way off topic] Getting MSOutlook calendar to interface with Tomcat-served data
Synchronize as in one-way import/upload from the web server. Synchronize as in not duplicating entries. Synchronize as in not generating additional entries from events that had been modified; event A originally scheduled for 10:00am is moved to 2:00pm -- ultimate result, a single event scheduled at 2:00, not one at 10:00am and a second at 2:00pm. Sycnhronize as in deleting entries that have been marked as such Synchronize as in what could be done manually to insure the above conditions: -- Tomcat server generates a feed in iCal/vCal format; each event is tagged with a category (let's say www.cal-site.com/calendar) to distinguish the source -- Outlook user imports the file/feed some period passes and schedules are changed at www.cal-site.com/calendar -- user, having created a specialized view in Outlook, deletes all calendar entries with category = www.cal-site.com/calendar -- user visits the site and downloads another feed for import == I'd be interested in some details about the COM add-in and what would be necessary on the Tomcat side. Thanks!
Linking/forwarding GET requests using Default servlet or other Tomcat feature
I'm running a stand-alone (no Apache front-end) TC 5.0.19 server on a WinXP box. I have a webapp that has a /teams directory that contains gameScores.htm, teamStandings.htm and scoreForm.htm. I also have a /playoffs directory (can you tell this is a sports-related site?) directory that has the **exact same files**. Now, I'd like to keep a single copy of the 3 files in one directory and have some servlet-mappings in web.xml that would forward the request from /playoffs to /teams **WITHOUT** the HTTP client being aware of a 'redirect.' That is, I don't want to issue an HTTP redirect, and WinXP doesn't have file linking like Unix. Is there some hook in the Default servlet (or other TC-supplied class) that would allow one to do something like the following: servlet servlet-nameplayoffs/servlet-name servlet-class...DefaultServlet (or whatever)/servlet-class init-param param-nameFORWARD/param-name param-value/teams/param-value /init-param /servlet servlet-mapping servlet-nameplayoffs/servlet-name url-pattern/playoffs/*/url-pattern /servlet-mapping The idea is I'm being very lazy and hoping that there is a feature in the default servlet (or other TC-supplied filter/class) that will allow this without me having to write same. (Of, if someone has some code they'd like to share...) Thanks.
Re: Linking/forwarding GET requests using Default servlet or other Tomcat feature
Yes, I know you can make many mappings to a given servlet/jsp, but that's not what I'm asking for. When an HTTP client requests /playoffs/gameScores.htm, I'm hoping there's some slight-of-hand trick/feature that will cause Tomcat to serve /teams/gameScores.htm WITHOUT a redirect so that it appears to the client that they're getting /playoffs/gameScores.htm.
Re: Linking/forwarding GET requests using Default servlet or other Tomcat feature
Yes, I know that an internal forward would work. I just didn't want to code/test/debug it. Yes, I'm being very lazy here; but I hate to reinvent the feature if it already exists and it just seems to me that this is something that probably should already exist (since it can be done in Apache).
Re: Tomcat and the HttpServletRequest Object
Jeff, You still haven't given a rationale why you *need* the parameters presented in a specific order (even though the brower's supposed to produce that result). I've worked with a set of generic form processing servlets and never had the desperate need to know the order upon receipt; if I'm manually inspecting/debugging a submission, I'm doing a SELECT...ORDER BY... from a database anyway. My suggestion, if you really, really, really need to know the order of appearance in the originating form (and you don't want to preface each input name with an indexing numeric value as suggested earlier): a.. write some (client-side) JScript to traverse the document's DOM (starting from the form node) just PRIOR TO SUBMISSION, b.. create a delimeted string of parameter names for each input node encountered c.. stuff that delimeted string value into a input type=hidden name=formInputOrder d.. form.submit(); On the TC/servlet side, a.. get the value of the formInputOrder parameter b.. pull all the names from the enumeration of param names provided by the request c.. sort that list based on a Comparator implementation that compares the relative positions of each comparee within the formInputOrder value (Note that it's always good to wrap both comparees with the delimeter used by the formInputOrder value.) This suggestion assumes a fairly distinct set of input names. If your form has multiple inputs with the same name (or a select that allows multiple options), then, obviously, the above has some weaknesses.
Re: How force Tomcat 5.5.4 to always use URL Rewriting
Set the cookies attribute for the given (server.xml) context/ node to false. This will force Tomcat to rely only on URL rewriting.
When would TC (5.0.19) not send back (or even log) a response?
I saw this interesting request show up in my log file: 2005-08-28 20:11:08 RequestDumperValve[catalina]: REQUEST URI =/cgi-bin/jud.cgi 2005-08-28 20:11:08 RequestDumperValve[catalina]: authType=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: characterEncoding=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: contentLength=-1 2005-08-28 20:11:08 RequestDumperValve[catalina]:contentType=null 2005-08-28 20:11:08 RequestDumperValve[catalina]:contextPath= 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=host=www.worldandsearch.com 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=accept=*/* 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=pragma=no-cache 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=user-agent=Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) 2005-08-28 20:11:08 RequestDumperValve[catalina]: locale=en_US 2005-08-28 20:11:08 RequestDumperValve[catalina]: method=GET 2005-08-28 20:11:08 RequestDumperValve[catalina]: pathInfo=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: protocol=HTTP/1.1 2005-08-28 20:11:08 RequestDumperValve[catalina]:queryString=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteAddr=61.221.32.114 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteHost=61.221.32.114 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteUser=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: requestedSessionId=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: scheme=http 2005-08-28 20:11:08 RequestDumperValve[catalina]: serverName=www.worldandsearch.com 2005-08-28 20:11:08 RequestDumperValve[catalina]: serverPort=80 2005-08-28 20:11:08 RequestDumperValve[catalina]: servletPath=/cgi-bin/jud.cgi 2005-08-28 20:11:08 RequestDumperValve[catalina]: isSecure=false == And then there's nothing noting what the response was, which should have been a 404 since I've no such host defined. I've got a valve defined that will intercept requests for a host not defined in server.xml and send back a 404 response instead of allowing the request to flow to the default host for the engine. Under what conditions will Tomcat (5.0.19) not send (or log) any response?
Dropped response
I saw this interesting request show up in my log file: 2005-08-28 20:11:08 RequestDumperValve[catalina]: REQUEST URI =/cgi-bin/jud.cgi 2005-08-28 20:11:08 RequestDumperValve[catalina]: authType=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: characterEncoding=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: contentLength=-1 2005-08-28 20:11:08 RequestDumperValve[catalina]:contentType=null 2005-08-28 20:11:08 RequestDumperValve[catalina]:contextPath= 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=host=www.worldandsearch.com 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=accept=*/* 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=pragma=no-cache 2005-08-28 20:11:08 RequestDumperValve[catalina]: header=user-agent=Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) 2005-08-28 20:11:08 RequestDumperValve[catalina]: locale=en_US 2005-08-28 20:11:08 RequestDumperValve[catalina]: method=GET 2005-08-28 20:11:08 RequestDumperValve[catalina]: pathInfo=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: protocol=HTTP/1.1 2005-08-28 20:11:08 RequestDumperValve[catalina]:queryString=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteAddr=61.221.32.114 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteHost=61.221.32.114 2005-08-28 20:11:08 RequestDumperValve[catalina]: remoteUser=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: requestedSessionId=null 2005-08-28 20:11:08 RequestDumperValve[catalina]: scheme=http 2005-08-28 20:11:08 RequestDumperValve[catalina]: serverName=www.worldandsearch.com 2005-08-28 20:11:08 RequestDumperValve[catalina]: serverPort=80 2005-08-28 20:11:08 RequestDumperValve[catalina]: servletPath=/cgi-bin/jud.cgi 2005-08-28 20:11:08 RequestDumperValve[catalina]: isSecure=false == And then there's nothing noting what the response was, which should have been a 404 since I've no such host defined. I've got a valve defined that will intercept requests for a host not defined in server.xml and send back a 404 response instead of allowing the request to flow to the default host for the engine. Under what conditions will Tomcat (5.0.19) not send (or log) any response?