Re: determining which jdk tomcat is using
How are you starting Tomcat? Are you on a windows machine? The environment settings set in the System properties on NT/2000/XP don't affect already running cmd.exe windows. If you REALLY want control over a specific Tomcat instance, modify your catalina.bat/catalina.sh file to define a specific JAVA_HOME variable (right under the header comment block). The environment settings may impact other applications, so I always shy away from that. Good luck. - Original Message - From: KIESEL,JEFF (HP-NewJersey,ex2) [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:37 AM Subject: RE: determining which jdk tomcat is using strange, tomcat still doesnt use use the jdk i specified in JAVA_HOME. i have 1.4 and 1.3 installed on my machine. i need tomcat to use 1.3, as defined in my environment variables. anyone have any ideas as to why it would still be using 1.4? -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:25 AM To: Tomcat Users List Subject: RE: determining which jdk tomcat is using Run the manager application - it lists the JVM version. -Original Message- From: KIESEL,JEFF (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED] Sent: 24 March 2003 15:15 To: '[EMAIL PROTECTED]' Subject: determining which jdk tomcat is using hi all, i have multiple jdks installed on my machine(win2k). i have my JAVA_HOME environment variable set to the JDK want to use, and this is reflected in my Path environment variable as well. how can i be sure tomcat is using the jdk i want it to? is there a way to get tomcat to output this information? thanks, ~jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: determining which jdk tomcat is using
Are you setting user environment variables or system environment variables when you change JAVA_HOME? I think the NT service will use the system environment, since it's not necessarily associated with a user. Anyway, I would recommend against using the service actually. The batch files used to start/stop tomcat are simple to run and I have to restart A LOT. Good luck! - Original Message - From: KIESEL,JEFF (HP-NewJersey,ex2) [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:59 AM Subject: RE: determining which jdk tomcat is using i've been running tomcat as an nt service, on a win 2k machine. i'll try modifying the cataline.bat script. i comtemplated doing this before, but it just seems there was something i was missing, a better way to do this. -Original Message- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:48 AM To: Tomcat Users List Subject: Re: determining which jdk tomcat is using How are you starting Tomcat? Are you on a windows machine? The environment settings set in the System properties on NT/2000/XP don't affect already running cmd.exe windows. If you REALLY want control over a specific Tomcat instance, modify your catalina.bat/catalina.sh file to define a specific JAVA_HOME variable (right under the header comment block). The environment settings may impact other applications, so I always shy away from that. Good luck. - Original Message - From: KIESEL,JEFF (HP-NewJersey,ex2) [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:37 AM Subject: RE: determining which jdk tomcat is using strange, tomcat still doesnt use use the jdk i specified in JAVA_HOME. i have 1.4 and 1.3 installed on my machine. i need tomcat to use 1.3, as defined in my environment variables. anyone have any ideas as to why it would still be using 1.4? -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 9:25 AM To: Tomcat Users List Subject: RE: determining which jdk tomcat is using Run the manager application - it lists the JVM version. -Original Message- From: KIESEL,JEFF (HP-NewJersey,ex2) [mailto:[EMAIL PROTECTED] Sent: 24 March 2003 15:15 To: '[EMAIL PROTECTED]' Subject: determining which jdk tomcat is using hi all, i have multiple jdks installed on my machine(win2k). i have my JAVA_HOME environment variable set to the JDK want to use, and this is reflected in my Path environment variable as well. how can i be sure tomcat is using the jdk i want it to? is there a way to get tomcat to output this information? thanks, ~jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBCRealm w/ Apache, How to???
The real question is how big of a performance problem is the DefaultServlet in Tomcat compared to Apache. Are you REALLY losing THAT much performance by letting the DefaultServlet serve those static files? Is it necessary? - Original Message - From: Mete Kural [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 24, 2003 3:20 AM Subject: JDBCRealm w/ Apache, How to??? Hi, I am perplexed at this interesting problem. We want to use JDBCRealm to authenticate users in Tomcat, but yet we want to serve static stuff via Apache to improve performance (we have a lot of static material behind authentication). If we set up Tomcat as a worker for Apache using the JK2 connector, I don't see how requests for static files are going to be authenticated via JDBCRealm, since Tomcat doesn't even know about these static requests in the first place due to the fact that Apache handles them right away without dispatching them to Tomcat. I'm thinking that if we could somehow set up Apache to be a worker for Tomcat, and Tomcat received all requests and dispatched those that are static to Apache, then all requests would be authenticated via JDBCRealm. But I don't know how to do that neither if this is possible at all. Do you have any ideas on how to authenticate every request with JDBCRealm yet serve only static stuff with Apache. Thanks, Mete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Managing Tomcat-USers im my own Application
I would recommend using a different file for that, but still using a MemoryRealm with the same file format. Other than that, you can manage the file anyway you want, but you have to worry about concurrent edits, as it is just a file on the file system. - Original Message - From: Robert Einsle [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 24, 2003 3:02 PM Subject: Managing Tomcat-USers im my own Application Hy list i will manage Users im my application for the Login-Authentication for the Application, and therefore i will manage the tomcat-users.xml im my application. Is it possible to manage the users-File out of an tomcat-Application like the admin-page?? Where can i find an Howto to do it?? Thanks a lot. \Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Managing Tomcat-USers im my own Application
Remember, also, that the MemoryRealm will not pick up your changes to the XML file until restart. - Original Message - From: Robert Einsle [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 24, 2003 3:02 PM Subject: Managing Tomcat-USers im my own Application Hy list i will manage Users im my application for the Login-Authentication for the Application, and therefore i will manage the tomcat-users.xml im my application. Is it possible to manage the users-File out of an tomcat-Application like the admin-page?? Where can i find an Howto to do it?? Thanks a lot. \Robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Bookmarking a Login Page
The way I always do it is I create a User (with email, fullName, etc.) class which is mapped into my database to the same tables I instruct Tomcat to use for a JdbcRealm. Then, I set up a filter which makes sure that a User object exists when there is a user principal. You can use the request.getUserPrincipal().getName() to find out the username of the logged in user. In your filter, you do something like... User user = ( User )request.getSession().getAttribute( user ); if( user == null request.getUserPrincipal() != null ) { user = UserDao.getUserByName( request.getUserPrincipal().getName() ); request.setAttribute( user, user ); } Hope this helps! - Original Message - From: Mike Duffy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 8:10 AM Subject: Problem with Bookmarking a Login Page Does anyone know of a Struts work around for the problem with Tomact in bookmarking the login page for container managed security? There was a brief thread on this issue about a month ago [http://www.mail-archive.com/[EMAIL PROTECTED]/msg59734.html] There is a SourceForge project called SecurityFilter that can be used to replace Tomcat's container managed security, but it would be nice to be able to work with Tomcat. Has anyone tried to call j_security_check directly from an Action class? Once you can authenticate a user you would be able to get the roles for that user. Is there a way to set up a JDBC Realm purely in Struts? I did not see any information on this in a quick scan of the documentation. Hopefully, the good people working on Tomcat see this as a bug that needs to be fixed. Quote from a recent thread in the Tomcat news group: I wish that there was a legitimate configuration change to enable you to bookmark a login.jsp page--such as a j_success_url parameter which instructs Tomcat where to send users if not doing an automated login process. Another user stated, ...I simply just can't believe that there are Tomcat instances out there in a live production environment with configured realms that suffer from this problem. Surely there must be something http://www.mail-archive.com/[EMAIL PROTECTED]/msg77974.html Thanks. Mike __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Servlets
Yes, you do need to provide a servlet mapping for each of your servlets you wish to run, unless you want to run the invoker servlet (not recommended). Usually you map a different url pattern for each servlet in your webapp. This can be somewhat tedious, so I use XDoclet to generate my web.xml file for me! But, for simple projects, this is not necessary. - Original Message - From: Jeff Brewer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:46 PM Subject: Re: Help with Servlets Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Servlets
Oh, yes the order matters how you define things in your web.xml file. It has to follow the DTD. - Original Message - From: Jeff Brewer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:46 PM Subject: Re: Help with Servlets Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: load-on-startup order
Instead of performing the necessary logic in the init method, why not try lazy-loading. Only initialize whatever you need when it is requested the first time. By the way, what are you trying to do? I've never heard of anyone having this kind of requirement/architecture. Just curious. - Original Message - From: Mayne, Peter [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:42 PM Subject: load-on-startup order Tomcat 4.1.18 I have two applications, A and B, where a servlet in B depends on a servlet in A being up, so I have in A's web.xml: servlet ... load-on-startup1/load-on-startup /servlet in B's web.xml: servlet ... load-on-startup5/load-on-startup /servlet which should make A start first. However, when Tomcat starts, B's init() is called first. B's init() attempts to make a connection to A's servlet, but A hasn't started yet, so everything hangs. Am I doing this correctly? Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Manager App Not Working
I just upgraded to the 4.1.24 Stable release. I had a project that I had been deploying via Ant in 4.1.18 that I decided to try deploying in the new version. However, the Manager app didn't like the format of my webapp war file parameter. It tried appending the value to the path to the webapps directory. Did something break? Do I have to do it differently now? James Carman, President Carman Consulting, Inc. 1218 Bob White Ct. Edgewood, KY 41018 (513) 325-7977 smime.p7s Description: S/MIME cryptographic signature
Re: custom JDBCRealm
You don't need to implement a custom realm for this. You can use a servlet filter. The userid of the currently logged in user can be accessed via request.getUserPrincipal().getName(). You can use this information to lookup the other user data in the database and place it in the session (if it doesn't already exist). - Original Message - From: Bill Barker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 22, 2003 11:45 PM Subject: Re: custom JDBCRealm In theory, common/{classes, lib} should work, but I've never tried it. shared/{classes, lib} won't work, and WEB-INF/{classes, lib} should fail as well. Actually, re-reading closer, you have to put your class in server/{classes, lib}. Otherwise the classloader won't be able to find the FormAuthenticator base class. My custom Authenticator (installed in server/lib) is working like a charm :-). Carl Maib [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] bill, i have tried placing my source in common/classes, common/lib, shared/lib and shared/classes with no luck. depending on where i put my class, it was either in a Jar as part of a package, or just a stand-alone class. i am really baffled here, it seems like one of those solutions should have worked. yet, i continue to get the NoClassDefFound error for the catalina class i am overriding (FormAuthenticator). i know i am a newbie to tomcat, so perhaps i am missing something simple. if anyone has had any luck overriding any of the catalina classes in their webapp and has had some success actually running it, please lend a hand! thanks! Bill Barker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Carl Maib [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i am attempting the exact same thing, but have been advised it would be better to override the FormAuthenticator. this gives you direct access to the session. the solution seems perfect, however, i i can't seem to get past classNotFound exceptions. i am not familiar with how to link catalina classes and the Class Loader docs are not giving me the answer. i have configured server.xml to contain my custom valve, the class which overrides FormAuthenticator. i have placed this class in common/classes. i get class not found exceptions on FormAuthenticator bcz my webapp is not able to reference the necessary objects in catalina.jar. It needs to be in server/classes, so that it can see the Catalina classes. please let me know if you get this solution to work. thanks! - Original Message - From: awc [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Friday, March 21, 2003 4:41 PM Subject: Custom JDBCRealm Hi, I want to add more stuff to user session while user logs in. The only way I see to do this is to write custom JDBCRealm class which extnds org.apache.catalina.realm.JDBCRealm or implement org.apache.catalina.realm.RealmBase class. This custom class will have more initializing parameters too. Any thoughts on this from one who already did sort of thing?? I am going to use this one with securityFilere from www.securityfilter.org. Thank you in advance for any replies. .anil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access a servlet without servlet-mapping
By default, in Tomcat 4.x, the servlet mapping for the invoker servlet (the one that serves requests starting with /servlet) is commented out. You can uncomment it in tomcat home/conf/web.xml and it will be turned on. Then, your first URL should work. - Original Message - From: David Thielen [EMAIL PROTECTED] To: Tomcat Users [EMAIL PROTECTED] Sent: Saturday, March 22, 2003 6:27 PM Subject: How to access a servlet without servlet-mapping Hi; How do I access a servlet without using servlet-mapping? I know servlet-mapping makes sense but I want to understand the other URI and everything I try doesn't make sense: servlet: webapp/WEB-INF/classes/ReportSales.jave web.xml: servlet servlet-nameSalesReport/servlet-name servlet-classReportSales/servlet-class /servlet The following all failed: http://localhost:8080/WindwardReportsServlet/servlet/ReportSales http://localhost:8080/WindwardReportsServlet/servlet/SalesReport http://localhost:8080/WindwardReportsServlet/ReportSales http://localhost:8080/WindwardReportsServlet/SalesReport any ideas? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access a servlet without servlet-mapping
By the way, I wouldn't recommend leaving it turned on, as it presents a security risk. If you place a security constraint on a servlet based on its servlet mapping, users will be able to bypass that security constraint by using the invoker servlet to invoke your servlet. - Original Message - From: James Carman [EMAIL PROTECTED] To: Tomcat Users [EMAIL PROTECTED] Sent: Saturday, March 22, 2003 11:48 PM Subject: Re: How to access a servlet without servlet-mapping By default, in Tomcat 4.x, the servlet mapping for the invoker servlet (the one that serves requests starting with /servlet) is commented out. You can uncomment it in tomcat home/conf/web.xml and it will be turned on. Then, your first URL should work. - Original Message - From: David Thielen [EMAIL PROTECTED] To: Tomcat Users [EMAIL PROTECTED] Sent: Saturday, March 22, 2003 6:27 PM Subject: How to access a servlet without servlet-mapping Hi; How do I access a servlet without using servlet-mapping? I know servlet-mapping makes sense but I want to understand the other URI and everything I try doesn't make sense: servlet: webapp/WEB-INF/classes/ReportSales.jave web.xml: servlet servlet-nameSalesReport/servlet-name servlet-classReportSales/servlet-class /servlet The following all failed: http://localhost:8080/WindwardReportsServlet/servlet/ReportSales http://localhost:8080/WindwardReportsServlet/servlet/SalesReport http://localhost:8080/WindwardReportsServlet/ReportSales http://localhost:8080/WindwardReportsServlet/SalesReport any ideas? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat servlet invoker
You should not use the invoker servlet. You should set up servlet mappings in your web.xml file for your servlets. - Original Message - From: Boon Seong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 6:01 AM Subject: tomcat servlet invoker Hi, With reference to the documentation at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.21-beta/REL EASE-NOTES , on the section Enabling invoker servlet, there is this note - Using the invoker servlet in a production environment is not recommended and is unsupported. - Wonder what we should use for servlet invokation for a production environment ? Thanks. nbs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat servlet invoker
Yes, you must create a servlet mapping for each servlet. You could use XDoclet to generate your web.xml file, which can alleviate some of the burden and maintenance overhead. - Original Message - From: Boon Seong [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 6:59 AM Subject: Re: tomcat servlet invoker What will be used to invoke the servlet then ? The servlet mapping is one to one. What happen if I have a lot of servlets ? The 1 to 1 mapping may cause some maintainance problem. Thanks. NBS - Original Message - From: James Carman [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:01 AM Subject: Re: tomcat servlet invoker You should not use the invoker servlet. You should set up servlet mappings in your web.xml file for your servlets. - Original Message - From: Boon Seong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 6:01 AM Subject: tomcat servlet invoker Hi, With reference to the documentation at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.21-beta/REL EASE-NOTES , on the section Enabling invoker servlet, there is this note - Using the invoker servlet in a production environment is not recommended and is unsupported. - Wonder what we should use for servlet invokation for a production environment ? Thanks. nbs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP bodycontent?
Does Tomcat support the JSP body content for a BodyTag? In my doAfterBody method (inherited from BodyTagSupport), I return EVAL_BODY_TAG. I have some debug statements in my code, so I can see that the doAfterBody method is called multiple times, but I'm not seeing the html that should be generated by my JSP code within the tag's body. Can somebody help me? Here's my Java code... package ws.carman.taglib; import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.Iterator; import java.util.Collection; import javax.servlet.ServletRequest; public class IterateTag extends BodyTagSupport { private String m_CollectionName; private String m_ElementName; private Iterator m_Iterator; public final void setCollectionName( final String newCollectionName ) { m_CollectionName = newCollectionName; } public final void setElementName( final String newElementName ) { m_ElementName = newElementName; } public final int doStartTag() { final ServletRequest request = pageContext.getRequest(); final Collection coll = ( Collection )request.getAttribute( m_CollectionName ); m_Iterator = coll.iterator(); return doNext(); } public final int doAfterBody() { System.out.println( "Inside doAfterBody!" ); return doNext(); } private final int doNext() { if( m_Iterator.hasNext() ) { pageContext.getRequest().setAttribute( m_ElementName, m_Iterator.next() ); System.out.println( "Current element is " + pageContext.getRequest().getAttribute( m_ElementName ) ); return EVAL_BODY_TAG; } else { return SKIP_BODY; } } public void release() { m_ElementName = null; m_CollectionName = null; m_Iterator = null; } } * Here's the tag library descriptor file... ?xml version="1.0" encoding="ISO-8859-1" ? !DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd" !-- a tag library descriptor -- taglib tlibversion1.0/tlibversion jspversion1.1/jspversion shortnamecarman/shortname uri/uri info/info bodycontentJSP/bodycontent tag nameiterate/name tagclassws.carman.taglib.IterateTag/tagclass infoIterates throug a named collection/info attribute namecollectionName/name requiredtrue/required /attribute attribute nameelementName/name requiredtrue/required /attribute /tag /taglib *** And finally, here's my JSP... HTML HEAD TITLEIterator Example/TITLE /HEAD %@ page import="java.util.*" % %@ taglib uri="taglib/iterate.tld" prefix="carman" % % final String[] listElements = new String[] { "Hello", "World", "How", "Are", "You" }; final List list = Arrays.asList( listElements ); request.setAttribute( "list", list ); % BODY Before Tag!BR carman:iterate collectionName="list" elementName="element" The current element is %=request.getAttribute( "element" )%BR /carman:iterate After Tag!BR /BODY /HTML
RE: JSP bodycontent?
I copied this out of the documentation of the BodyTagSupport class' doAfterBody method... "Actions after some body has been evaluated. Not invoked in empty tags or in tags returning SKIP_BODY in doStartTag() This method is invoked after every body evaluation. The pair "BODY -- doAfterBody()" is invoked initially if doStartTag() returned EVAL_BODY_TAG, and it is repeated as long as the doAfterBody() evaluation returns EVAL_BODY_TAG" So, it seems that the pair "BODY -- doAfterBody()" will be invoked so long as doAfterBody returns EVAL_BODY_TAG, and in my example, it does execute the correct number of times (5 in my case, one for each String object in the collection). The only issue is that it's not actually executing the JSP code inside the tag. It's iterating correctly, but not actually doing the work inside the body of the tag. Has anyone else seen this? -Original Message- From: Jeff Turner [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 09, 2000 10:43 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: JSP bodycontent? On Sat, 9 Dec 2000, James Carman wrote: Does Tomcat support the JSP body content for a BodyTag? In my doAfterBody method (inherited from BodyTagSupport), I return EVAL_BODY_TAG. I have some You must return EVAL_BODY_TAG in your doStartTag() method, not doAfterBody(). Have a look at the jakarta-taglibs project for some nice examples, in particular /utility/src/org/apache/taglibs/utility/basic/IncludeTag.java As an aside, I noticed that JRun does not comply with the spec and call setBodyContent on empty tags like util:include url="foo.html"/. You have to trick it by saying util:include url="foo.html"/util:include. This means that some jakarta-taglibs taglibs won't work under JRun. This isn't fixed in SP1, so watch out for it if you ever have to port to JRun. --Jeff debug statements in my code, so I can see that the doAfterBody method is called multiple times, but I'm not seeing the html that should be generated by my JSP code within the tag's body. Can somebody help me? Here's my Java code... package ws.carman.taglib; import javax.servlet.jsp.tagext.BodyTagSupport; import java.util.Iterator; import java.util.Collection; import javax.servlet.ServletRequest; public class IterateTag extends BodyTagSupport { private String m_CollectionName; private String m_ElementName; private Iterator m_Iterator; public final void setCollectionName( final String newCollectionName ) { m_CollectionName = newCollectionName; } public final void setElementName( final String newElementName ) { m_ElementName = newElementName; } public final int doStartTag() { final ServletRequest request = pageContext.getRequest(); final Collection coll = ( Collection )request.getAttribute( m_CollectionName ); m_Iterator = coll.iterator(); return doNext(); } public final int doAfterBody() { System.out.println( "Inside doAfterBody!" ); return doNext(); } private final int doNext() { if( m_Iterator.hasNext() ) { pageContext.getRequest().setAttribute( m_ElementName, m_Iterator.next() ); System.out.println( "Current element is " + pageContext.getRequest().getAttribute( m_ElementName ) ); return EVAL_BODY_TAG; } else { return SKIP_BODY; } } public void release() { m_ElementName = null; m_CollectionName = null; m_Iterator = null; } } * Here's the tag library descriptor file... ?xml version="1.0" encoding="ISO-8859-1" ? !DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd" !-- a tag library descriptor -- taglib tlibversion1.0/tlibversion jspversion1.1/jspversion shortnamecarman/shortname uri/uri info/info bodycontentJSP/bodycontent tag nameiterate/name tagclassws.carman.taglib.IterateTag/tagclass infoIterates throug a named collection/info attribute namecollectionName/name requiredtrue/required /attribute attribute nameelementName/name requiredtrue/required /attribute /tag /taglib *** And finally, here's my JSP... HTML HEAD TITLEIterator Example/TITLE /HEAD %@ page import="java.util.*" % %@ taglib uri="taglib/iterate.tld" prefix="carman" % % final String[] listElements = new String[] { "Hello", "World", "How", "Are", "You" }; final List list = Arrays.asList( listElements ); request.setAttribute( "l