RE: where to put tag libraries
No. I understand the original question was about making the taglibs available to all the web apps, not just one, right? If you put the jar under a WEB-INF/lib then it will be available only to the web app to which that WEB-INF belong. As far as I can tell, to share the jar with all the applications you should put it under $TOMCAT_HOME/lib. The tld file itself seems to have to be somewere under the application's directory (the parent of WEB-INF) since the in the web.xml interprets it in relation to that root of the web app. See the JSP 1.1 spec sections 5.2.2 and 5.3.1 (and around). Cheers, --Amos -Original Message- From: Peter Choe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 14, 2001 5:04 PM To: [EMAIL PROTECTED] Subject: Re: where to put tag libraries so, something like: $TOMCAT_HOME/WEB-INF/lib or $TOMCAT_HOME/webapps/foobar/WEB_INF/lib if i just put the class files in the $TOMCAT_HOME/lib, i just need to alter the web.xml and put the taglibs in the $TOMCAT_HOME/webapps/foobar/WEB-INF? each webapps needs to have the taglib.tld in its WEB-INF directory? peter choe Dmitri Colebatch wrote: > > Amos Shapira wrote: > > The class files themself are just like any other library - under > > Tomcat's lib or anywere in the standard JAva classpath. > a more appropriate place might be considered to be WEB-INF/lib - that > way they will not affect anything outside the context they are deployed > for. > > cheers > dim > > > > > -Original Message- > > From: Peter Choe [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, June 14, 2001 3:00 PM > > To: [EMAIL PROTECTED] > > Subject: where to put tag libraries > > > > where can i put a taglib jar file so that all the applications can use > > it? > > > > peter choe
RE: where to put tag libraries
The class files themself are just like any other library - under Tomcat's lib or anywere in the standard JAva classpath. -Original Message- From: Peter Choe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 14, 2001 3:00 PM To: [EMAIL PROTECTED] Subject: where to put tag libraries where can i put a taglib jar file so that all the applications can use it? peter choe
RE: httprequest fired twice
Title: [JBoss-user] httprequest fired twice I'm not 100% sure, but I read somewere a few weeks ago that the browser might fire two separate HTTP request under some conditions. As far as I remember, this isn't a bug. Try sniffing the net, maybe? -Original Message-From: Jee-Meng Ang [mailto:[EMAIL PROTECTED]]Sent: Thursday, June 14, 2001 3:04 PMTo: Tomcat-User Mailing ListSubject: httprequest fired twice Just wondering whether anyone faced the problem of Jboss / Tomcat combination firing two HTTPRequest events from MS Internet Explorer? Regards, Jee Meng.
RE: Tomcat hangs if I refer to a context that doesn't exist
It's a known problem with 3.2.1, upgrade to 3.2.2. Worked for me so far... Cheers, --Amos -Original Message-From: Jeff Trent [mailto:[EMAIL PROTECTED]]Sent: Wednesday, June 13, 2001 7:40 AMTo: [EMAIL PROTECTED]Subject: Tomcat hangs if I refer to a context that doesn't exist If I refer to a nonexistant webapp, I find that Tomcat pins my CPU (doesn't really hang). I need to stop tomcat and restart for the CPU to return to normal. I couldn't find any information on this problem in the archives. Anybody else see this or know what the problem might be? I'm using 3.2.1 on NT2000. thanks, jeff
RE: jsps and servlets in same context?
Look at tomcat's logs, for a start -Original Message- From: Burkard Endres [mailto:[EMAIL PROTECTED]] Sent: Monday, June 11, 2001 1:40 PM To: [EMAIL PROTECTED] Subject: AW: jsps and servlets in same context? i have followed your instructions but it doesn't work the Webbrowser tells me that he could not find the page -Ursprüngliche Nachricht- Von: Amos Shapira [mailto:[EMAIL PROTECTED]] Bereitgestellt: Montag, 11. Juni 2001 12:14 Bereitgestellt in: tomcat-user Unterhaltung: jsps and servlets in same context? Betreff: RE: jsps and servlets in same context? You should map url's to your servlets. See the and tags in web.xml, e.g.: login com.yourcompany.LoginServlet login /login The .class file have to be under WEB-INF/classes or in a JAR under WEB-INF/lib -Original Message- From: Burkard Endres [mailto:[EMAIL PROTECTED]] Sent: Monday, June 11, 2001 12:58 PM To: [EMAIL PROTECTED] Subject: jsps and servlets in same context? Hi i want my servlets and my jsps be served out of the same directory. this means: the servlet shoud be mapped to a folder so that they are accessible via: /myfolder/myservlet the jsps should also be accessible via /myfolder/myjsp.jsp if i copy the jsps in the /myfolder/... it works if i provide the full path to the jsps but if i access only /myfolder/ i recieve a directorylisting where i can download my jsps in sourcecode and this is of course not acceptable. Kind regards Burkard Endres i-te systems GmbH Wilhelm-Dahl-Strasse 16 97082 Wuerzburg Germany
RE: jsps and servlets in same context?
You should map url's to your servlets. See the and tags in web.xml, e.g.: login com.yourcompany.LoginServlet login /login The .class file have to be under WEB-INF/classes or in a JAR under WEB-INF/lib -Original Message- From: Burkard Endres [mailto:[EMAIL PROTECTED]] Sent: Monday, June 11, 2001 12:58 PM To: [EMAIL PROTECTED] Subject: jsps and servlets in same context? Hi i want my servlets and my jsps be served out of the same directory. this means: the servlet shoud be mapped to a folder so that they are accessible via: /myfolder/myservlet the jsps should also be accessible via /myfolder/myjsp.jsp if i copy the jsps in the /myfolder/... it works if i provide the full path to the jsps but if i access only /myfolder/ i recieve a directorylisting where i can download my jsps in sourcecode and this is of course not acceptable. Kind regards Burkard Endres i-te systems GmbH Wilhelm-Dahl-Strasse 16 97082 Wuerzburg Germany
RE: /lib & /WEB-INF/lib
Hi, There is also the matter of whether you want the code (and data) to be shared among the web apps or not. For instance, we have a base servlet class which holds some static variables which are ment to be used as "application-wide" variables (e.g. logging configuration), and two web applications. If that servlet class was in the shared library then the static variables would have been shared among the applications as well, but we don't want that so we put it under the application's WEB-INF/class directory, like the rest of the code. On the other hand, due to a bug in JDK 1.2.2, JNI classes cannot be loaded by "custom class loaders" (hope I remember the right term), so we HAD to put our JNI file locking class under the shared directory. This (putting the JNI file locking class under a shared directory) also solved another problem - we actually WANTED to share the list of locked files under Solaris since Solaris locks a file per-process (i.e. per the iPlanet process under which the servlet engine runs) so we have to manage a list of the files locked by that process - and so we wanted a single list accessed from ALL our web applications. As for how this works, I'm not completly into this, but a couple of points: 1. A class is identified by its full name but also by the class loader which loaded it. When the application-specific class loader loads a function from under WEB-INF, that class belongs to that class loader alone and classes loaded by other class loaders simply do not see it (I guess because the JVM looks up the class by name AND by the class loader of the other web app), that's also why you might sometimes get "class cast exception" after replacing a class without completly reloading an application, since a new class loader might be used to load it. (maybe there is a matter of class loader hierarchy here too, so shared classpath components are still seen as shared by all web apps). 2. Lookup material about class loaders to fully understand this. Cheers, --Amos -Original Message- From: Hemant Singh [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 10, 2000 4:27 PM To: [EMAIL PROTECTED] Subject: Re: /lib & /WEB-INF/lib HI: If you have a jar which you are using in more than one web-apps than place it under /tomat/lib so that tomcat do not reload the same jar more than once(I really surprise how internally it works) and if you are using that jar only in one web-app than place than place it under /tomcat/webappps/yourwebapp/web-inf/lib Regards Hemant - Original Message - From: "Bo Xu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 08, 2001 7:02 PM Subject: Re: /lib & /WEB-INF/lib > eric ng wrote: > > > > Hi, > > In tomcat or other servlet engine implements the spec. > > there are 2 place to put JAR files: > > > > 1) d:/tomcat/lib > > 2) d:/tomcat/webapps/abc/WEB-INF/lib > > > > I wonder what's the difference putting JAR in the 2 > > directory? any performance difference? Should I always > > put JAR into web apps's own lib? > > > > thanks. > > [...] > > Hi :-) > > - the jar files in TOMCAT_HOME/sebapps/myapp/WEB-INFlib > are loaded by the classloader of this webapp(myapp), normally they > are only used in this webapp(myapp). > > - the jar files in TOMCAT_HOME/lib are loaded by another classloader >(SharedClassloader) which is "upper" than the classloader of this > webapp >or that webapp in "JAVA2 delegation model", these jar files are > "shared" >for all webapp(0) or webapp(1) or webapp(2)... > % If you want to share a utility class to all webapp, you can wrap > >it into a jar file, and put the jar file here. > % because sometimes the classloader of one special webapp(for > example, >myapp) will be destroyed(for example, auto-reloading), so If > you don't >want a utility class to be load/reload several times, you can > wrap >it into a jar file, and put the jar file here. > > > Bo > June.08, 2001 >
RE: Moving from Tomcat 3.1 to Tomcat 3.2.1
Hi, >From our little experience, move to Tomcat 3.2.2, which fixes some bugs in 3.2.1. We don't run a production system with it, but so far we haven't found any problems with it (we use it for development) -Original Message- From: Moin Anjum H. [mailto:[EMAIL PROTECTED]] Sent: Monday, June 11, 2001 7:10 AM To: [EMAIL PROTECTED] Subject: Re: Moving from Tomcat 3.1 to Tomcat 3.2.1 Hi Pankaj, I have no Problem with my Code. I started with TC 3.1 Right now working with TC 3.2.2 working fine with my code. HTH Moin. Pankaj Chhaparwal wrote: > Hi All, > We are currently using Tomcat 3.1 with Apache 1.3.12. We are thinking of > upgrading to Tomcat 3.2.1 . Are there any issues in such an upgrade? > > Regards, > Pankaj
setting content type from servlet
Hello, Out environment: 1. Tomcat 3.2.2 2. Sun JDK 1.2.2_5 3. Windows 2000 We accept requests in Servlets which set the content type then forward the request to the JSP. It seems that the JSP overrides the content type as part of its initialization. We would like to avoid adding a <%@ page contentType="..."%> to each JSP page both for maintenability and since we want the content type to be configurable. Is there a way to do that? I read in the jGuru JSP FAQ that an include() instead of a forward() might cause header-setting in the JSP to be ignored, is that the right solution? What else would this affect? Thanks, --Amos
Dynamic Tomcat configuration?
Hello, I suppose there must be a way to dynamically configure Tomcat instead of writing the server.xml file, e.g. express tags like: or: by means of creating some object and passing it to some Tomcat configuration function. As far as I dug into the Tomcat source (3.2.1, JDK 1.2.2_005 on Windows) I couldn't find that way. Can someone show me an example? The aim is twofold: 1. We use Tomcat for automatic testting of our web applications infrastructure and code development under JBuilder, and would like to be able to dynamically provide port numbers in each run (since we might have multiple projects running) 2. When testting on UNIX (Solaris 2.6), multiple users may easely clash on fixed port numbers. Thanks, --Amos Shapira WebCollage
RE: I don't want cached pages
Hi, You can look at the generated code to understand what happens. What happens is that "<%!" (with "!") defines STATIC variables of the servlet instance. Without the "!" the variables are automatic variables of doGet/doPost. Cheers, --Amos > -Original Message- > From: Hugo Lara [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 20, 2001 2:53 AM > To: 'Craig O'Brien' > Cc: [EMAIL PROTECTED]; > [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: I don't want cached pages > > > Craig, > > I want to thank you for your help. I tried the carts.html > example with the > following results: > - In my machine I added some articles to the cart. Then I > closed my browser > and opened it again. When I ran the example and added 1 more > item, I noticed > that all of the items I've added before where still in the cart, which > didn't look nice to me. > - Then I went to another computer and tried the same example. > I added 1 item > to the cart and I was expecting to a list with the items I've > added in my > computer, but I saw just 1 item. Which was perfectly fine. > > I opened the carts.jsp file and noticed that the bean they > where using had > "session" as the parameter in "scope". Anyway, I didn't used > beans in my > .jsp file (the one I had troubles with), but it made think it > wasn't the > page that remained cached but the variables I was using, so I > reviewed my > .jsp file and I found the problem: > > I was initializing my variables with something like this, > > <%! > String strOne = "", strTwo = "", strThree = ""; > Double dblNumber = 0.0; > Locale currentLocale; > %> > > Then I used some java code to assign these variables some values and I > expected that the variables where initialized each time I > called the .jsp > file but it wasn't like that. > > Removing the "!" solved the problem. My variables are now > initialized like > this, > > <% > String strOne = "", strTwo = "", strThree = ""; > Double dblNumber = 0.0; > Locale currentLocale; > %> > > It's like if I use "<%!" to initialize the variables, they > are initialized > just the first time the page is called, and the subsequent > values assigned > to them remain on the next requests to the page. > Using only "<%" seems to initialize the variables on each request. > > Do these ideas make any sense or I'm just to tired? > > I'm not really sure why this is working like this, but it's working! > > > > -Original Message- > From: Craig O'Brien [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 19, 2001 5:39 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: I don't want cached pages > > > I cannot duplicate your problem. Are you having the same > problem with the > JSP example carts http://localhost:8080/jsp/sessions/carts.html ? Are you using Apache? I am using IIS5 but am having no problems. I have several applications like you mention and I can open up multiple instances of the same browser on the same machine and no information is passed between them. You may try printing the session id to the screen to see if you are having a problem there. You could try specifying a non-persistent connection in the JSP page, and next a non-persistent connection in the server. Good luck, Craig -Original Message- From: Hugo Lara [mailto:[EMAIL PROTECTED]] Sent: Friday, January 19, 2001 3:10 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: I don't want cached pages I'm just one more guy with the same trouble: Tomcat is caching my pages. I use a page that receives certain parameters and gives a result. And everytime I made a request in the browser for that particular .jsp page, I get the last version of that page served. It means that anyone entering my site would see the last served paged with the results from the last visitor, which is something terrible. I've received some kind emails from the community suggesting me to include the "Expires", "Pragma" and "Cache-control" (with the appropiate values) in the header to avoid caching. This is not working, and that's because (and I'm convinced of this) it's not a browser/proxy problem. It is Tomcat that keeps the last version cached, and I'm sure of it because it's enough to restart Tomcat to solve the problem. Anyway, it will be crazy to restart Tomcat every time a visitor wants to enter my site. I've been reading the mailing and I've noticed there's a lot of people with the same problem and no real solution. I know that Amos Shapira and David S. Adress have been through the same. If anyone has the solution to this problem please tell me, I need it very badly. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]