Returning a different .jsp than the one the browser asked for...
Gang, I've scoured the net looking for something that would help me do this- currently looking at Wrapping the HttpServletRequest, but not having much luck. Environment: tomcat 5.0.28 on linux, also using struts 1.1 I'm trying to make my system so that if a user asks for something like /pages/testing.jsp, it does a check to see if /pages/en_us/testing.jsp exists and if it does, it returns (executes, whatever) that page. Otherwise it will return /pages/testing.jsp. It seems like the tomcat (or was it struts?) used to do something like this where if testing_fr.jsp existed, and the person's locale was set to FR it would return that, but that appears to have gone away and I can't really find anything on it. ANY help or pointers would be greatly appreciated! Thanks! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Returning a different .jsp than the one the browser asked for...
I was kinda able to do what I needed by using a filter- thanks for your reply! /kurt Dakota Jack wrote: I don't know if this is helpful, but if you have a front controller in your architecture, which would be normal,, this sort of behavior would be simple to code. Do you have a front controller? On Apr 11, 2005 9:43 AM, Kurt Overberg [EMAIL PROTECTED] wrote: Gang, I've scoured the net looking for something that would help me do this- currently looking at Wrapping the HttpServletRequest, but not having much luck. Environment: tomcat 5.0.28 on linux, also using struts 1.1 I'm trying to make my system so that if a user asks for something like /pages/testing.jsp, it does a check to see if /pages/en_us/testing.jsp exists and if it does, it returns (executes, whatever) that page. Otherwise it will return /pages/testing.jsp. It seems like the tomcat (or was it struts?) used to do something like this where if testing_fr.jsp existed, and the person's locale was set to FR it would return that, but that appears to have gone away and I can't really find anything on it. ANY help or pointers would be greatly appreciated! Thanks! /kurt - 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]
Overriding the browser language setting?
Hi there all! I'm trying to override the default struts/tomcat code that chooses an ApplicationResources.properties file based on the user's browser language setting. I'd like to manage which language to serve up on my own (or based on an item in the user's session). Does anyone have any pointers on how to do this? Normally I would bash my head against an issue like this for weeks and weeks before finally posting, but in this case, its an emergency and time is short. Thank you for any and all help any of you incredibly talented and intelligent people could provide. /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: %@page isThreadSafe=false % does not work
I have a situation in my webapp where the user (administrator) can 'Publish' items. I need to make it so only one person can 'publish' at a time. Would this be a valid use of 'isThreadSafe'? Would it make user #2 wait until the page had finished processing for user #1? It would save me from writing a bunch of messy locking code. Thanks! /kurt Shapira, Yoav wrote: Hi, Don't rely on SingleThreadModel, it's more than deprecated: it's evil. Don't use the isThreadSafe directive, don't use SingleThreadModel. Yoav Shapira http://www.yoavshapira.com -Original Message- From: zerol tib [mailto:[EMAIL PROTECTED] Sent: Monday, December 06, 2004 10:23 AM To: [EMAIL PROTECTED] Subject: [EMAIL PROTECTED] isThreadSafe=false % does not work Howdy, I compared two servlets' source code compiled from JSPs, at the beginning of one jsp I add page directive: [EMAIL PROTECTED] isThreadSafe=false % and the other, [EMAIL PROTECTED] isThreadSafe=true %. But the two servlet are the same , I had thought the first servlet will implement interface SingleThreadModel, but it didn't. Could anyone give me a hint? BTW, jsp compiler (Lomboz) says SingleThreadModel is deprecated. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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]
Tomcat 5/Apache 2/JK2- production quality?
Gang, I've been running a fairly large website (25000 pages/day) off of Tomcat4.1.30/JK/Apache1.3 for quite some time now. Its been running great, but in expectation of needing some load balancing, I'm thinking of moving to Tomcat5/Apache2/JK2. Anyone have any thoughts or experiences with running these versions in a production environment? Thanks! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reloading classes and struts
Hi all, I've poked around a bit and have been fairly unsuccesful in finding and answer to this problem. I'm running tomcat 4.1.18 on Debian (woody). I'm using struts (1.0) and for the longest time, everything was great. I could reload my classes using the manager server reload feature. Then, a few months ago, it stopped reloading my classes when I'd tell it to. It would say they're reloaded, but they're really not. I'm not sure exactly when this started happening, so something must've changed in my system. My question is- is there anything in my webapp that could cause it to not actually reload the classes? Static classes? That sort of thing? One thing I did do was play around with moving to struts 1.1. Could there be some version of some library thats screwing me up? Another thing I'm not sure about is where to keep all the libraries I'm using. Generally, I'm keeping all my .jar files in my WEB-INF/lib directory. I'm wondering if keeping ALL my jar files there is screwing something up. I don't have anything in my server/shared/lib directory. I've listed the entries of my WEB-INF/lib at the bottom of my email. One other somewhat related problem has to do with struts. If I don't include my WEB-INF/classes directory in my classpath (set in setclasspath.sh), then I get: HTTP Status 500 - No action instance for path ...when accessing a struts action form. An error appears in my localhost_log to the effect of: 2004-01-22 10:59:44 StandardContext[]: Mapped to servlet 'action' with servlet path '/admin/MemberInfo.do' and path info 'null' and update=true 2004-01-22 10:59:44 action: Error creating ActionForm instance of class 'com.bzzagent.webapp.beans.MemberBean' java.lang.ClassNotFoundException: com.myapp.webapp.beans.MemberBean at java.net.URLClassLoader$1.run(URLClassLoader.java:198) The weird part is that if I DO include my WEB-INF/classes dir in setclasspath.sh, struts is happy, but then my classes won't reload. SO- to sum up: 1. Including myapp/WEB-INF/classes in setclasspath.sh makes struts happy, but makes it so I can't reload my classes 2. Not including myapp/WEB-INF/classes in setclasspath.sh breaks struts, but reloading actually appears to work. Auto-detection of classes changing also appears to work (reload=true in server.xml) Can anyone explain this behavior? Thanks for any light someone can shed! /kurt Files in WEB-INF/lib: activation.jar application.jar batik-awt-util.jar batik-dom.jar batik-svggen.jar batik-util.jar batik-xml.jar cewolf.jar commons-beanutils.jar commons-collections.jar commons-lang-2.0.jar commons-logging.jar commons-validator.jar displaytag-1.0-b2.jar dom.jar jakarta-oro-2.0.7.jar jakarta-regexp-1.2.jar jaxen-full.jar jaxp-api.jar jcommon-0.7.1.jar jdbc2_0-stdext.jar jfreechart-0.9.4.jar jstl.jar mail.jar mm.mysql-2.0.11-bin.jar pg73jdbc3.jar pgjdbc2.jar postgresql.jar rchart.jar sax.jar saxpath.jar session.jar standard.jar struts.jar utils.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
URLEncoding urls (hrefs) that are coming out of a database...
Gang, I store text in my database that contains: Hello there, user, please click a href=linkthis link/a. I output this text to the user with the bean:write/ tag (I'm using struts 1.0 tomcat 4.1.27). Is there some way to make sure that my JSESSIONID will get appended to these links (for people w/out cookies), or do I need to make that happen myself with some regex magic? I've poked around all the struts libs and all that but it seems that by the time the text gets substituted on the output .jsp, its already been compiled and everything, which is too late. Thoughts, ideas, workarounds? Anyone? Anyone? Help! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URLEncoding urls (hrefs) that are coming out of a database...
Well, yeah it should, but I get the impression (from testing and seeing it not do it) that if the URL is coming from a database and the URL (a href) is embedded in other text, that it won't automagically work. Since the URL isn't in the JSP file at compile-time, it seems that it just gets passed over. Can anyone confirm/deny this? Maybe I've got things configured improperly? All my other links come out with jsessionid appended properly. Thanks again! /kurt Shapira, Yoav wrote: Howdy, Don't worry about it, the servlet container is required to do this for your automagically (if the client doesn't support cookies). Yoav Shapira Millennium ChemInformatics -Original Message- From: Kurt Overberg [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 9:29 AM To: Tomcat Users List Subject: URLEncoding urls (hrefs) that are coming out of a database... Gang, I store text in my database that contains: Hello there, user, please click a href=linkthis link/a. I output this text to the user with the bean:write/ tag (I'm using struts 1.0 tomcat 4.1.27). Is there some way to make sure that my JSESSIONID will get appended to these links (for people w/out cookies), or do I need to make that happen myself with some regex magic? I've poked around all the struts libs and all that but it seems that by the time the text gets substituted on the output .jsp, its already been compiled and everything, which is too late. Thoughts, ideas, workarounds? Anyone? Anyone? Help! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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: URLEncoding urls (hrefs) that are coming out of a database...
Oh yes, I forgot, because the URL lives within a big block of normal text, I can't just call encodeURL on the whole thing. Seems like I need a method that will search out an a href in a string and do the jsessionid substitution on it. Ugh. /kurt Kurt Overberg wrote: Well, yeah it should, but I get the impression (from testing and seeing it not do it) that if the URL is coming from a database and the URL (a href) is embedded in other text, that it won't automagically work. Since the URL isn't in the JSP file at compile-time, it seems that it just gets passed over. Can anyone confirm/deny this? Maybe I've got things configured improperly? All my other links come out with jsessionid appended properly. Thanks again! /kurt Shapira, Yoav wrote: Howdy, Don't worry about it, the servlet container is required to do this for your automagically (if the client doesn't support cookies). Yoav Shapira Millennium ChemInformatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing document root for .jsp files?
Yeah, I could do that, but it'd mean rewriting the links to 100's of files. I could even live with putting the entire jsp dir structure under one directory, like 'jsps', which lives in the same dir as WEB-INF . So I would essentially be making webapp/jsps the webserver root (as it appears to people coming in to the site), and admin and member go into the jsps dir as well. Is that possible? /kurt Angus Mezick wrote: Can't you just restrict webapp/ to have only index.jsp and directories and then change all your links? --Angus -Original Message- From: Kurt Overberg [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2003 9:24 AM To: Tomcat Users List Subject: Re: Changing document root for .jsp files? Yep. Right, I understand that. The root of my webserver is getting kinda ugly though (lots of files), and I'd like to keep my WEB-INF from being a subdir of my root (well, just for website appearances), just to keep things clean (so I can CVS commit my .jsp files without having it recursively go into my src files). Is this just a bad idea? There's no way to map the root of the webserver to a different directory? so what I'm saying is: webapp/root/*.jsp map to www.site.com/*.jsp webapp/admin/*.jsp map to www.site.com/admin/*.jsp webapp/member/*.jsp map to www.site.com/member/*.jsp ... or do I have to just suck it up and deal? /kurt John Turner wrote: The root directory of a webapp is the directory that holds WEB-INF. John Kurt Overberg wrote: Hi all! I have the following layout for my web application: webapp/ webapp/WEB-INF webapp/admin webapp/member I have .jsp files in the webapp directory, webapp/admin and webapp/member. When someone goes to the root of my website (www.site.com/*.jsp), it gets the files out of the webapp/ directory. member and admin are protected areas, which all work fine. I'd like to make another subdir under webapp called root or something like that, so the root of the web site isn't one level up from my WEB-INF. Is this possible? I've googled incessantly and can't seem to find out how to do this. Thanks in advance for any thoughts or ideas on this. Thanks! /kurt - 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]
Changing document root for .jsp files?
Hi all! I have the following layout for my web application: webapp/ webapp/WEB-INF webapp/admin webapp/member I have .jsp files in the webapp directory, webapp/admin and webapp/member. When someone goes to the root of my website (www.site.com/*.jsp), it gets the files out of the webapp/ directory. member and admin are protected areas, which all work fine. I'd like to make another subdir under webapp called root or something like that, so the root of the web site isn't one level up from my WEB-INF. Is this possible? I've googled incessantly and can't seem to find out how to do this. Thanks in advance for any thoughts or ideas on this. Thanks! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing document root for .jsp files?
Yep. Right, I understand that. The root of my webserver is getting kinda ugly though (lots of files), and I'd like to keep my WEB-INF from being a subdir of my root (well, just for website appearances), just to keep things clean (so I can CVS commit my .jsp files without having it recursively go into my src files). Is this just a bad idea? There's no way to map the root of the webserver to a different directory? so what I'm saying is: webapp/root/*.jsp map to www.site.com/*.jsp webapp/admin/*.jsp map to www.site.com/admin/*.jsp webapp/member/*.jsp map to www.site.com/member/*.jsp ... or do I have to just suck it up and deal? /kurt John Turner wrote: The root directory of a webapp is the directory that holds WEB-INF. John Kurt Overberg wrote: Hi all! I have the following layout for my web application: webapp/ webapp/WEB-INF webapp/admin webapp/member I have .jsp files in the webapp directory, webapp/admin and webapp/member. When someone goes to the root of my website (www.site.com/*.jsp), it gets the files out of the webapp/ directory. member and admin are protected areas, which all work fine. I'd like to make another subdir under webapp called root or something like that, so the root of the web site isn't one level up from my WEB-INF. Is this possible? I've googled incessantly and can't seem to find out how to do this. Thanks in advance for any thoughts or ideas on this. Thanks! /kurt - 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: Https not working
Neither of those urls are passing through you apache, unless you have it configured to run on port 8080 (which is usually the Tomcat port). Not sure if you can configure Tomcat to use SSL directly, but I do know that just sticking an 'https' in front of it won't work. You need to set up apache so it deals with the http/https side of things and configure a connector (the thing that allows apache to forward requests to Tomcat's AJP13 port). /kurt [EMAIL PROTECTED] wrote: Greetings, I'm running Tomcat primarily as a Servlet/JSP container behind Apache so I have configure the primary web server to handle the SSL connections from users. So if my apache box will negotiate all SSL-related functionality what do I have to do in tomcat to get it to work? If you go to http://placeanad.classifiedmarketplace.net:8080/AdWebster works But https://placeanad.classifiedmarketplace.net:8080/AdWebster does not work Thanks, Bobbie Bobbie Atristain Internet Systems Administrator Media General, INC. 804.649.6156 - 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]
Tomcat/JDBC/Unicode
I'm having a rather strange problem that I'm hoping someone can help me with. I'm using Struts 1.0/jsp on Debian linux under Tomcat 4.1.x and the blackdown JVM against PostgreSQL 7.3.2 . I'm attempting to convert my current SQL_ASCII database to UNICODE. I'm new to this, so am most likely making a few mistakes. Here's what I've done so far: o Converted database encoding to be UNICODE. I'm pretty sure this part worked okay. (did a pg_dump, then iconv -f 8859_1 -t UTF-8, then created new db with encoding UNICODE and reloaded- no errors upon reload) sparky:~$ psql -l List of databases Name| Owner | Encoding ---+--+--- unitest | kurt | UNICODE template1 | postgres | SQL_ASCII (2 rows) o set client_encoding to 'UTF8'; o In my JSP files, I set the following at the top of each: %@ page lanuage=java pageEncoding=UTF-8 % Now, to test this, I go to a japanese page, copy some text, then paste it into a form, that gets submitted to the server and saved into the DB. Then I try to display what I got back from the database. It comes out garbled. HOWEVER- if I leave the 'pageEncoding' out of my display .jsp file it still comes out garbled, UNTIL I set UTF-8 manually in my browsers Character Encoding settings (both mozilla and IE). Then the japanese characters render fine (just like I entered them). Very strange. What's confusing is that when I set the pageEncoding to 'UTF-8', the characters don't render properly, and as far as I can tell, thats the same as manually setting the browser manually. I must be doing something wrong because I get the same results in IE and mozilla (recent build). What may be the problem- I don't do anything differently when getting the data out of the database, just standard resultset.getString(column); Do I need to change that call, to handle the potentially UTF-8 encoded strings? I can't find anything on that at all with google/usenet. Any and all help, suggestions or pointers would be greatly appreciated. Thanks! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 3.3.1a - NoClassDefFoundError using service
Looks like its having trouble finding your classpath. Try setting it in the Windows System Environment Variables. /kurt MaurĂcio wrote: Hi, I have a problem running Tomcat 3.3.1a with JavaSDK1.3. When I start Tomcat manually, everything works well. However, when I try to start Tomcat as a Windows service (configured with jk_nt_service.exe), I get the following in the log: java.lang.NoClassDefFoundError: $(wrapper/jvm/options) Exception in thread main What does that means? What can I do? Is anything missing on wrapper.properties? Thanks, MaurĂcio - 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]
Tomcat/Struts DB connection pool?
I'm running Tomcat 4.1.18 with Struts (release version) on RedHat 7.3. I'm connecting to a postgres 7.3.2 database (running on the same machine) using the JDBC2 drivers. 1Gb of ram, with a decent processor. I'm using the default struts database connection stuff. Here's the struts DB config: data-sources data-source autoCommit=true description=PostresQL Connection driverClass=org.postgresql.Driver maxCount=100 minCount=10 password=passwd url=jdbc:postgresql://localhost/mydb user=dbuser /data-source /data-sources I inherited this application with no documentation, and I'm kinda new to struts. I've been doing well working on the app, as struts is KINDA straightforward. Now I'm tasked with moving the app from a shared sun box to this linux server. It seems that I'm having problems with my database connection. Things start off okay, with about 10 postgres processes taking up around 8 Megs each. After about an hour, the postgres processes have grown to like 70 or 80 Mb each. If I let it run longer, they get up to around 200Mb, most of which is allocated out of the shared memory space, but still, it gets slow and kinda clunky. If I reload (or restart, of course) tomcat, the postgres sizes drop back down to 10 Mb. This leads me to believe that I'm somehow leaking DB connections. Reloading tomcat doesn't seem to affect the memory size of tomcat, but its not really getting that big anyway, so I'm less worried about that. I've checked over the code, and I'm closing and setting to null all my ResultSet's, Statements and Connections. I'm POSITIVE that I'm not leaving connections open in my java source. I've been unable to find on the net a good document explaining how to make sure that the struts DB stuff is using a pooled connection. Should I switch to another pooling mechanism? Can anyone recommend one? Does my struts db config look correct? Has anyone set this up before in a similar environment? Any thoughts or comments would be greatly appreciated! Thanks! /kurt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]