Re: favicon when serving non-html
Why would you? FavIcon is meant as attributes of pages, more specifically pages of whole sites. You can potentially have different FavIcons for different parts of your web site, but that is not common. Resources, which PDF is, have no reason for having a favourite icon. It would be the same as asking can my GIFs have favicon. No, they cannot. Nor should they. Nix. From: Dola Woolfe dolac...@yahoo.com To: Tom Cat tomcat-u...@jakarta.apache.org Sent: Tue, July 6, 2010 4:10:43 PM Subject: favicon when serving non-html Hi, When I serve up, say, a PDF file, how do I control the favicon? Here's my code: response.reset(); response.setContentType(IOUtilities.gMIMEType(fn)); response.setHeader(Content-disposition, inline; filename= + file.getName()); OutputStream outStream = response.getOutputStream(); synchronized(response.getOutputStream()){ outStream.write(IOUtilities.gFile2Bytes(file.getAbsolutePath())); } response.flushBuffer(); Thanks in advance - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users)
Just to make the picture complete, it can also be done with Apache + mod_auth_kerb + mod_jk. It does require some steps and the most tricky one is getting a proper Kerberos Service key from MS ADS. We've done it, so it is not really a big deal. However, people tend to state that TC is as good at serving static content as Apache and that eliminating one link in the server chain reduces complexity. Which is true. And which is why we need a proper Kerberos realm for these setups. Nix. From: George Sexton geor...@mhsoftware.com To: Tomcat Users List users@tomcat.apache.org Sent: Monday, September 14, 2009 7:47:48 PM Subject: RE: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users) If you're fronting Tomcat w/ IIS using the ISAPI redirector, then this can be done. Here's a link to the instructions for our product that describe how to do it. http://www.mhsoftware.com/caldemo/manual/en/pageFinder.html?page=895.htm Essentially, following steps 2-4 will cause the HttpServletRequest.getRemoteUser() to return the Windows User name (SAMAccountName). George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 -Original Message- From: Nikola Milutinovic [mailto:alok...@yahoo.com] Sent: Monday, September 14, 2009 11:26 AM To: Tomcat Users List; Tomcat Users List Subject: Re: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users) There is also a module from Quest Software, using Kerberos authentication, but it costs mega $. Has anyone considered writing a TC realm for Kerberos? Before MS ADS came into popular use, Kerberos was a rare beast, but now it is more present. And it much better than NTLM, which is why MS started using it. Just think about it - NTLM sucked so badly that the great Behemoth, Microsoft, decided to use open standard solution. Nix. From: André Warnier a...@ice-sa.com To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, September 13, 2009 1:33:16 PM Subject: Re: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users) To Martin, Steve and others : Samba's JCIFS works fine, but only for NTLMv1 authentication. (It is also no longer maintained, see http://jcifs.samba.org.) It does NOT work for NTLMv2 authentication, which is fast becoming the norm, and the default from Vista onwards. Jespa works with NTLMv2, and is free for up to 25 users. I have no shares in ioplex or Jespa. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users)
There is also a module from Quest Software, using Kerberos authentication, but it costs mega $. Has anyone considered writing a TC realm for Kerberos? Before MS ADS came into popular use, Kerberos was a rare beast, but now it is more present. And it much better than NTLM, which is why MS started using it. Just think about it - NTLM sucked so badly that the great Behemoth, Microsoft, decided to use open standard solution. Nix. From: André Warnier a...@ice-sa.com To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, September 13, 2009 1:33:16 PM Subject: Re: Windwos Integrated Authentication using AD and Tomcat (no prompt to the users) To Martin, Steve and others : Samba's JCIFS works fine, but only for NTLMv1 authentication. (It is also no longer maintained, see http://jcifs.samba.org.) It does NOT work for NTLMv2 authentication, which is fast becoming the norm, and the default from Vista onwards. Jespa works with NTLMv2, and is free for up to 25 users. I have no shares in ioplex or Jespa. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Right way to close database connection pool
Why exactly would you want connection pool to be closed by TC? I understand your point of view - you have that one web application and it is using the pool and you are seeing something that looks like a leak. Take a look from Tomcat's perspective. It has a JNDI bound resource, DataSource in this case. TC has no way of knowing that that particular resource is being exclusively used by just that one application. It can be used by several applications. So, why close it? On the other hand, even if it knew that the DS is being exclusively used by your web application, which has been undeployed at some point, why should it close (and then re-open) the DS? DataSource pool is managing a pool of connections, it is opening, closing and recycling connections as needed. When the container (TC) goes down, I would expect it to close the entire pool, but I don't see the need for closing it while TC is up and running. Nix. From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, August 5, 2009 7:35:40 PM Subject: Re: Right way to close database connection pool -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Filip, On 8/5/2009 1:05 PM, Filip Hanik - Dev Lists wrote: you would need to listen for context destroyed, and cast the datasource to call close() on it When Tomcat re-deploys an application, is the existing DataSource trashed and re-created? When that happens, are the old connections closed? The OP's comments suggest that the old connections are not being closed. Is this expected behavior? Why are Tomcat-created, webapp-specific (that is, Resources from META-INF/context.xml) DataSources not cleaned-up after web application un-deployment? It would seem that those resources are not applicable to any other webapp (because they came from a specific webapp's configuration) and should be torn-down during an undeployment. Am I missing a use case where this makes sense? Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkp5wuwACgkQ9CaO5/Lv0PC67wCgmaWYuITuwNaoE/Qc3oHuiinp 8+wAnjjHV3WTGF3uq4EhbVsUWLtJpFJ4 =Q63e -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: .html pages as .jsp pages
Well, it should be relatively simple. Add the following to your web.xml: servlet-mapping servlet-namejsp/servlet-name url-pattern*.html/url-pattern /servlet-mapping Nix. From: Dola Woolfe dolac...@yahoo.com To: Tom Cat tomcat-u...@jakarta.apache.org Sent: Thursday, May 14, 2009 8:43:47 PM Subject: .html pages as .jsp pages Hi, I need to give my jsp files the extension .html 1. How do I configure tomcat to treat .html files as .jsp files? 2. Off topic? How do I set up Eclipse so that .html files are opened with the same editor as .jsp files and give me all of the syntax highlighting, etc. Many thanks in advance, Dola - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.18 on Win32 - Enabling Security Manager
I must say that the nature of your questions leaves me with some concern about the content of your guide... Hmmm, I wont bite but I will provide a little more information on what I am doing. The guide is specifically being written for Tomcat on Windows, which in my searching of the web there is very few resources available, and even fewer that provide collated recommendations. As you may have guessed (and is eluded to in the response below) I am not an expert at Tomcat or Java however I need to put together a guide that can be delivered to infrastructure managers whose primary goal is to 'get it working' without considering security. So as part of the information security team I have to provide recommendations to those Infrastructure managers on how to secure the infrastructure (as well as every other application and piece of infrastructure that is being deployed). The majority of the guide is focused on management of the Tomcat server. Things like running tomcat as an unprivileged user (and getting the appropriate Windows permissions to allow that to work properly), Separation of tomcat directories from program files, segregation of duties for Wep-app content and Infrastructure admins, removing or limiting access to default or manager applications, limiting access to sensitive (or dangerous) Windows files and folders, etc, etc, etc. Noble cause. Note one thing, that has nothing to do with Windows, but Java Security. When you enable it, almost all activities directed outside JVM, and even some directed inside it, will require particular permissions. See the supplied security policy for some details, but I will add one that is always present and not covered in that file (for obvious reasons): connection to a DB. If you wish to use any DB server, you will need a TCP/IP connection, via JDBC, to that DB. I am not counting in in-memory DBs, like HSQL. To make the connection, or rather to let JDBC driver make the connection, you must add an appropriate permisssion to your JDBC driver classes. Something like: grant codeBase file:${catalina.home}/psa-webapps/mydomain.com/myapplication/ { permission java.net.SocketPermission localhost,resolve; permission java.net.SocketPermission localhost:3306,connect,resolve; }; I'm not sure this works, though, just picked it up on Google, but that is how it generally should look. Though, I'd use class name, not file location for targeting the JDBC driver. This applies to all aspects of your application, like web services, RMI, disk access,... So, turning secure mode on can require additional work. Not that I consider it a bad idea, but just have in mind that it is not just adding a couple of switches. You should tailor security policy for your application's needs. And it can be a lot of work, plus, it will require testing to see if you've missed something. Nix.
Re: AJP vs HTTP connectors?
Hi all. Jumping in a bit late, but... You have 3 options for plugging TC into Apache's URL space: 1. mod_proxy + mod_proxy_http 2. mod_proxy + mod_proxy_ajp 3. mod_jk Solution 1 is a simple proxy, works like a charm, except for one thing - it WILL NOT give you the identity of authenticated user. So, if you are using Apache for some fancy (or less fancy) authentication, TC will know nothing about it. The connection will be from Apache web server, as far as TC can say. Options 2 and 3 WILL pass the information about authenticated user (if any), so you will be able to issue request.getRemoteUser() and get user identifier, whatever it is. Option 2 is prefered, as of late, for it's setup simplicity, but I'm not sure where it stands in regard to balancing. mod_jk is relatively more complex to setup, but it gives a bit more control. Do you need the control is questionable. I've seen both 2 and 3 work OK. Nix. From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Monday, February 2, 2009 10:12:57 PM Subject: RE: AJP vs HTTP connectors? From: Gregor Schneider [mailto:rc4...@googlemail.com] Subject: Re: AJP vs HTTP connectors? hm, since I'd like to avoid to browse through the whole webinar: what are the benefits / advantages / disadvantages? I'd like to know as well, since I watched the same webinar when it was presented, and don't remember anything specific about not using AJP. (Or maybe I just tuned that part out.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Iterations in JSF using JSTL via forEach
JSTL is not a part of TC. Use Maven2 to assemble your application so it includes the desired version of JSTL. Or Ant. Nix. From: Alexander Hartner [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Friday, October 17, 2008 3:14:45 PM Subject: Re: Iterations in JSF using JSTL via forEach I figured out what the problem was. I was using JSTL 1.1 rather then 1.2. I found a version of this here : https://maven-repository.dev.java.net/repository/jstl/jars/ I am wondering if there are any plans to include this release with Tomcat 6, or make it easier accessible. May this is already being done, just haven't found it. Thanks Alex I am sure this is a very silly problem, however I have been struggling with this for a while now. I am trying to iterate over a collection using JSF and JSTL's forEach which is apparently supported in JSP2.1 (2.0) and Tomcat 6. I have the version number in web.xml set to 2.5 and the faces-config.xml file set to 1.2 (see below). I checked the version of JARS included in the WAR file and they are : standard.jar : Implementation-Version: 1.1.2 jstl.jar : Implementation-Version: 1.1.2 jsf-impl.jar : Implementation-Version: 1.2_04-b20-p03 jsf-api.jar : Implementation-Version: 1.2_04-b20-p03 Below are the configuration files included with my WAR. I am using Tomcat apache-tomcat-6.0.16. I have found some older examples where I got this working, however I can't see why it doesn't work for me anymore. Any suggestions on this would really help me out a lot. Thanks in advance. Alex web.xml === ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; ... faces-config.xml ?xml version='1.0' encoding='UTF-8'? faces-config version=1.2 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd; managed-bean managed-bean-nameController/managed-bean-name managed-bean-classcom.simple.Controller/managed-bean-class managed-bean-scoperequest/managed-bean-scope /managed-bean /faces-config jsp file [EMAIL PROTECTED] contentType=text/html% [EMAIL PROTECTED] pageEncoding=UTF-8% [EMAIL PROTECTED] prefix=c uri=http://java.sun.com/jsp/jstl/core% [EMAIL PROTECTED] prefix=f uri=http://java.sun.com/jsf/core% [EMAIL PROTECTED] prefix=h uri=http://java.sun.com/jsf/html% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleJSP Page/title /head body f:view h1Hallo : h:outputText value=#{Controller.message}//h1 h1h:outputText value=JavaServer Faces //h1 c:forEach var=item items=#{Controller.messages} h1Hallo/h1 h:outputText id=value value=#{item}/ /c:forEach /f:view /body /html jspx file = ?xml version=1.0 encoding=UTF-8? jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; xmlns:h=http://java.sun.com/jsf/html; xmlns:f=http://java.sun.com/jsf/core; xmlns:c=http://java.sun.com/jsp/jstl/core; xmlns=http://www.w3.org/1999/xhtml; version=2.1 jsp:directive.page contentType=text/html/ jsp:output doctype-root-element=html doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN doctype-system=http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/ jsp:directive.page contentType=text/html pageEncoding=UTF-8/ !-- any content can be specified here, e.g.: -- jsp:element name=text jsp:attribute name=langEN/jsp:attribute jsp:bodyHello World!/jsp:body /jsp:element f:view h1Hallo 2 : h:outputText value=#{Controller.message}//h1 h1h:outputText value=JavaServer Faces //h1 c:forEach var=item items=#{Controller.messages} h1Hallo/h1 h:outputText id=value value=#{item}/ /c:forEach /f:view /jsp:root Controller.java === package com.simple; import java.util.ArrayList; import java.util.List; public class Controller { private ArrayListString stuff = new ArrayListString(); public Controller() { System.out.println(Creating Controller); stuff.add(A1); stuff.add(A2); stuff.add(A3); stuff.add(A4); stuff.add(A5); } public String getMessage() { return This is a message; } public ArrayListString getMessages() { System.out.println(Getting Stuff); return stuff; } public void setMessage(ArrayListString stuff) { System.out.println(Setting Stuff); this.stuff = stuff;
Balancing solution which allows graceful partial node migrations
Hi all. This is just a question out of curiousity. Is there a balancer solution that can allow for controlled migration/upgrade of nodes? To explain, suppose you have Apache/mod_jk and you have N Tomcats in balance over that setup, same web application on all of them. Now, suppose you would like to upgrade the application without disrupting the service. Suppose you have fixed a bug. It would be nice if one of the nodes in cluster could be brought out of the cluster, but gracefully. By gracefully I refer to stopping new requests to the node and letting existing requests drain out. When all requests are over, it can be brought down and upgraded. Then it would obviously need to be brought back in. Let us suppose that the new web application is not in semantical inbalanace with the old nodes. Of course, this brings into question what is draining out existing requests? Does that mean open HTTP sessions or just rrunning requests. I suppose, in case of session, we could turn to sticky sessions, right? So, what are your thoughts on the subject? Ever seen something like that in the wild? Or at least in the lab? A balancer that can be reconfigured (almost) online and one that allows for requests to the node being evicted to finish, first. Nix.
Re: tomcat and active x problem
Hi, i have an html page that has a javascript function that opens an outlook mail window .the function is pretty basic: function OpenOutlookDoc() {try{ var outlookApp = new ActiveXObject(Outlook.Application); var nameSpace = outlookApp.getNameSpace(MAPI); mailFolder = nameSpace.getDefaultFolder(6); mailItem = mailFolder.Items.add('IPM.Note.FormA'); mailItem.Subject=a subject test; mailItem.To = [EMAIL PROTECTED]; mailItem.HTMLBody = bbold/b; mailItem.display (0); }catch(e){ alert(e); // act on any error that you get }} if I run the file locally, with the url looking like: file://C:/things are ok, page works, if I copy the html page in one of my projects and run int like localhost:8080/project/file.html I get an [Object error] alert..i remember reading somewhere about some problems using Active -x in tomcat. First of all, this is entirely client side stuff, so it should not make any difference if it is deployed on Tomcat, Apache, WebSphere or IIS. In this script, there is no interaction with the server, whatsoever, so, it is not Tomcat related in any way. You should give us more info on the Object error you're getting, but I must warn you - your problems are IE related and have nothing to do with TC, so you may get help, but then again, you may not. Nix. Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Re: How Do I do (Can I do) Apache like redirects in Tomcat
There is a project called URL Filter doing just that. http://tuckey.org/urlrewrite/ Nix., - Original Message From: Rob Tanner [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, January 8, 2008 7:51:45 AM Subject: How Do I do (Can I do) Apache like redirects in Tomcat Hi, I would like to setup an HTTPS connector in Tomcat (v 5.5.23) that listens on port 28080. That part's easy enough and there is already a certificate installed. Here's the part I'm having trouble with. Whenever a browser send a GET request to that port, I need to return a redirect to an entirely different server (different IP, etc) listening on port 28443. I cannot figure out anyway to do that. Any ideas? Thanks, Rob -- Rob Tanner UNIX Services Manager Linfield College, McMinnville OR Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Re: super happy build time: package org.eclipse.jdt.core.compiler org.eclipse.jdt.internal.compiler does not exist
someone refresh me why CLASSPATH=/usr/share/java is inadequate, and CLASSPATH=/usr/share/java/ecj.jar is required? CLASSPATH is a list of resource locations where JVM can search for Java classes and other resources. A resource can be either a directory or a JAR, which is just a ZIP of the aforementioned directory, plus some additional info (MANIFEST.MF, signing certificates,...) Nix. Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to write this elegantly in JSP/EL
img src=${imageUrl} alt=Author photo height=c:out value=${DATA_PHOTO_HEIGHT}/ width=c:out value=${DATA_PHOTO_WIDTH}/ / (sigh) I feared as much. It is just that I hate JSTL tags inside another tag's attributes. Why would you use `src=${imageUrl}` and then use the clumsy 'c:out' form? What's wrong with `height=${DATA_PHOTO_HEIGHT}`? The answer is simple, imageUrl is calculated in the controller/servlet for each request. com.libris4youDATA_PHOTO_HEIGHT is a constant embedded in the Java code, where it belongs. And, here is another one: in your example DATA_PHOTO_HEIGHT is the name of the variable. In my example, I have already made THAT name a constant in the Java class. What I was looking for is having to change that name only in one place - Java code. It could be that my quest is futile, but I wanted to pursue it and see where it leads me. Nix. Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to write this elegantly in JSP/EL
Also you talk about the DATA_PHOTO_HEIGHT and DATA_PHOTO_WIDTH properties being static propertys of the AuthorController class. Why not create a Constant object called PHOTO or something. make the height and width proper static on that, then pass that into the model. Then you can use the following in your jsp page img src=${imageUrl} alt=Author photo height=${PHOTO.HEIGHT} width=${PHOTO.WIDTH}/ Alas this is not what I'm looking for. My desire was to avoid code duplication and I spotted it in the fact that I had photoHeight (as a String) in two places: 1. in controller, which bound the value under that name 2. in JSPF which used that name in EL I wanted to be able to specify the actual name in just one place. Nix. ___ You snooze, you lose. Get messages ASAP with AutoCheck in the all-new Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_html.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to write this elegantly in JSP/EL
Hi all. This is not really TC related, but more JSP and EL question, but I thought I'd ask. I would like to have an elegant way of using constants from Java classes in EL. This is a relatively good illustration of what I am talking about. Take, for instance, a Spring controller. It has a method where the programmer can bind objects to model-and-view, which basically binds it to a request or session scope. It is very similar to a plain Servlet doing request.setAttribute( name, value ). public class SomeController extends SimpleFormController { public static final String DATA_PHOTO_WIDTH = photoWidth; public static final String DATA_PHOTO_HEIGHT = photoHeight; ... protected referenceData( ... ) { ... modelAndView.put( DATA_PHOTO_WIDTH, photoWidth ); modelAndView.put( DATA_PHOTO_HEIGHT, photoHeight ); ... } ... } And then in JSPF or JSP: img src=${imageUrl} alt=Author photo height=${photoHeight} width=${photoWidth} / Notice that the EL variable name is the same as that constant. So, I have 2 places to keep in synch. If I wrote that in a scriptlet, it would be correct, from the point of do not duplicate code: %= request.getAttribute( com.libris4you.books.maintenancepanel.AuthorTabController.DATA_PHOTO_WIDTH ) % Now, how could I do the same in EL? Something like (tongue in cheek): width=${=com.libris4you.books.maintenancepanel.AuthorTabController.DATA_PHOTO_WIDTH} Did I miss something crucial in EL? Nix. Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. http://new.toolbar.yahoo.com/toolbar/features/mail/index.php - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to write this elegantly in JSP/EL
Thank you all who responded. I think the following should do you img src=${imageUrl} alt=Author photo height=c:out value=${DATA_PHOTO_HEIGHT}/ width=c:out value=${DATA_PHOTO_WIDTH}/ / (sigh) I feared as much. It is just that I hate JSTL tags inside another tag's attributes. On 6/22/07, Johnny Kewl [EMAIL PROTECTED] wrote: Hi Nikola, never done it, but I think you have to override the resolver. ie instead of the standard resolver, which looks for standard properties or custom classes declared thru XML yours will tie to a class in your app. Managed to find an ok article maybe its enuf for you to find the relevent code in spring, and steal it ;) http://today.java.net/pub/a/today/2006/03/07/unified-jsp-jsf-expression-language.html I will definitely look it up. Is there perhaps some useful function taglib? Something like: ${fn.getProperty( com.libris4you.books.controller.AuthorController.DATA_PHOTO_HEIGHT )} Nix. Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
TC as windows service - thread dump
Hi all. This may have been asked before, but I couldn't find the answer. Perhaps it should be in the FAQ. I have installed TC 5.5 as Windows service. Tomcat Monitor application (the one that sits among tray icons) that is used to start, stop and configure service, also features a command Thread dump. Where is thread dump created? I had a stuck web application and wanted to perform thread dump. I clicked on that and couldn't find the thread dump. In the end I resorted to using a tool at http://www.adaptj.com/root/main/download which worked just fine. Still, I would like to use regular mechanism. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemoryError (but not really out of memory?) cause tomcat processes to hang
You have quite a bit of memory in your 'Old Generation'. You need to determine what you're allocating that isn't being released. Not true, see below. Heap Usage: PS Young Generation Eden Space: capacity = 10223616 (9.75MB) used = 4748760 (4.528770446777344MB) free = 5474856 (5.221229553222656MB) 46.44892765925481% used This is OK. From Space: capacity = 524288 (0.5MB) used = 483360 (0.460968017578125MB) free = 40928 (0.039031982421875MB) 92.193603515625% used Also normal. To Space: capacity = 9109504 (8.6875MB) used = 0 (0.0MB) free = 9109504 (8.6875MB) 0.0% used This is always 0, AFAIK. PS Old Generation capacity = 238616576 (227.5625MB) used = 162772160 (155.23162841796875MB) free = 75844416 (72.33087158203125MB) 68.21494245227959% used This is also NOT the cause of problems. PS Perm Generation capacity = 22675456 (21.625MB) used = 22515408 (21.472366333007812MB) free = 160048 (0.1526336669921875MB) 99.2941795746026% used Here is the failure. PermGen is getting exhausted. Nix. Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL Redirect Question
Actually, there is already a project URL Filter for Java Web applications, basically does what mod_rewrite and mod_proxy give you. Maybe not in so many details, but it is going to save our hide on our next project. :-) Nix. - Original Message From: Caldarale, Charles R [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, February 8, 2007 4:45:39 PM Subject: RE: URL Redirect Question From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] Subject: RE: URL Redirect Question set that one URL in your welcome page as the default -- say index or default.jsp, or index.html, or whatever. That way, people can just click that simple link below. You can also use a filter or valve within Tomcat to forward the request to the desired context, and avoid any client interaction. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: run service in jdk 6
Hi. Just installed JDK 6 and Tomcat 6.0. JDK is installed under REGULAR path: C:\Program Files\Java\jre1.6.0. Runs fine. Let me just say that I have always installed JDK on Windows under expected path, in Program Files. Both ZIP and service versions ran with no problem. This was true of 5. and 5.5 versions. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: Re: Solaris 10 Apache 2 Tomcat mod_jk
Installing from source is super simple. It's a pretty basic untar, configure, make, install kinda package, and always results in the binary that is appropriate for your setup. You just need to make sure that you have a C compiler handy (which, as I recall, Solaris does not always have). What's the story on Solaris? You need to buy C Compiler? I think they have some Developer's Studio, but I haven't checked licensing. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Defining loggers best approach?
But as Mark's loggers are 'static', don't they have the same semantics WRT serialization as 'instance transient' ? Should be. After deserialization, all static fields should be (re-)initialized, thus, leading to logger being present, class-wide. If so, Mark's would seem more efficient to me (though I could be wrong) due to reduced object instantiations. Static avoids one if per method call. Indeed, singleton design pattern seams much more efficient with static initialization, than if (singleton == null) { init() } pattern. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perm Gen not being released in GC
Im a Project Manager, not a techie but we had the same problem and had to increase the perm gen to the following: Tomcat sets it at default at 64MB. Perm Gen Memory: 150 MB Max Perm Gen: 256 MB Perm gen is memory reserved for class loading and is directly proportional to the number/size of classes you load. We where getting perm gen out of memory errors which is why we did this. This stabilised the environment but we still have problems with our Heap Memory filling up and not been garbage collected properly. That sounds like a memory leak. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: PUT or POST?
Apparently our fat client can issue either a POST or a PUT request. The client developer has a slight preference for PUT. I must admit to not being familiar with HTTP PUTs - are there any downside to using PUTs (aside from having to override doPut())? I don't think your code will not be any different -- aside from having to override the doPut() method in your servlet. However, the HTTP spec has rules that are most strict when using PUT; you have to respect all of the content-* headers among other things, and are required to return a 501 NOT IMPLEMENTED if you do not support such options. The bottom line is that HTTP PUT appears to have a more robust set of options, but you really should implement them properly. HTTP POST will allow you to be a bit lazier in your implementation. It is also a question of semantics. If the technical side is the same, then let us communicate our intentions clearly. GET - request which will not change the state of the server side (a.k.a. idempotent method). Used for querying server side. POST - request that will change the state of the server side. Used for submitting data to the server side. PUT - request that will create an object on the server side, accessible via the given URL. Used for object upload. DELETE - delete an an object from the server URL space. So, one could argue that POST and PUT have similar semantics. They both send data to the server and expect the state of the server side to change. However, PUT is more oriented to the pre-web app era and more inclined to notions of manipulating static content. POST is more inclined to web applications and to notions of submitting data to be processed. If you expect that crash data will create an object, real or virtual, that will be accessible via the URL you will provide for PUT method, then PUT seams like a good choice. If you are submitting data and some other object may come to exist (like crash report) or not, as a result of that data submission, then POST is a more proper choice. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: apache not talking to tomcat w/ mod_jk
I set mod_jk to log level debug, and saw it was telling apache 2No.Host.matches.server.name. This simply means that Apache is accepting a request for one Virtual Host an that host is not configured in TC. This issue can be as trivial as not defining the actual hostname as a Host element in your TC server.xml Read TC docs, pay attention to the Host tag. It is used to define as many virtual hosts as you like. The thing is, the virtual host in Apache, *which is going to forward requests to TC*, MUST exist in TC, as well. It is as simple as that. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BOOBIES!
Could this person (inject other undesirable word) please consider the fact that women are in the user's group also. -- I fail to see any reason for the subject. It is not spam and it is a real question and it is not an accidental reply to some other message. This is bizarre. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: BOOBIES!
Two using their work email. These low lifes are so entertaining. On 7/21/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: http://www.globaladrenaline.com/hbs/images/QN---Blue-Footed-Boobie-1.jpg -- Charles Knell [EMAIL PROTECTED] - email Why was this one labeled as a low life? I thought he exercised excellent state of spirit. And why is using work address in his case considered a minus? For the original poster, I must admit I was totally surprised. I could not imagine anyone intelligent enough to formulate that question stupid, immature or sexist enough to place such a subject. I'm still hoping it is some bizarre mistake. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermediate write in JSP
I had a similar issue in the past that I overcome by having the servlet start a separate thread that was producing the report, And a jsp page refreshing every 10 seconds or so checking for completion. That is, of course, the asynchronous application design. Sometimes it is necessary, but it does bring a question. What is being so slow? Sending the amount of data you're sending is not slower than it can be. My guess is that DB is taking a rather long time to complete the query. I would not blame the network, because the Net connection between DB and TC should be at least as fast as the one between TC and your client. So, the original poster might wanna take a look at the DB for speeding it up. It might not be possible, though. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flash and Javascript
I currently have a Flash file which uses the ExternalInterface.call function to call some JavaScript functions I have on a JSP page running in Jetspeed 2. When I publish the file to an HTML in Flash and just view it on my computer it works great, but I have tried making a JSP page out of it and putting it up on my server and when I am clicking the buttons that should be calling these functions, nothing is happening. I really do not know if it is a Flash problem or a Tomcat problem, but I haven't been able to find anything on Flash messageboards about it. [ ANSWER ] OK, this is not strictly a proper place, but I can think of no other, so here goes. Your question is a bit vague. If I understand correctly, you have one JSP page, which could even be a plain HTML, as far as your problem goes. That page embeds a Flash, which calls a JavaScript, also present on thet page. This all is a client-side stuff, none of it is taking place on the server, right? If this is the case, no wonder nobody responded :-) This looks like a HTML problem, take a look at the source of the page and figure out what's wrong. From your description, it should be tottaly irrelevant whether the page is HTML or JSP (unless that JSP is doing something on the server-side, like querying DB). It should also be totally irrelevant if it is on your local machine or an the web server - in case of HTML. JSP would require JSP engine, like Jetty or Tomcat. My advice to you is, make it work in pure HTML first, both on your local machine and on any web server (to rule out wrong links and similar gotchas). Then embody it in a JSP page. If that problem truly requires a JSP. Nix. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: downloaded JK binaries for Linux - which to use? workers or prefork?
--- Kim Albee [EMAIL PROTECTED] wrote: yes -- but what is the difference? i'm running Fedora Core 3 on a single processor Linux box, running Apache 2.x what does prefork mean? vs. worker? Basically, PreFork is the old MPM from Apache 1.3 series and forks one process for each new request. Worker is a multithreaded module. It will launch multiple threads to service new requests. Apache 2.0 has other multithreaded MPMs, like ThreadPool, PerChild, Leader (what happened to these in Apache 2.2?). Worker is more efficient on the resources and faster. PreFork is old school. One word of warning. If you are running PHP on that Aapche, you will be forced to use PreFork, since PHP doesn't guarantee thread safety. Don't misunderstand me, PHP5 core IS thread-safe, most of the PHP extensions ARE thread-safe, but most of the 3rd party libraries, used by those extensions ARE NOT. Therefore, RPM install or YAST will set MPM to prefork if you load mod_php. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem starting tomcat with jsvc cron job
--- Peter Neu [EMAIL PROTECTED] wrote: Hello, I'm stopping restarting tomcat ervery night with a cron job. I do this because we have many applications running and sometimes we need to simply clean the system. The cron job invokes a shell script which then starts tomcat with jsvc. Up to now this worked fine. But now tomcat does not restart again and I get this confusing error message: -catalina.out-- jsvc.exec error: Service exit with a return value of 143 Apr 5, 2006 12:45:00 AM org.apache.catalina.startup.Catalina load WARNING: Can't load server.xml Either permission problem or CATALINA_HOME not set. --shell-script JAVA_HOME1=/usr/local/jdk1.5.0_04 CATALINA_HOME=/usr/local/jakarta-tomcat-5.5.9 DAEMON_BIN=/usr/local/jakarta-tomcat-5.5.9/bin/jsvc TOMCAT_USER=root TMP_DIR=/var/tmp CATALINA_OPTS=-Xmx2048m -Xms1536m CLASSPATH=/usr/local/java/lib/tools.jar:\ $CATALINA_HOME/bin/commons-daemon.jar:\ $CATALINA_HOME/bin/bootstrap.jar case $1 in start) # # Start Tomcat # $DAEMON_BIN \ -user $TOMCAT_USER \ -home $JAVA_HOME1 \ -Dcatalina.home=$CATALINA_HOME \ This should have done it. I'd check permissions. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PHP Servlet Fails in Tomcat 5.5.15-SOLVED
Hi all. Just one opinion, if it hasn't been said before. Do not mix Java and PHP. PHP is inherently thread un-safe. Basically the PHP code itself is, AFAIK, OK (thread safe), but all those myriads of 3rd-party libraries providing needed functionality to the myriads of PHP extensions can, and some are thread un-safe. In case you haven't noticed, most decent Linux distros disable multi-threaded MPMs in Apache, if you enable PHP in them. Well, if Apache feels unsafe with PHP around, how should you feel in Tomcat? I can understand why you would want to run PHP, a lot of freeware projects out there were written in PHP. Or, should I be more precise, in PHP+MySQL glued together. Perhaps you cannot afford to rewrite it all. But sometimes, it is worth it. Decision remains yours, but I would run PHP separately from TC, if at all possible. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Better JSP Performance with Opteron
--- Leon Rosenberg [EMAIL PROTECTED] wrote: Ok, my fault, read page and java in one sentence - map to Java Page - Java Server Page. Must be a circuit error in the brain. Anyway, does it mean, that a proper configured JVM on an opteron processor, will be significantly faster? Could be very interesting for caches... Leon On 4/3/06, Rainer Jung [EMAIL PROTECTED] wrote: Using large pages to eliminate TLB misses has nothing to do with the size of the objects. From the view of the operating system java heap is just a huge and continuous chunk of memory. Anything what's inside is managed by the JVM. But whenever the JVM needs to access an adress it needs to make an address calculation as described in the article. Once the needed adress translation tables do not fit into the TLB, performance gets bad. Since Java often uses a large and continuous heap it's a very good candidate for using large pages, saving entries in the Hmmm, Im not sure about this. I do agree that a page size too small will make a heavy use of CPU/OS internal structures, resulting in poor performance. OTOH, using a page size too big results in degradation of effectiveness of that processes working set. Suppose a whole block of 1 MB was out of the TLB or swapped out. Operating on a relatively small, well grouped memory region, would result in the whole 1 or 2 MB of memory be introduced into the active set, instead of just those smaller pages. Of course, having portions of your memory collect dust, could be a sign of poor programming, memory leaks and what not. You mileage may vary. Setting a page size to 2 MB may be a bit extreme. If it can be set to just one process and dynamically, or at least at startup, that would be coll. Somehow, I doubt this level of flexibility exists. You may spead up your JVM, but slow down the rest of the system. Again, YMMV. This should be put to a test. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload giving error: Stream ended unexpectedly
--- Manish Agrawal [EMAIL PROTECTED] wrote: Hi, I have a web applications using sturts framework. The application allow users to upload data files on server. The application is running on Apache Tomcat 5.0 server. I am using Commons File Upload 1.0 for uploading files. Struts has it's own File Upload, based on Commons. Why don't you use it? Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PHP Servlet Fails in Tomcat 5.5.15
*exception* java.io.IOException: null net.php.servlet.send(Native Method) net.php.servlet.service(servlet.java:207) net.php.servlet.service(servlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) This exception is not only generic, but it is also missing the cause. It is definitely generated in the JNI method, so you'd have to look in there. I then altered the servlet class to include some debugging info just prior to its invocation of the send method: send(request.getMethod(), request.getQueryString(), request.getRequestURI(), contextPath, request.getContentType(), request.getContentLength(), request.getRemoteUser(), display_source_mode ); Here is the result: request.getMethod() = GET request.getQueryString()= null request.getRequestURI()= /test.php contextPath = /home/gsl/tomcat/apache-tomcat-5.5.15/webapps/ROOT/test.php request.getContentType() = null request.getContentLength()= -1 request.getRemoteUser()= null display_source_mode = false This looks fine. The corresponding native method appears to be in servlet.c as: JNIEXPORT void JNICALL Java_net_php_servlet_send (JNIEnv *jenv, jobject self, jstring requestMethod, jstring queryString, jstring requestURI, jstring pathTranslated, jstring contentType, jint contentLength, jstring authUser, jboolean display_source_mode) I haven't written JNI code before, but I suspect that the first two args are just hidden info. that is typically passed to a native method, so I don't see a signature mismatch or anything else wrong here. The error would have been much different, in case of a signature mismatch. Alternatively, does anyone have any further ideas on what I could do to debug this further? A few other individuals posted this null IOException on the net, but no resolution was provided. Being such a generic error, their problem might not even be related to what I am experiencing. Well,... As I have said above, the exception is thrown in the native method, so you could go into the source of that method and see where it could throw an exception. Other than that, you could try building a different version of PHP, like 5.0 or 5.1 branch. Maybe they will fare better. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Performance Tuning on Tomcat 5.5.16 for site with 150,000 daily hits
--- Leon Rosenberg [EMAIL PROTECTED] wrote: On 3/27/06, Per Johnsson [EMAIL PROTECTED] wrote: Hi! One good thing you could do is make sure you have the APR installed (Apache Portal Runtime) apr.apache.org. APR = Apache Portable Runtime library Why??? Well, it can spead things up, making TC serve static pages faster. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat - Hibernate
--- Giorgio Clavelli [EMAIL PROTECTED] wrote: Hi, I'm not an exper at all, but I try to put my 2 cents. The fact that your app can connect successfully after the server restart, suggests that you should have your app's context.xml (or whatever it is called) not in the server.xml but in the correct location inside your app directories. I seem to have read, the correct location being under the META-INF directory and that Tomcat tries first to look for context in this dir and then use that one under server.xml. I hope expert user, will comfirm in one way or the other this understanding of your problem. As of TC 5.0 the prefered way of configuring a context (web application) is to use a XML context fragment file. That file will either be placed in ${CATALINA_HOME}/conf/${HOSTNAME}/${CONTEXT_NAME}.xml, if you're deploying from a directory or in ./META-INF/${CONTEXT_NAME}.xml, if it is a WAR file. That way, deploying of an app can be free from editing the server.xml. As for the original problem, that is NOT it. The fact that TC's restart picks up everything suggests that the config is OK. Or at least relatively OK. I think that TC will create a XML fragment for the app and it could be that *that* fragment is interfering with the deployment process. Since I can see nothing wrong with the config, I would advise the original poster to go the correct route. Create the config fragment, pack it into your WAR, clean up server.xml and try to deploy/undeploy/redeploy. It will have no effect on TC 4.x, if you're warried that you might be forced to use it some day, TC4 ignores that file (one question to the authoritative guys: will that dir be accessable? - a potential security hole). Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:forEach not working as expected
--- Reinhard Moosauer [EMAIL PROTECTED] wrote: Hi List, it seemed clear to me, that this construct: c:forEach items=${t.records} var=x ... (some inner logic) /c:forEach should be equivalent to this one: No. It is roughly equvalent to (see my corrections): % for (Iterator it=t.getRecords(); it.hasNext(); ) { for (Iterator it=t.getRecords().getIterator(); it.hasNext(); ) { String x = (String)it.next(); Object x = it.next(); % ... (some inner logic) % } % I said roughly, because it can handle arrays, too. But the forEach-version is not working as expected. What can be wrong? Here are some quite strange effects: 1. The iterators-method hasNext() is called twice for every iteration (ok: no problem, if the iterator is clean, but why?) This is normal. Try to locate the java code generated from that tag and see what it comes to. You'll see something educational. There is no while () loop. Just if () else logic. 2. The loop-body is executed after hasNext() returned false. But the next()-method is NOT called ?? That would be strange. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Apache 2.0.50 - Tomcat 5.0.28 - Mod_jk - .htaccess
There are any form of change the loading order or i would need reinstall apache. Re-intalling will do you no good. You'd still end up with the same Apache. Re-building it, would, but that can be quite a task. Finding a newer version, differently compiled, might also be a good idea. Anyway, I'm not sure what is the loading order of modules, but it appears that staically linked modules load after dynamically built ins. And you have no control over mod_access. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: get element by long name
--- Tony Smith [EMAIL PROTECTED] wrote: in my jsp, there is something like: html:text property=plateDetail.name value=${plateDetailEditForm.plateDetail.name} / How can I get this element in javascript? the following code does not work: var name = document.getElementByName(plateDetail.name).value; I think it is because there is a '.' in the name. Any idea? Get Element By Name goes for the HTML name, like h1, body, etc. For CSS and JavaScript access, you can use element ID, like this: html:text property=plateDetail.name value=${plateDetailEditForm.plateDetail.name} styleId=plateDetailName / script type=text/javascript !-- name = getElementById( plateDetailName ); alert( name.value ); //-- /script Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Startup Messages
In the catalina.out I stumbled over these entries. Feb 6, 2006 4:55:17 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jre1.5.0_06/lib/i386/client:/usr/java/jre1.5.0_06/lib/i 386:/usr/java/jre1.5.0_06/../lib/i386 Is it worthwhile installing the Apache Tomcat Native Lib, and where would I get it (probably somewhere beneath tomcat.apache.org)? This lib allows for better performance of the TCs connectors, which is good in production. You would have to build this library and for that you need ANSI CC (GCC will do), Autoconf, maybe something else. I don't intend to install a JDK on this box (where the NatLib is probably shipped with?) No, it is not shipped, it needs to be built and linked to libapr (Apache Portable Runtime library), a part of Apache web server packages (don't forget the development versions, too. since this shouldn't be a development box. JDK won't harm you, but it is a superset of JRE. Nix. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Asynchronous messaging in tomcat *
Leon Rosenberg wrote: On 1/27/06, Duan, Nick [EMAIL PROTECTED] wrote: Spawning your own threads in a web app is usually not recommended. Why? Well, you have to take care of them manually or some code has to do it. If forgotten, those threads can stop TC from shutting down properly. And that is just a tip of the proverbial iceberg. Nix. signature.asc Description: OpenPGP digital signature
Re: Encrypting/Protecting JSP/Struts source code (UNCLASSIFIED)
Rob Gregory wrote: Good comments, but how would you encrypt the config files when Struts needs these to run out code (hence before I can decrypt). While I personally prefer Cocoon over struts these are pretty much 'Sister' projects so the same solution would help me also. This is a valid question. You would have to override some of Struts functionality, locate where it loads config files and add a hook for decryption. Not a trivial task, but should not be impossible. The biggest issue with this is that by doing so, you're creating your own Struts port/branch and you would have to maintain it plus all upgrades. Switching over to a newer release of Struts would require you to build your Struts again, with the your changes. Not something I would recomend. And again, it is not impossible to crack. In my oppinion, it is not worth the time, unless your securtity requirements are really high. But then, the machine's security is probably more important than encrypting config files. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: css and images (stupid question?)
Kristian Rink wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all; playing around with tomcat in order to both learn using the package and create a small web site there, I'm currently left with a problem which, though probably being small (and not really related to tomcat), keeps bugging me: I'm trying to do the visual stuff of my jsp using a css style file, which is good, so far. Within the css file, I'm using images for backgrounds etc like that: background: #fff url(/images/bg_header_blau.jpg) no-repeat top left; My problem, right now, is where to put the images within the web application so they're actually found when displaying the page. Initially, I created a folder images within my web application and referred to the images using url(images/...) with relative path names, which didn't work. Also tried to place the images folder inside $CATALINA_HOME/webapps and then using absolute image urls (/image/...), which also didn't work. So, where's the magic? I've always been through some tougher moments with css and images while dynamically generating content, but right now I feel really helpless about that. Can someone enlighten me? Well, your basic problem is that relative paths will not work, since pages can be in different directories. Absolute path has one problem, your application can be deployed under different paths. That problem is easy to solve, HttpServletRequest.getContextPath() will give you the deployment path. Just paste it on your desired CSS location, like this: css.jsp --- ... background: #fff url(%= request.getContextPath() %/images/bg_header_blau.jpg) no-repeat top left; or, if you're using JSP 2.0 background: #fff url(${request.contextPath}/images/bg_header_blau.jpg) no-repeat top left; ... --- Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC Resource Configuration
Martin Dubuc wrote: I am defining a number of JNDI resources in the server.xml file in the GlobalNamingResources section. As part of defining JDBC resources in this section, the username and password attributes are specified. The password is specified as clear text. I am wondering if there are ways to encrypt the passwords used for the JDBC resources or if it is possible not Well, you have to give credentials someplace, server.xml seams like a good place to do it. It can be made unreadable by users other than tomcat. to define at all, but provide it in the Java sources instead. ??? Isn't that stupid? Sorry for lashing out, but one of the ideas of defining a JNDI resource IS the ability to move connection credentials, among other things, OUT of your source. Why would you want every developer on your team (including those 20 in India) to know your user/pass for the DB? What is the benefit? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Web-application and Tomcat icon
Caldarale, Charles R wrote: From: Anto Paul [mailto:[EMAIL PROTECTED] Subject: Re: Web-application and Tomcat icon On 11/29/05, Aladin Alaily [EMAIL PROTECTED] wrote: I would like to know how I can replace that icon with my own... or better yet, no put any icon at all. The icon displayed on the browser is favicon.ico that is in ROOT. You can replace it with your own icon. This is browser cuteness. If you run a packet trace [I'm doing almost anything tonight to avoid writing documentation], you'll see something like: GET /favicon.ico HTTP/1.1\r\n coming from the browser near the end of a page load (at least with Firefox). Besides replacing favicon.ico, you can also just delete it without harm other than having Firefox show a blank page icon instead. IE, of course, won't show anything other than its own logo, AFAIK. And the hilarious thing is that IE 5.5 introduced that Favourite Icon concept, I believe. It was taken out in 6.0. Talk about consistency... I mean, I know it is just bells and whistles, but it was kinda nice. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Tomcat install problem
Terry Allen wrote: at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:613) There can be two causes. Either there is a mismatch in TC and zour Servlet version (i.e. you are using TC 4.1 with a Servlet 2.4) or you have a Java bytecode mismatch (i.e. you are running on JDK 1.4 and you compiled your Servlet with JDK 1.5 or you're running TC 5.5). Nix. Hi again, Thanks for the reply - this is what a few people have said, but I'm no closer to the answer as yet - Martin's examination of the logs I emailed may assist. However, after updating to the latest Java resetting the version by doing a symlink, I now have a partially viewable homepage, but some images are not viewable, so I'm partially there in any case. All the links, such as docs, admin, manager etc... generate blank pages. Anything in the logs for this new setup? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Tomcat install problem
Terry Allen wrote: Anything in the logs for this new setup? Nix. Hi again, Okay, I've included the last log entries from a few logs as listed below - the other logs in that directory contain only information about startup notification etc... apologies if this is not the right way to post these: I'll tell what it looks like to me. localhost.2005-11-21.log - : Nov 21, 2005 7:31:40 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet default threw exception java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.setBufferSize(I)V This states that somebody is expecting interface HttpServletResponse to have that method, but the definition of that interface, loaded by the JVM does not have it. Looks like a mismatch between Servlet-API JARs of Tomcat and the code that was compiled to run in your web application. Since you are running TC 5.5.9 it makes the error rather mysterious. If your server platform is Linux, it could be that you have some old version of Servlet API JAR somewhere on the class path, poisoning your setup. I'm not sure how that's possible, but it is what I'd look for. SEVERE: An exception or error occurred in the container during the request processing java.lang.NoSuchMethodError: javax.servlet.ServletResponse.isCommitted()Z Again some mismatch in definitions. SEVERE: Allocate exception for servlet HTMLManager java.lang.NoSuchMethodError: javax.servlet.ServletConfig.getServletName()Ljava/lang/String; And again. I'm not sure what is going on, but look for old JARs poisoning your setup. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Tomcat install problem
Anthony Carlos wrote: Just out of curiosity, what is JAVA_HOME? JAVA_HOME is an environment variable, that should contain the path to the installed JDK or JRE. Since you're using TC 5.5, you can point JAVA_HOME to a JRE (5.5 comes with Eclipse Java Compiler). Older versions had to have a JDK (to compile JSP into Servlet classes). In UNIX, lookup your shell startup scripts (.profile, .login, .zprofile,...) and in Windows, right-click My Computer and choose Properties, Advanced. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Tomcat install problem
Terry Allen wrote: Hi again, Out of that Catalina.out log I mentioned earlier, the last few log lines read like so: INFO: Stopping Coyote HTTP/1.1 on http-8080 Nov 20, 2005 7:24:02 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 20, 2005 7:24:02 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 2041 ms Nov 20, 2005 7:24:02 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 20, 2005 7:24:02 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.9 Nov 20, 2005 7:24:02 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Nov 20, 2005 7:24:05 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 20, 2005 7:24:05 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Nov 20, 2005 7:24:05 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/43 config=null Nov 20, 2005 7:24:05 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Nov 20, 2005 7:24:05 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 3476 ms Nov 21, 2005 7:23:34 AM org.apache.catalina.connector.CoyoteAdapter service SEVERE: An exception or error occurred in the container during the request processing java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.isCommitted()Z at org.apache.catalina.connector.Request.doGetSession(Request.java:2192) at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2150) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:230) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:613) There can be two causes. Either there is a mismatch in TC and zour Servlet version (i.e. you are using TC 4.1 with a Servlet 2.4) or you have a Java bytecode mismatch (i.e. you are running on JDK 1.4 and you compiled your Servlet with JDK 1.5 or you're running TC 5.5). Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sharing webapps between linux and windows on single computer
Dhaval Patel wrote: My question is, is it possible to put only webapps on P_FAT32 while tomcat install files are in P_NTFS and P_RES and configured tomcat to read P_FAT32 webapps directory as appbase in host node of server.xml? Have anyone done anything like this before? Only thing I am confused of end of line character since it is different in windows and linux for any file. I mean can it work? I am going to try it but if anyone had done something like this, please guide me. Of course. For each VirtualHost in TC (including localhost), you can define appBase directory. Just let it point to your P_FAT32. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use of JSF view in welcome file list
Tim Dean wrote: Hello, I am trying to configure a welcome file list in my Tomcat-deployed web app so that a Java Server Faces (JSF) view is used as the welcome file. My web.xml file contains the following: welcome-file-list welcome-filemain.faces/welcome-file /welcome-file-list As well as the following JSF servlet configurations: servlet servlet-nameFacesServlet/servlet-name servlet-classjavax.faces.webapp.FacesServlet/servlet-class /servlet servlet-mapping servlet-nameFacesServlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping I have been unable to get this working no matter what I have tried. Whenever I request a directory within the web application's context, Tomcat shows a directory listing instead of the JSF view I've identified in the welcome file list. Well, the problem is in the fact that a list of welcome files is just that, a list of FILES. So, when a URL is requested which is a directory, a list of welcome files will be looked up in that dir, in the given order. What you gave was an incomplete Servlet URL mapping and that simply will not do for a welcome file list. Perhaps you could try to setup a different mapping, like servlet-mapping servlet-nameFacesServlet/servlet-name url-pattern*//url-pattern /servlet-mapping This might clash with directory URL mapping, which should be more internal to TC. Or is it handled by the Default Servlet? In that case, it would be OK, since this mapping is less general than *. Also, note that FacesServlet might not handle this properly, expecting the URL to point to some file/path/identifier (I know how Struts would see it...) and this might require additional setup in JSF config file (mapping that URL to appropriate component). Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unix socket communications on Tomcat 5.5
Bill Barker wrote: Currently mod_jk doesn't support unix sockets (ditto for mod_proxy_ajp :). To use unix sockets currently, you must use (the currently unsupported) mod_jk2. However, there is some intial support for them in the new APR Connector. It's not complete (and so not usable :), but it's possible that some future version of mod_jk/Tomcat will support this. I'm sad to hear that. The story of mod_jk/mod_jk2 succession was that all nifty features of mod_jk2 will be ported to mod_jk. I must say I have UNIX socket on mod_jk2 in a Mandrake 9.1 Linux Apache 2.0, TC 4.1.24 and it is working without a glitch. I haven't stress tested it, though. Can anyone comment on the need for a UNIX socket? The basic idea was that UNIX socket is faster, but with the advance of kernels, is net socket communication that burdening? OK, on a busy server, it could profitable to lay off as much traffic off the network stack, as possible. Can someone give insight? Currently, I have mod_jk2 in a good working condition and I have access to both mod_jk2 and mod_jk. I'm not about to switch to mod_jk, just for switching's sake. On the other hand, I'm not going to stick to obsoleted softrware, either. So, I'm waiting (patiently) for expert opinion. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unix socket communications on Tomcat 5.5
Oliver Hookins wrote: I've been trying to find some decent documentation on setting up Tomcat to communicate with mod_jk2 and Apache over unix sockets. So far what I've found suggests I only need to alter jk2.properties with details of the socket, and workers2.properties with the same details. I've done this and restarted Tomcat and it still appears to be creating the TCP/IP socket on port 8009, but not creating any unix socket file. Has anyone got a working Tomcat 5.5 mod_jk2 configuration using Unix sockets I'd love to know what you did to set it up. Hmm, well, there are several things to consider. First, in order to use UNIX socket, you need to have and link JNI library specially built for your OS. UNIX sockets are not a part of Java world and to use them you need JNI library which is a part of mod_jk2 source distribution. You'll also need Apache-Dev RPMs or libapr+libaprutil, if I recall correctly. Then you need something like this (this is from my 4.1.24) jk2.config -- apr.NativeSo=/usr/lib/apache2-extramodules/jkjni.so handler.list=apr,request,channelUnix channelUnix.file=${jkHome}/work/tomcat.sock request.tomcatAuthentication=false workers2.properties - [logger] level=DEBUG [config:] debug=0 debugEnv=0 [uriMap:] info=Maps the requests. Options: debug debug=0 # Alternate file logger [logger.file:0] level=DEBUG file=/var/log/httpd/mod_jk2.log [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/var/run/jk2.shm size=100 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 [channel.un:unixsock] info=Main socket to Tomcat engine file=/var/tomcat4/work/tomcat.sock [status:] info=Status worker, displays runtime informations [ajp13:unixsock] info=Default AJP 1.3 worker channel=channel.un:unixsock [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:www.elektrovojvodina.co.yu/racun] info=Uvid u racun potrosaca group=ajp13:unixsock #context=/racun It should be very similar to mod_jk. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help ! configure Tomcat 5.5.12 and Eclipse 3.1 for debugging
Sara Hugh wrote: Please help me out !! I try to setup debugging on tomcat 5.5.12 and Eclipse 3.1. For Eclipse, the setting is same as previous version, but for Tomcat 5.5.12, the script file for windows (catalina.bat) does not exist. How do I set JPDA_TRANSPORT and other values for tomcat 5.5.12 for debugging? Does anyone have done that for the tomcat 5.5.12? I have installed Eclipse 3.1 - Web Tools Project 0.7 bundle and it can run TC in debug mode, no problem. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]