Re: including header, footer in jsp
The Struts template taglib handles this very nicely and is pretty straightforward, although the Struts team is now recommending using a more complex version of this called Tiles. Check it out. runu rathi [EMAIL PROTECTED] 02/22/03 12:25 PM Please respond to Tomcat Users List To: [EMAIL PROTECTED] cc: Subject:including header, footer in jsp Hi all, If I want to design an application such that I have a template for the footer, header, side menus etc.. And I want to include that in all my jsp pages without copying the whole of it. How can I do it? Thanks for any help. Runu __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wrestling with JSP error page
Hi, all. I'm finding that the JSP errorPage directive has a serious flaw. Perhaps others out there have run into this and been as frustrated as I am and hopefully come up with some solution...? The flaw is that, if the response has already been committed, then the error page is just plopped into the response where the error occurred - it has no way that I see of generating a fresh response with just the error page content. Then the problem is that, depending on where the original page died, the error page content may not get displayed if it's caught inside some HTML tag where the browser can't figure out how to render it. Just as an example of this which I've seen, say you have a select dropdown list populated from some List request attribute, so you output select and then go to iterate through the List. Now, say the List is null, and a NullPointerException is thrown, the errorPage content gets put into the response right after the select tag and the browser doesn't display it. (You can see it if you do View - Source, but this obviously defeats the purpose.) This is quite annoying, and I'm amazed that this mechanism still hasn't been improved. I searched for solutions to this, but the only thing I could really find was using another framework like Velocity which buffers the whole response and therefore can generate a completely different one if an exception occurs at any step of the way. Unfortunately, learning another framework just isn't in the cards. Does anyone know of a way, besides maybe making the buffer size really huge, to get around this problem? Would a Filter on the response help with this? How would something like that work? (Never written/used a Filter before) Thanks! -Jeff
Re: UTF-8 Sending Euro symbol to Servlet in Form data.
Hi, Andoni. I'm not 100% sure how this all works, but I think there's a default system encoding on the system where your Tomcat is running. This encoding determines how the form request parameters come across. I think when I ran into a similar problem a while back I got around it by doing something like this: String param = request.getParameter(param); byte[] paramBytes = param.getBytes(UTF-8); String paramToDatabase = new String( paramBytes, UTF-8 ); Then, you can send paramToDatabase to the database. See if something like that works for you. I've also seen discussion on this list about using Filters to intercept the request and handle this kind of thing, but I've never dealt with that. HTH, -Jeff Andoni [EMAIL PROTECTED] 02/17/03 01:56 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:Re: UTF-8 Sending Euro symbol to Servlet in Form data. Actually the prepared statements couldn't help as I can get the Euro symbol into the database fine by hard-coding it into my statement. It is only getting the information **from the form to the servlet** that is having a problem. Andoni. - Original Message - From: THG [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, February 17, 2003 7:42 PM Subject: Re: UTF-8 Sending to Database. It could be, that the form data is double encoded or the jdbc driver automatically encoding the data on the fly. do u use prepared statements (setString())? what is the encoding of your dbms? On Mon, 17 Feb 2003 19:22:55 Andoni wrote: Hello, I am trying to send a Euro symbol ( ? ) to my database but it keeps being corrupted on the way to the servlet from the form on my page. When I replace the SQL string in my servlet with one which has a Euro symbol hard-coded it works fine and displays in my .jsp fine as the Euro symbol but when I submit a form from my JSP with a Euro symbol it gets corrupted into nonsense on the way to the servlet. Can anyone please help?? Thanks, Andoni. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plusref=lmtplus - 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: jsp:useBean error
well khalid, u haven't seen fit to respond to me yet, so consider this to be yer light a fire under you email!!! [snip] Please try to respond to me with some useful advice about how I can successfully execute this JSP, because it doesn't look too much like anyone else in this newsgroup much feels like doing so, sad to say! [snip] With manners like that, it's really no wonder... Anyway, Steve, it's a ClassNotFoundError. You didn't put your class in a package. Put it in a package (example: com.burrus.authentication) and then make sure that the compiled class file is in the WEB-INF/classes/com/burrus/authentication (following the example) directory. Quite a jump from having trouble getting the examples to work to LDAP authentication!! Perhaps backing the truck up a bit and reinforcing the fundamentals would be wise. Just a thought... HTH, -Jeff
RE: servlet with Tomcat
These are extremely clear and detailed instructions - nice, Denise... Hopefully, this will help Steve emerge victorious from his year-long battle against Tomcat. One thing though I wanted to point out is that the servlet-name values should match, so use the same thing (greeting, Startup, or whatever) in both places. Then, just to clarify even further, the URL that should get you to your servlet would be http://localhost:8080/greeting/GreetingServlet. Like Noel said, though, if you can't get the examples to work, then you are getting ahead of yourself by trying to get your own servlet to work. First get Tomcat to work out of the box, then dive into your own stuff. Go for it, Steve!!! Denise Mangano [EMAIL PROTECTED] 01/14/03 03:50 PM Please respond to Tomcat Users List To: 'Tomcat Users List' [EMAIL PROTECTED] cc: Subject:RE: servlet with Tomcat Perhaps if you posted your specific problem minus the rants and nasty remarks, people on the list would be a little more inclined to assist you. Now I don't recall your exact situation because to be honest I have simply deleted most of the emails you send because the have not made much sense, and your tone for the most part annoyed me. So this is probably a little outdated. You also may want verification on what I'm about to write because I am a newbie too (and when seek it, let me suggest you be more polite in asking). The only post of yours that I actually didn't delete contained the following information: You stated that you have your servlet in a package org.burrus.So this means the path for the GreetingServlet.class should be C:\jakarta-tomcat-4.1.16\webapps\greeting\WEB-INF\classes\org\burrus\ (notice the WEB-INF is all upper case) And in your GreetingServlet.java you have package org.burrus; (without the quote marks of course) at the beginning of the file. In that email, you posted your web-xml and it looked like this: web-app servlet !-- Servlet alias -- servlet-namegreeting/servlet-name !-- Fully qualified Servlet class -- servlet-classGreetingServlet/servlet-class /servlet servlet-mappinggreeting/servlet-mapping /web-app From what I understand this is incorrect. Since you say you are using a package - once you check what I stated above about the package, your web.xml should be: web-app servlet servlet-namegreeting/servlet-name servlet-classorg.burrus.GreetingServlet/servlet-class /servlet servlet-mapping servlet-nameStartup/servlet-name url-pattern/GreetingServlet/url-pattern /servlet-mapping /webapp Like I said, you probably want verification on this, but I don't know how you will get it if you don't learn how to ask a question. Good luck. Denise Mangano Help Desk Analyst Complus Data Innovations, Inc. -Original Message- From: Steve R Burrus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 14, 2003 4:10 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: servlet with Tomcat No, I am very definitely NOT a newbie to manners, whoever you are!! Are you a newbie to tomcat or a newbie to manners, Steve? I just simply wanted for someone to tell me how exactly I go about editing the web.xml file so I can then see/view a servlet in my browser! If that offends anyone (and I don't see how it possibly could), then I am sorry!! __ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Installation woes
Open a terminal window yourself first, then run %CATALINA_HOME%/bin/startup.bat. Now you should be able to see the error message without the window disappearing on you. Also, make sure the JAVA_HOME points to the top level directory of your JDK (C:\jdk1.3 instead of C:\jdk1.3\bin for instance). Also, I don't know if things have changed with the more recent versions, but I seem to remember there being problems with the installations in previous versions, and it was generally recommended to just download the binary release (sufficient unless you want to take a look at and/or tweak the source code), unzip, and set the environment variables. You could always give that a try to see if things work better. HTH, -Jeff Nathan McMinn [EMAIL PROTECTED] 01/08/03 04:22 PM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Installation woes I added it, and it appears to be using the correct jdk. However, now the damn thing won't start. And it closes the terminal window before I can retreive the error message. - Original Message - From: Tam, Michael [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, January 08, 2003 4:13 PM Subject: RE: Installation woes Nathan, Adding JAVA_HOME as environment variable under Sys. Properties should work. Where did you add your JAVA_HOME variable i.e. as User variable or System variable?? It should be under System Variable. I am running XP Home on my notebook and it works for me. Hope this help. Michael -Original Message- From: Nathan McMinn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 1:50 PM To: Tomcat Users List Subject: Re: Installation woes John, Here's the kicker, running SET from the command line (win xp) doesn't list JAVA_HOME as an existing env var, neither does sys properties - advanced - environment variables. Is there somewhere else to look for it? - Original Message - From: Turner, John [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, January 08, 2003 3:41 PM Subject: RE: Installation woes Change the JAVA_HOME environment variable to point to the JDK you want to use. John -Original Message- From: Nathan McMinn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 4:39 PM To: Tomcat Users List Subject: Installation woes When installing Tomcat 4.1.18, during the installation, it autodetects the jdk install location. Is there any way to override this? If not, how do you change the jdk that tomcat uses? It is automatically using an older jdk that Jbuilder installed, and I don't want it to use this one. --Nathan McMinn -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session timeout setting (URGENT)
Hi, Kenny. I think this is basically how it works: - Tomcat's conf web.xml sets the default session-timeout (in session-config element) to use for all web apps. - You can specify a different session-timeout in each specific web app you deploy in the web app's WEB-INF/web.xml file. - This session timeout can still be overridden in application code using the session.setMaxInactiveInterval method. I hope this helps you find the problem. -Jeff Kenny G. Dubuisson, Jr. [EMAIL PROTECTED] 12/20/02 09:05 AM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: Session timeout setting (URGENT) Simple minded as I am, I still believe with everything I have that there MUST be a setting in Tomcat that controls how often new session ID's are generated. If I have a simple page that does nothing but a session.getId() and it returns a new session ID every 60 mins, there must be something in Tomcat that sets this interval. Obviously this setting is missing from my config files so that Tomcat uses it's default. Has no one ever wanted to change this setting before? I hate to sound beligerent but I've authored and released what I feel to be a very nice application/web site but the only feedback I'm getting is litterally users screaming at me because I haven't fixed this yet. I'm going to have to start looking at redesigning the login/verification process on every page (not a big site but still 20K of code) to work around this issue when I feel it has to be a simple setting. If someone could answer this I'll give you my first born, send expensive Christmas presents, lend you my wife. Thanking / Praising you in advance, Kenny -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: UTF-8 vs ISO-8859-1 and really screwed up webpages.
I think they're supposed to be, but I have found that the META tags sometimes don't seem to work, whereas the JSP directive seems to be more reliable. Andoni [EMAIL PROTECTED] 12/19/02 08:37 AM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Re: UTF-8 vs ISO-8859-1 and really screwed up webpages. Are the HTML meta tags and the JSP tags interchangeable? i.e. are they the same thing? Andoni. - Original Message - From: Bogdan Kiszka [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 19, 2002 1:45 PM Subject: RE: UTF-8 vs ISO-8859-1 and really screwed up webpages. It is perfectly right. You must take care not to have page directive with contentType attribute in any included pages. If you have only one such an entry per page then everything is alright. I suggest to start with simple pages and then move to sophisticated ones. Bogdan -Original Message- From: Andoni [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 2:17 PM To: Tomcat Users List Subject: Re: UTF-8 vs ISO-8859-1 and really screwed up webpages. It tells me I can't have two contentType entries when I put in the JSP tag!! Andoni. - Original Message - From: Andoni [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, December 19, 2002 12:58 PM Subject: Re: UTF-8 vs ISO-8859-1 and really screwed up webpages. I am having this problem aswell. the pages I produce are coming up with all sorts of Japanese characters etc. in them. I have already inserted the Meta tags and converted the files using the saveAs / UTF8 feature on my editor. Now I am going to add the %@ page contentType = text/html;charset=UTF-8 % tag suggested by Bogdan below, is there anything else I must do? Andoni. - Original Message - From: Bogdan Kiszka [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 19, 2002 9:25 AM Subject: RE: UTF-8 vs ISO-8859-1 and really screwed up webpages. In the JSP page, use a page directive to set the content type: %@ page contentType = text/html;charset=UTF-8 % -Original Message- From: Kristj?n Bjarni Gu?mundsson [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 9:50 AM To: Tomcat Users List Subject: Re: UTF-8 vs ISO-8859-1 and really screwed up webpages. Yes, you are storing the page as ISO-8859-1 so you must serve the page as ISO-8859-1 changing the meta tag to UTF-8 doesn't magically convert the page to UTF-8. If you want to serve the page as UTF-8 you must also save the page as UTF-8. The meta tag is just a hint to the browser which charset the page is using. Check you html editor to see if you can change the encoding to UTF-8 when saving. Adam Greene [EMAIL PROTECTED] wrote on 18.12.2002 20:32:37: I have two webpages and both contain the letter é (litterally written into the page), but one page displays it as é and the other page displays it as ?C and I cannot figure out why. I have tried setting (via META Tags) the language to UTF-8 and to ISO-8859-1 and I can only get one page to work at a time (under UTF-8, the é comes up as a block on the page that did work under ISO-8859-1). I can see no difference in the code. Does anyone have any ideas about what is going on?? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Session timeout setting
My guess is that the application is probably overriding the setting in your web.xml by using the setMaxInactiveInterval method on the session object. Kenny G. Dubuisson, Jr. [EMAIL PROTECTED] 12/19/02 09:07 AM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Session timeout setting Sorry to repost this but I'm kind of in a bind (got users about to lynch me which may or may not be a bad thing). Anyway...session ID's on my site (using Tomcat) are getting regenerated after a user has been logged in for 60 mins. I would like to change this to a higher value but don't know where to set it. I've read throught posts on this list and I've seen some things mention the web.xml file and its session-timeout setting but my web.xml session-timeout setting is currently set to 30 mins in that file so that can't be the proper setting that I'm looking for. Any ideas would be greatly appreicated. My users are upset that they have to re-login evey hour on an application that they use all day. Thanks in advance, Kenny -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4 StandAlone Web Server, Static HTML and Images
Looks like you're basically putting your images in its own web app. You may need a WEB-INF directory and trivial web.xml file under the images directory in order for Tomcat to like it as a web app (not sure though). Then, I think your url for the image would be /images/image.gif. Alternatively, you could move your images directory to be within your servlet web app. Then, your url (from index.shtml) would be images/image.gif. HTH, -Jeff p niemandt [EMAIL PROTECTED] 11/18/02 09:35 AM Please respond to Tomcat Users List To: Tomcat Users List [EMAIL PROTECTED] cc: Subject:Tomcat 4 StandAlone Web Server, Static HTML and Images Hi Group: Please help ... I'm very new to servlets, though I do have a lot of programming experience. My problem is that I can't seem to get images displayed properly using Tomcat as the web server. I have a very simple layout ... webapps /servlet index.shtml /WEB-INF- My servlets and web.xml /images contains my images I manage to serve the index.shtml quite easily, my problem is that I can't get the images displayed without specifying the whole url in the form file:///dir/to/images/image.gif, and I think this is wrong. There is a lot of information regarding how to configure a web server to display the images, and this I can do fine, but I would like to only run Tomcat: My site is very small, and the latency in Tomcat would not effect it. My question is in how to specify the url for the image in the html, I have tried image.gif, /servlet/image.gif, ../image/image.gif, /servlet/../image/image.gif, etc, etc. Now I suspect I'm missing something very stupid, but sadly I have no idea what. I do not want to code the image display, as far as I know, Tomcat should be able to handle such a simple html site. My servlets work well, database connectivity and all, and the site works well if I use apache as well, but how to do this without Apache is currently beyond me. Any information or just hints in the correct direction would be greatly appreciated. -- p niemandt [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat 4.1.12 - Incompatible type for getting or setting field
Hi, all. I saw a message someone posted to the list asking about this a few days ago and have been eagerly waiting to see the responses (haven't been any though), since I ran into the same problem when upgrading to Tomcat 4.1.12. To reiterate the problem, version 4.1.12 often gives this error message when trying to serving up JSPs, which work fine under version 4.0.x: javax.servlet.ServletException: (class: org/apache/jsp/pagename_jsp, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Incompatible type for getting or setting field I figured it would be a quick and painless install/upgrade like they are most of the time with Tomcat, but I ended up bailing out and reverting back to 4.0.6 when I ran into this, since I didn't have the time to dig into it. Does anybody know what's going on or what can be done to fix the problem? Thanks, -Jeff
Re: java.lang.NullPointerException
Just take a look at line 124 of the generated servlet (FamilyMain$jsp.java) mentioned in the stack trace. This file will be under the work directory. Look for code calling a method on an object, which in this error condition happens to be null. HTH, -Jeff Eddie Liang eliang@edge.To: 'Tomcat Users List' [EMAIL PROTECTED] com cc: Subject: java.lang.NullPointerException 10/23/02 08:49 AM Please respond to Tomcat Users List Hi, I use the JSP, tomcat 4.0.4 to call a java bean class, I got the below error. Does anybody know what is wrong? Thank you very much. java.lang.NullPointerException at org.apache.jsp.FamilyMain$jsp._jspService(FamilyMain$jsp.java:124) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) Here is my JSP source code: !-- Developed and Documented by Krishna Veeramachaneni -- html head titleIMEDGE Content Management Services Administrator/title link href=/JSP/com/imedge/admin/style.css rel=stylesheet type=text/css /head jsp:useBean id=dbbean class=com.imedge.admin.IMDbFamilyBean /jsp:useBean % /* Java code to retrieve family name and description if any */ int i = 0; String familyName = BRACView; String familyDesc = The default text goes here; String[] AllFamilyName = (String[]) dbbean.getAllFamilyName(); % body link=#99 vlink=#00 alink=#00 ID=Bdy leftmargin=0 rightmargin=0 topmargin=0 bgcolor=beige %@ include file=/JSP/com/imedge/admin/Banner.jsp % %@ include file=/JSP/com/imedge/admin/FamilyMenu.jsp% table width=100% height=100% cellpadding=0 cellspacing=0 tr td class=leftFrame bgcolor=beige color=black valign=top width=180 h4 nbsp; img align=absmiddle src=/JSP/com/imedge/admin/images/familysmall.gif nbsp; Family /h4 form name=add_form nbsp;input class=submitStyle name=family_create type=reset value=Add +
RE: Where is the Exception object when error-page is used?
request.getAttribute(javax.servlet.error.exception) is where you can find the exception object thrown FYI - javax.servlet.error.request_uri tells you what the original request was HTH, -Jeff Wendy Smoak Wendy.Smoak@To: 'Tomcat Users List' [EMAIL PROTECTED] asu.edu cc: Subject: RE: Where is the Exception object when error-page is used? 10/16/02 09:22 PM Please respond to Tomcat Users List Jean wrote: Here is an example: %@ page isErrorPage=true % i%=exception.getMessage()%/ibr/ % exception.printStackTrace(new java.io.PrintWriter(out)); % Thanks, but the problem is that when the exception occurs and is handled by the error-page tag in web.xml, (not by the %@ page errorPage=... % tag,) then the implicit 'exception' object is null. (At least, it is in my particular case, I have not done more experiments.) From the JSP spec, I can only find that the 'exception' object should be present in the session under a particular attribute name when an error occurs on a page that has the errorPage attribute. I don't think I can use %@ page errorPage=... % because I don't know where it's going to go to on error-- that's why there are multiple error-page tags in web.xml. And yet, I thought I read somewhere that Tomcat would put the offending exception object in [session?] scope under a particular attribute name... but I can't find that again. I haven't a clue where to look in the code either, so if someone knows generally where the exception-web.xml-error-page tag handling happens, I'd be happy to try to figure it out myself. -- Wendy Smoak -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: global.jsa - Struts
If you're looking for a very basic MVC implementation, you can use a small part of what Struts offers and be able to save the time you would spend writing your own. You do pretty much exactly what you wrote in your second paragraph. Set up your struts-config.xml file to define your actions and valid paths that could result from the action (which JSP to show) and implement the defined action classes to process the data coming from your JSP. No need to bother with action forms or taglibs at the moment if you do in fact have a fly in your cannon's crosshairs. That's about it - voila, an MVC implementation with very little pain. Obviously, there are tons more features available in Struts which you can explore and use as you see fit. I'm still in the exploring phase myself. -Jeff neal nealcabage@yTo: Tomcat Users List [EMAIL PROTECTED] ahoo.comcc: Subject: RE: global.jsa - Struts 09/04/02 11:00 AM Please respond to Tomcat Users List Good to know. Thanks for your thoughts on Struts. Yeah, I'll check out those taglibs in the Jakarta lirary taglibs. I already found some great functionality in their commons library. :) Yeah, for MVC implementation I was simply talking about a servelt that takes an action parameter to determine which JSP to show and which class to use to process any data coming from that JSP...and maybe this data is mapped into an XML or props file. This is pretty much what you're doing too? Neal -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 8:21 AM To: Tomcat Users List Subject: RE: global.jsa - Struts My opinion about development: you really should use only tags in JSP, and never write java code in a jsp file. You should always separate design from implementation. About Struts: yeah, we need lots of taglibs to avoid writing Java code in JSP. So, taglibs for standard APIs are welcome. But Struts goes too far, with taglibs to generate form tags, etc. These things (html forms) normally are generated by dreamweaver users, so i don't like strut's approach. And there are lots of talibs avaliable on the net, including jakarta site itself, so I don't need Struts. MVC-style programming is great. But I use my own implementation, much more simple than Struts. I think that kind of API is a cannon to kill a fly (as we speak here in Brazil) in most cases, if not all. On Wed, 2002-09-04 at 12:10, neal wrote: Micael, You've mentioned Struts a couple of times and I admit I am curious. I did look into Struts but to be honost I wasn't all that impressed by what (I think) I saw. It seemed like it was just offering a lot of lightweight wrappers around the API. Case in point, the Cookie utility class didn't appear to offer any additional functionality over the http.cookie class in the JDK. It's connection pooling was even pretty rudamentary so I went around that. I presume that its XML/XSL, and other such things would also be rundamentary probably too. And actually, did I say a lot? I looked at the API and I didnt think there was a lot there... All those things I'm saying wouldn't be bad per se, except that I don't want to learn a whole new API to do basically what Java already does with it's own standard API (again back to the wrapper thing). Granted the MVC pattern implementation is apparentlly very good but I'm not seeing that as a huge stumbling block to write on my own. They also appear to provide custom tags wrappers around their API so that you can keep your code totally declarative (code based) at the JSP level. Ok, that would be cool ... but again I just don't want to be
RE: javax directory
The classpath used when you do your Java compiling. Tomcat is not involved at all at this stage in the game. Reis, Tom reistom@cdneTo: 'Tomcat Users List' [EMAIL PROTECTED] t.cod.edu cc: Subject: RE: javax directory 08/26/02 08:52 AM Please respond to Tomcat Users List Would that in the classpath for java or for the Tomcat. -Original Message- From: Goverdhan Nookala [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 22, 2002 1:23 PM To: 'Tomcat Users List' Subject: RE: javax directory you need to set the servlet.jar or j2ee.jar file in classpath Thanks Goverdhan -Original Message- From: Reis, Tom [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 22, 2002 2:21 PM To: Tomcat Users List (E-mail) Subject: javax directory I am trying to compile a application that uses import javax.servlet.*; import javax.servlet.http.HttpServlet; in the code. When I attempt to compile this code I receive errors stating that it could not find these symbols. I noticed that they are actually located in the tomcat directory. Should this be copied to the java directory or is there something else I should do. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: STILL Need Help w. Tomcat Install
Oh, come on, the this is Steve Burris bit makes me giggle every time... ;) Jacob Kjome [EMAIL PROTECTED]To: Tomcat Users List [EMAIL PROTECTED] m cc: Subject: Re: STILL Need Help w. Tomcat Install 08/21/02 06:59 PM Please respond to Tomcat Users List snip and please stop with the this is Steve Burris in your email. We know who you are based on the from header in the email. You don't need to tell us again. later, Jake At 12:50 PM 8/21/2002 -0700, you wrote: This is Steve Burrus again, and I am damned sorry to have to post my plea for help/assistance again, but everyday when I first access my email there are literally 100's of postings from other members of the Tomcat newsgroup, and my original post--and any response--is VERY DIFFICULT to locate, so here it is again: How exactly does one go about installing the Tomcat 4.0.* correctly??? I have racked my brain in trying to figure out how to do this, but I simply cannot do it myself, I am afraid to say! Thanx in advance to anyone who can help me! __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re[4]: Quick Question
Hi, Alex. Since JSP's are turned into servlets before they are executed, I don't see why you couldn't do this. For your convenience, JSP's have some common objects already available for use. The application object is equivalent to the javax.servlet.ServletContext object you would get by doing a getServletContext() call. So, application.getInitParameter(key) should do the trick, too. HTH, -Jeff Jacob Kjome [EMAIL PROTECTED]To: Tomcat Users List [EMAIL PROTECTED] m cc: Subject: Re[4]: Quick Question 08/13/02 12:00 PM Please respond to Jacob Kjome Hello TOMITA, I know next to nothing about JSP. Haven't touched it. I use XMLC and Barracuda to do presentation. However, I would think that you should be able to use getServletContext() or something analogous in JSP. Jake Tuesday, August 13, 2002, 11:13:44 AM, you wrote: TLC Can I use something like this in my jsp page (instead of a java sevlet) to TLC get the parameter name?, TLC before that I set the parameter in my web.xml file like this: TLC context-param TLC param-nameparameter name/param-name TLC param-valuelocalhost/param-value TLC /context-param TLC String value = getServletContext().getInitParameter(parameter name); TLC because I'm confusing here because of the name getServletContext. is TLC it only works in a sevlet or it will work too in a jsp page??? TLC thanks again TLC Alex Tomita TLC [EMAIL PROTECTED] TLC 13/08/2002 10:54 a.m. TLC Please respond to Tomcat Users List TLC To: Tomcat Users List [EMAIL PROTECTED] TLC cc: Tomcat Users List [EMAIL PROTECTED] TLC Subject:Re: Re[2]: Quick Question TLC My bean is WEB-INF/classes TLC Jacob Kjome [EMAIL PROTECTED] TLC 13/08/2002 10:43 a.m. TLC Please respond to Tomcat Users List TLC To: Tomcat Users List [EMAIL PROTECTED] TLC cc: TLC Subject:Re[2]: Quick Question TLC Hello TOMITA, TLC Where does your Bean exist? Is it in one of Tomcat's classloaders, or TLC is it running out the WEB-INF/classes or WEB-INF/lib folder of your TLC webapp. I'm geussing the it is in one of Tomcat's classloaders TLC meaning $CATALINA_HOME/common/lib, server/lib, or lib (shared/lib in TLC Tomcat-4.1.x). TLC Those classloaders can't see the individual webapp classloaders. TLC However, libraries in your webapp *can* see Tomcat's plublic TLC classloaders (all bug server/lib, server/classes). TLC You may have to rearrange the location of your libraries. TLC Jake TLC Tuesday, August 13, 2002, 9:29:19 AM, you wrote: TLC Hi all, TLC I'm trying to resolve this problem with all the solutions that you TLC gave TLC me, but it doesn't work... TLC This is what I did: TLC in my java bean (not a servlet), I have this code: TLC public class DbBean { TLCpublic int Connect() { TLCInputStream is = TLC TLC Thread.currentThread().getContextClassLoader().getResourceAsStream (config.txt); TLC if (is == null) { TLC return 0; TLC } TLC else { TLC return 1; TLC } TLC } TLC then in my jsp, I called this method, and then I write the value (0 TLC or TLC 1).. TLC The txt file is in WEB-INF/classes/beans..., because DbBean is in TLC a TLC package called beans, and I start tomcat from TOMCAT_HOME/bin.. TLC When I load the jsp, the method Connect of the DbBean (java bean) TLC returned TLC 0, which means the InputStream is null, but if I put the txt file in TLC TOMCAT_HOME/bin, I had no problem, the method returned 1 why TLC is TLC that??.. I'm using Tomcat 3.2 TLC Do I need to set something else in Tomcat?? TLC thanks again TLC Alex Tomita TLC Drinkwater, GJ (Glen) [EMAIL PROTECTED] TLC
OT: howto avoid overuse of session object?
This is sort of off-topic, but I don't know of a better forum targeting Java web/servlet programming. If anyone does know of one, could you let me know? I'm basically wondering if others have found effective ways to avoid the tempting but bad practice of loading up the session with all sorts of attributes. I often find myself needing some Bean or other object for maybe 2 or 3 requests, and, rack my brains as I may for an elegant way of passing the object along without putting it in the session, I usually end up with nothing more than a headache and 1 more attribute in my session. :( I'm developing with an MVC approach, with Struts for more recently developed apps and a similar custom framework for our older apps, but I just can't seem to see a way to get around this problem. I would love it if there were an object like a thisRequestAndTheNextOne object, where attributes would stick around for the current request and subsequent request, and then the controller could get objects from the previous request and determine if it should put them in the new thisRequestAndTheNextOne object for the current request. I don't know if that makes sense to anyone else, but, nevertheless, does anyone have any ideas to do what I'm trying to do? Does anyone else feel my pain? ;) Thanks, -Jeff -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: howto avoid overuse of session object?
Thanks, Cédric and Peter Lin, for your responses. Both of you seem to be saying that, instead of storing large objects in the session object, I should be storing them in the application object (ServletContext). I find this to be rather confusing. It seems like the overhead involved in storing things in the application object would be much greater than storing things in the session object. At least the session objects would eventually die when sessions time out or they are invalidated by the web app, and the space they were using could then be garbage collected. But the application objects would live as long as the server is up, and I would think would eventually consume memory moreso than using the session would. Also, there would be a extra level of complexity involved with maintaining the association between the objects in the application object and their respective sessions. Am I unclear on the concept, or is there something else that I'm not understanding? Thanks, -Jeff Cédric Viaud cedric.viaud@matraTo: Tomcat Users List [EMAIL PROTECTED] si-tls.fr cc: Subject: Re: howto avoid overuse of session object? 08/01/02 11:30 AM Please respond to Tomcat Users List Hi, FIRST For non-specific Tomcat questions, it exists : [EMAIL PROTECTED] There's also an other one wich is JSP oriented. SECOND All best practice i know says that you must minimize the ammount of data stored in the session. So, the traditional approach of this problem is to only store the user-id (simple type) in the session. All over session informations (a class containing all required informations) are stored in the servlet context. Praticaly, on the request you get the user id from the user session. Next you use this Id to get the user information obect from the servlet context. This is certainly deceiving, but this is the way ... Maybe someone knows better practice ? Regards, Cédric - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 01, 2002 6:13 PM Subject: OT: howto avoid overuse of session object? This is sort of off-topic, but I don't know of a better forum targeting Java web/servlet programming. If anyone does know of one, could you let me know? I'm basically wondering if others have found effective ways to avoid the tempting but bad practice of loading up the session with all sorts of attributes. I often find myself needing some Bean or other object for maybe 2 or 3 requests, and, rack my brains as I may for an elegant way of passing the object along without putting it in the session, I usually end up with nothing more than a headache and 1 more attribute in my session. :( I'm developing with an MVC approach, with Struts for more recently developed apps and a similar custom framework for our older apps, but I just can't seem to see a way to get around this problem. I would love it if there were an object like a thisRequestAndTheNextOne object, where attributes would stick around for the current request and subsequent request, and then the controller could get objects from the previous request and determine if it should put them in the new thisRequestAndTheNextOne object for the current request. I don't know if that makes sense to anyone else, but, nevertheless, does anyone have any ideas to do what I'm trying to do? Does anyone else feel my pain? ;) Thanks, -Jeff -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: putting custom code in front of Struts Main Servlet
This also depends on when you want the code executed. I believe overriding init will only make that code execute when the servlet is first created. If you want code executed on every call to the process method, someone here did it by overriding the processPreprocess (method name? - have to check ActionServlet source) method and do the rest of the stuff Mike has suggested. HTH Michael Remijan Michael.Remijan@soTo: Tomcat Users List [EMAIL PROTECTED] locup.com cc: Subject: RE: putting custom code in front of Struts Main Servlet 07/31/02 08:16 AM Please respond to Tomcat Users List What I did is extend the org.apache.struts.action.ActionServlet override the init() method and then in WEB-INF/web.xml use the name of your class for the servlet-class.../servlet-class entry. Mike -Original Message- From: Chris Ruegger [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 8:18 AM To: Tomcat Users List Subject: putting custom code in front of Struts Main Servlet This is a bit off topic but we are using Tomcat with Struts. We want to be able to always execute some code before the Struts servlet is invoked, to check for things like lost session, permission, etc. What is the best way to do this? I'm thinking either have a servlet that we send everything to, then have it call the Struts servlet, or use servlet filters somehow (have not used them yet but vaguely familiar with them) What approaches have others used for this? Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
manager app
Anybody have any ideas what I could be doing wrong? This is how I have my tomcat-users.xml file set up in my $CATALINA_HOME/conf directory. I've done a restart (actually several) since adding tcuser. When I try to go to http://localhost:8080/manager, it prompts me for username and password. I enter tcuser and tcpass in, and, after 3 attempts, it brings me to a 401 - Unauthorized screen. I'm running Tomcat 4.0.3 on RedHat Linux 6.2. I don't see what could be going on, since this seems like a pretty straightforward thing. Any place I could look that may be short-circuiting my manager app? Thanks, -Jeff !-- NOTE: By default, no user is included in the manager role required to operate the /manager web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. -- tomcat-users user name=tomcat password=tomcat roles=tomcat / user name=role1 password=tomcat roles=role1 / user name=both password=tomcat roles=tomcat,role1 / user name=tcuser password=tcpass roles=manager / /tomcat-users -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: manager app
Thanks for the suggestion, Derrick. I just double-checked the manager app's web.xml, and it looks good. I haven't changed it from the default installation anyway, but here's what the security-constraint looks like. !-- Define a Security Constraint on this Application -- security-constraint web-resource-collection web-resource-nameEntire Application/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint !-- NOTE: This role is not present in the default users file -- role-namemanager/role-name /auth-constraint /security-constraint Any other thoughts? Thanks, -Jeff Koes, Derrick Derrick.Koes@Smith-NTo: 'Tomcat Users List' [EMAIL PROTECTED] ephew.com cc: Subject: RE: manager app 07/25/02 12:21 PM Please respond to Tomcat Users List Have you checked your web.xml? Do you have a security-constraint? You may need one. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 1:09 PM To: [EMAIL PROTECTED] Subject: manager app Anybody have any ideas what I could be doing wrong? This is how I have my tomcat-users.xml file set up in my $CATALINA_HOME/conf directory. I've done a restart (actually several) since adding tcuser. When I try to go to http://localhost:8080/manager, it prompts me for username and password. I enter tcuser and tcpass in, and, after 3 attempts, it brings me to a 401 - Unauthorized screen. I'm running Tomcat 4.0.3 on RedHat Linux 6.2. I don't see what could be going on, since this seems like a pretty straightforward thing. Any place I could look that may be short-circuiting my manager app? Thanks, -Jeff !-- NOTE: By default, no user is included in the manager role required to operate the /manager web application. If you wish to use this app, you must define such a user - the username and password are arbitrary.-- tomcat-users user name=tomcat password=tomcat roles=tomcat / user name=role1 password=tomcat roles=role1 / user name=both password=tomcat roles=tomcat,role1 / user name=tcuser password=tcpass roles=manager / /tomcat-users -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue
Hi, Dave. Did you check your log files for exceptions? I've seen behavior similar to what you're describing with Tomcat 4.0.x running Standalone. What I've seen is that it gets a full buffer's (defaults to 8K, like you're seeing, but can be set to different size) worth of content and displays it. Then, it runs into a NullPointerException (or probably some other exception, but, usually for me, it's a good ole NPE) while trying to generate the next buffer's worth of content. At this point, the browser doesn't show an error page but just stops with only the one buffer's worth of content displayed. Maybe Apache renders the page as blank, but I usually get the partially returned page, as far as it can be rendered. Besides the partial page, the only sign that something went wrong is in the log. I've been meaning to look into this to see if it's a reported bug, but haven't yet. Is this what you're running into? -Jeff Short, Dave dave.short@pTo: 'Tomcat Users List' [EMAIL PROTECTED] fizer.com cc: Subject: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue 07/24/02 10:59 AM Please respond to Tomcat Users List There is an issue with Apache 2.0.39 and Tomcat 4.1.8 (actually this issue first appeared with Apache 2.0.36 and Tomcat 4.0.x). It seems, if a servlet returns content (dynamically built HTML for instance) which exceeds 8192 in length, the content is truncated at 8192 and a blank page is rendered by Apache. Actually, Apache renders what was returned by Tomcat (8192 bytes of the dynamically generated HTML page). Basically, an incomplete HTML page - hence it is displayed as blank. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: RequestDispatcher forward versus response.sendRedirect
Hi, Jason. I believe that that is precisely the intended use of the response.sendRedirect ... when you are redirecting OFF your site (to an absolute path). The specs say that sendRedirect takes an absolute path, so it is not good to use for forwarding around within your site, where relative paths are obviously best. Good to hear that you're using the RequestDispatcher for this purpose now. HTH, -Jeff Sullivan, Mark E Mark.Sullivan@nav-internatTo: 'Tomcat Users List' [EMAIL PROTECTED] ional.com cc: Subject: RE: RequestDispatcher forward versus response.sendRedirect 07/24/02 11:13 AM Please respond to Tomcat Users List when you say response.sendRedirect doesn't work, what kind of error/unexpected behavior are you getting? -Original Message- From: Jason Stortz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 11:12 AM To: Tomcat Users List Subject: RequestDispatcher forward versus response.sendRedirect Anyone have any hard and fast rules, good links, general info, do and don't lists, or anything about these two? We moved from iPlanet 4.1 where we did all redirection with response.sendRedirect. That didn't work with tomcat so I started using the forward method of RequestDispatcher. Well, now I need to use a NON relative path to redirect the user off our site. While I think response.sendRedirect will work in this instance I cannot seem to formulate a theory why it works here and not in other parts of our site. Does anyone have any information on this I can read, or advice? Thanks! Jason -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: RequestDispatcher forward versus response.sendRedirect
As far as I know, it sounds right to me... Jason Stortz jstortz@quoteTo: Tomcat Users List [EMAIL PROTECTED] smith.comcc: Subject: RE: RequestDispatcher forward versus response.sendRedirect 07/24/02 11:29 AM Please respond to Tomcat Users List Jeff, Thanks for reply. So, probably always use response.sendRedirect with absolute url to something out of my webapp, but RequestDispatcher for moving to other sources inside my webapp? Does that sound right? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 11:25 AM To: Tomcat Users List Subject: RE: RequestDispatcher forward versus response.sendRedirect Hi, Jason. I believe that that is precisely the intended use of the response.sendRedirect ... when you are redirecting OFF your site (to an absolute path). The specs say that sendRedirect takes an absolute path, so it is not good to use for forwarding around within your site, where relative paths are obviously best. Good to hear that you're using the RequestDispatcher for this purpose now. HTH, -Jeff Sullivan, Mark E Mark.Sullivan@nav-internatTo: 'Tomcat Users List' [EMAIL PROTECTED] ional.com cc: Subject: RE: RequestDispatcher forward versus response.sendRedirect 07/24/02 11:13 AM Please respond to Tomcat Users List when you say response.sendRedirect doesn't work, what kind of error/unexpected behavior are you getting? -Original Message- From: Jason Stortz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 11:12 AM To: Tomcat Users List Subject: RequestDispatcher forward versus response.sendRedirect Anyone have any hard and fast rules, good links, general info, do and don't lists, or anything about these two? We moved from iPlanet 4.1 where we did all redirection with response.sendRedirect. That didn't work with tomcat so I started using the forward method of RequestDispatcher. Well, now I need to use a NON relative path to redirect the user off our site. While I think response.sendRedirect will work in this instance I cannot seem to formulate a theory why it works here and not in other parts of our site. Does anyone have any information on this I can read, or advice? Thanks! Jason -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue
Hmm...no exceptions - I guess this is a different problem than what I've run into then. Sorry I couldn't help. Good luck with your troubleshooting. To change buffer size, you can use the JSP directive: %@ page buffer=16kb % or, I believe you can set it on the response with setBufferSize( bufferSize ) ...not sure what unit the parameter value represents off the top of my head though - would have to check API. -Jeff Short, Dave dave.short@pTo: 'Tomcat Users List' [EMAIL PROTECTED] fizer.com cc: Subject: RE: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue 07/24/02 12:07 PM Please respond to Tomcat Users List I didn't notice exceptions in either the Apache2\logs or Tomcat\logs directories. How can I set the buffer to a larger size? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: July 24, 2002 9:22 AM To: Tomcat Users List Subject: Re: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue Hi, Dave. Did you check your log files for exceptions? I've seen behavior similar to what you're describing with Tomcat 4.0.x running Standalone. What I've seen is that it gets a full buffer's (defaults to 8K, like you're seeing, but can be set to different size) worth of content and displays it. Then, it runs into a NullPointerException (or probably some other exception, but, usually for me, it's a good ole NPE) while trying to generate the next buffer's worth of content. At this point, the browser doesn't show an error page but just stops with only the one buffer's worth of content displayed. Maybe Apache renders the page as blank, but I usually get the partially returned page, as far as it can be rendered. Besides the partial page, the only sign that something went wrong is in the log. I've been meaning to look into this to see if it's a reported bug, but haven't yet. Is this what you're running into? -Jeff Short, Dave dave.short@pTo: 'Tomcat Users List' [EMAIL PROTECTED] fizer.com cc: Subject: Apache 2.0.39 and Tomcat 4.1.8 Servlet issue 07/24/02 10:59 AM Please respond to Tomcat Users List There is an issue with Apache 2.0.39 and Tomcat 4.1.8 (actually this issue first appeared with Apache 2.0.36 and Tomcat 4.0.x). It seems, if a servlet returns content (dynamically built HTML for instance) which exceeds 8192 in length, the content is truncated at 8192 and a blank page is rendered by Apache. Actually, Apache renders what was returned by Tomcat (8192 bytes of the dynamically generated HTML page). Basically, an incomplete HTML page - hence it is displayed as blank. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Error - Please Help
Shouldn't moving the tools.jar be unnecessary if JAVA_HOME is set properly?? Jacob Lund jacob@qualiwTo: 'Tomcat Users List' [EMAIL PROTECTED] are.com cc: Subject: RE: Error - Please Help 07/12/02 09:14 AM Please respond to Tomcat Users List An installation of sun java does not set environmental variables! You have to go to system in your control panel and add it your self! /Jacob -Original Message- From: Sunit Munjal [mailto:[EMAIL PROTECTED]] Sent: 12. juli 2002 16:07 To: Tomcat Users List Subject: RE: Error - Please Help I just installed the SDK for all languages and it still doesn't work. Reynir mentioned something about putting the tools.jar into my tomcats classpath. What does that mean. Just copying and pasting the file in tomcat/common/lib/ directory or does it involve changing/adding a path somewhere. Thanks. Message History From: Reynir Hübner [EMAIL PROTECTED] on 07/12/2002 01:15 PM GMT Please respond to Tomcat Users List [EMAIL PROTECTED] To:Tomcat Users List [EMAIL PROTECTED] cc: Subject:RE: Error - Please Help put tools.jar from your jsdk into tomcats classpath (for example into tomcat/common/lib/ ) that should fix it -reynir -Original Message- From: Sunit Munjal [mailto:[EMAIL PROTECTED]] Sent: 12. júlí 2002 13:18 To: [EMAIL PROTECTED] Subject: Error - Please Help Hi, I just installed Tomcat and setup JDK, but can't see any thing. I always get an error. I was trying the same thing in WebLogic before, but had an error over there. I can view the index.html page fine on my local host, but when I try to view a JSP page. I ge the following error: The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. javax.servlet.ServletException: sun/tools/javac/Main at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:481) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardC ontextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(Certificat esValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipel ine.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContex t.java:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHost Valve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi spatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardP ipeline.java:564) at
Re: Beans in packages vs beans not in packages
Hi, Ron. This is because Tomcat puts the servlets generated from JSP's in the org.apache.jsp package. Therefore, when you reference your bean with no package specified, it looks for it in this package and does not find it there. You should see that as part of the error message - something like Cannot find class org.apache.jsp.YourBean. Hope that clears things up. -Jeff Ron Day ronday@rondaTo: [EMAIL PROTECTED] y.cccc: Subject: Beans in packages vs beans not in packages 07/10/02 05:20 PM Please respond to Tomcat Users List Hi, When I run a webapp with a bean in a package -- say com.form, everything works fine. But when I try to run a bean that is not in a package I always get class not found error. 1)I am using usebean in both cases, one has class name, one has full package name. 2)Bean has package name in one but no in the other. 3)Bean is in class directory at top level for no package, and in correct package directory structure for package. There are no other changes, except to recompile bean, and restart tomcat. Any help appreciated. ron -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot use bean from jsp, but servlet ok. I'm dying!
I think it is just a simple syntax error. The JSP expression tag on your userName text field is incorrect - needs to be %= without the space. You have a scriptlet with =FormBean.getUserName() trying to be executed. It's interesting to see that it looks like Tomcat equates an equals sign before a class as an out.print on that class. HTH, -Jeff eric edahnke@eartTo: [EMAIL PROTECTED] hlink.net cc: Subject: Cannot use bean from jsp, but servlet ok. I'm dying! 07/11/02 11:43 AM Please respond to Tomcat Users List Help. Absolutely stuck. Tomcat cannot find my bean classes no matter what when called from jsp pages. From within servlets no problem. Here is the jsp --- %@ include file=pub_hdr.html % jsp:usebean id=FormBean class=beans.FormBean scope=request / form input type=text name=userName value=% =FormBean.getUserName() % %= FormBean.getErrorMsg(userName) % /form %@ include file=pub_ftr.html % Here is the bean package beans; import java.util.*; import java.io.Serializable; public class FormBean implements Serializable { public String userName; public FormBean() {} public String getUserName() { return this.userName; } public void setUserName(String uname) { this.userName = uname; } } NO MATTER WHAT, as soon as I access the jsp page. This error comes up. Generated servlet error: C:\jwsdp-1_0\work\Standard Engine\localhost\messagesmith\en\users$jsp.java:126: Undefined variable or class name: FormBean out.print( FormBean.getUserName() ); It certainly seems that TC cannot find the FormBean class which lives here: C:\jwsdp-1_0\webapps\project\WEB-INF\classes\beans. I've changed that scope attribute to application or page, but it doesn't change. With TC3.x I had to do some configuration in the conf/server.xml file, but this doesn't seem necessary w/ TC4. All the same I've adding the following context to the server.xml, but it doesn't help. Context path=/project docBase=webapps/project debug=0 reloadable=true / Anyone have any ideas? It is killing me. Again, I can instantiate the FormBean class from within servlets, but not from JSP. Env: Win2k Server, jdk1.4.0_01, TC4.0 Classpath=.;C:\jwsdp-1_0\common\lib\servlet.jar;C:\jwsdp-1_0\webapps\project \WEB-INF\classes;C:\jfreechart-0.9.1\jars\jcommon-0.6.3.jar;C:\jfreechart-0. 9.1\jars\jfreechart-0.9.1.jar; TOMCAT_HOME=C:\jwsdp-1_0 CATALINA_HOME=C:\jwsdp-1_0 JAVA_HOME=C:\j2sdk1.4.0_01 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cannot use bean from jsp, but servlet ok. I'm dying!
Actually, no, it looks like I was mistaken. Looking again at the error message, it does seem like the seemingly malformed tag is understood to be a JSP expression tag and the generated servlet code is correctly set to out.print( FormBean.getUserName() ); Sorry, don't know what the problem is then. jeff.guttadauro@ abbott.com To: Tomcat Users List [EMAIL PROTECTED] cc: 07/11/02 11:47 Subject: Re: Cannot use bean from jsp, but servlet ok. I'm dying! AM Please respond to Tomcat Users List I think it is just a simple syntax error. The JSP expression tag on your userName text field is incorrect - needs to be %= without the space. You have a scriptlet with =FormBean.getUserName() trying to be executed. It's interesting to see that it looks like Tomcat equates an equals sign before a class as an out.print on that class. HTH, -Jeff eric edahnke@eartTo: [EMAIL PROTECTED] hlink.net cc: Subject: Cannot use bean from jsp, but servlet ok. I'm dying! 07/11/02 11:43 AM Please respond to Tomcat Users List Help. Absolutely stuck. Tomcat cannot find my bean classes no matter what when called from jsp pages. From within servlets no problem. Here is the jsp --- %@ include file=pub_hdr.html % jsp:usebean id=FormBean class=beans.FormBean scope=request / form input type=text name=userName value=% =FormBean.getUserName() % %= FormBean.getErrorMsg(userName) % /form %@ include file=pub_ftr.html % Here is the bean package beans; import java.util.*; import java.io.Serializable; public class FormBean implements Serializable { public String userName; public FormBean() {} public String getUserName() { return this.userName; } public void setUserName(String uname) { this.userName = uname; } } NO MATTER WHAT, as soon as I access the jsp page. This error comes up. Generated servlet error: C:\jwsdp-1_0\work\Standard Engine\localhost\messagesmith\en\users$jsp.java:126: Undefined variable or class name: FormBean out.print( FormBean.getUserName() ); It certainly seems that TC cannot find the FormBean class which lives here: C:\jwsdp-1_0\webapps\project\WEB-INF\classes\beans. I've changed that scope attribute to application or page, but it doesn't change. With TC3.x I had to do some configuration in the conf/server.xml file, but this doesn't seem necessary w/ TC4. All the same I've adding the following context to the server.xml, but it doesn't help. Context path=/project docBase=webapps/project debug=0 reloadable=true / Anyone have any ideas? It is killing me. Again, I can instantiate the FormBean class from within servlets, but not from JSP. Env: Win2k Server, jdk1.4.0_01, TC4.0 Classpath=.;C:\jwsdp-1_0\common\lib\servlet.jar;C:\jwsdp-1_0\webapps\project \WEB-INF\classes;C:\jfreechart-0.9.1\jars\jcommon-0.6.3.jar;C:\jfreechart-0. 9.1\jars\jfreechart-0.9.1.jar; TOMCAT_HOME=C:\jwsdp-1_0 CATALINA_HOME=C:\jwsdp-1_0 JAVA_HOME=C:\j2sdk1.4.0_01 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Need Ideas... big problem! (long)
Well, the classes themselves wouldn't be used to get the init params or read the db.properties file. You would use a Servlet to do that, and then you would just pass the params (or Connections created from those params - however you're doing things) to the instance of the DAO class you would be using in your application/session/request. HTH, -Jeff Christian J. Dechery To: [EMAIL PROTECTED] christian@fincc: ep.gov.brSubject: RE: Need Ideas... big problem! (long) 07/10/02 07:27 AM Please respond to Tomcat Users List ok... but remember that all the classes will reside in the common\classes dir... So how will the class know which context accessed it? That's what I can't figure out... I tought about config files... but I don't know inside the dispatcher class how to identify the context... or to read the proper config file... .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332 [EMAIL PROTECTED] 09/07/02 17:24 If you don't want to go the JNDI route, you could also do something like set init params in each application's web.xml file with the db connection info or create a .properties file for each application and read in the db connection info from that. HTH, -Jeff Kranson, Bob Bob_Kranson@comp To: 'Tomcat Users List' [EMAIL PROTECTED] uware.com cc: Subject: RE: Need Ideas... big problem! (long) 07/09/02 02:41 PM Please respond to Tomcat Users List Why don't you store the JDBC URL in JNDI and have DAO look it up dynamically Bob Kranson Software Technical Support Analyst UNIFACE and Optimal Products Technical Support U.S. Support Center 888-551-0404 New Calls: [EMAIL PROTECTED] 31440 Northwestern Hwy, Farmington Hills, MI 48334-2564 (248)737-7300 x12702 Fax:(248)737-7574 -Original Message- From: Christian J. Dechery [ mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 2:38 PM To: [EMAIL PROTECTED] Subject: Need Ideas... big problem! (long) I have a huge problem here... and I can't think of a simple solution for it, I'm hoping u guys can give some light. :) Let me first describe the environment here, then the problem. We have here a webapp called FAP (c:\tomcat\fap). It is composed of: /fap/*.jsp (like a hundred of them) /fap/WEB-INF/classes/finep (this package finep has a lot of subpackages) /fap/WEB-INF/classes/finep/DAO.class -- here the problem resides... /fab/lib/OracleDrivers.jar the class DAO provides the Connection to an Oracle database... so far, everything is fine... but here's the thing... this webapp gets replicated... the whole dir, because there are other instances of this system with small changes, and we didn't have the time to create a self-configuring app to allow that... so we copy the whole dir and make the necessary changes... BUT... the classes never change... only the JSPs... AND another thing that may change is the database (and of course DAO)... so how it is done? we have /fap with DAO.class pointing to a specific db URL and; we have (for example) /fap2 with a few JSPs changes and DAO.class pointing to another URL. this of course sux! If we wanna change the database of a specific webapp we have to re-compile DAO and place it there... and if we change a class (any class) we have to update it in ALL the contexts... What I want: I would like to place the package finep and the OracleDrivers in the global context (c:\tomcat\common\classes, \lib), so all would be pretty and centralized; and create something like a Connection Dispatcher (also in the global context) that would receive requests from the JSPs and provide a Connection to the
Re: Need Ideas... big problem! (long)
Hi, Christian. I would recommend now taking a good look at the Java Servlet Specification and letting all these suggestions digest while you go through that. Things should start to make more sense once you have a better handle on servlets. Maybe take a look at the Tomcat servlet examples too. Your servlet should definitely have access to the request object, since if you look at the specs on HttpServlet, you'll see that it is passed as a parameter to its various methods. HTH, -Jeff Christian J. Dechery To: [EMAIL PROTECTED] christian@fincc: ep.gov.brSubject: Re: Need Ideas... big problem! (long) 07/10/02 12:30 PM Please respond to Tomcat Users List But I want the code I would write in the A class... cuz I will create a Servlet to provide a connection to the JSPs, but I don't wanna change the JSPs... inside my Servlet (A) I don't have access to the request object. Could u write some example code for the A class to figure in which context the method doSomething() was called? Thanks... .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332 [EMAIL PROTECTED] 10/07/02 13:51 On Wed, 10 Jul 2002, Christian J. Dechery wrote: Date: Wed, 10 Jul 2002 13:27:26 -0300 From: Christian J. Dechery [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Need Ideas... big problem! (long) I'm having some difficulty understanding the solution u guys provided me... maybe I explained my problem badly, so u aren't fully understanding it... but I have a question that is quite simple: Is it possible for a class (or Servlet) located in $tomcat_home\common\classes - that will be accessed from all webapps - to know from which context a JSP/Servlet called it? for example... I have a class A in common\classes and it has a method doSomething()... say I have a JSP $tomcat_home\webapps\test\1.jsp that looks something like: %@page import=A% % String x = A.doSomething(); % so... would it be possible for A to know that when doSomething() was called, the context was test? Sure ... that's really easy. You've got at least the following options: * Call request.getContextPath() and you'll get the context path of the web application that is responding to this request. * The application object in a JSP page is in fact the ServletContext for the current webapp, so you can call things like % Properties props = new Properties(); InputStream stream = application.getResourceAsStream(/WEB-INF/myprops.properties); props.load(stream); stream.close(); % to load a properties file from inside the WEB-INF subdirectory of your web application. As a general note, however, you should really be doing this sort of thing in startup code of a servlet, which stashes the results as servlet context parameters for everyone else to use. Using scriptlets to mix functional logic into your JSP pages is going to cause you maintenance nightmares over time. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Need Ideas... big problem! (long)
The servlet engine handles it for you. Definitely take a look at some examples and the servlet spec, and it'll start to make more sense. Christian J. Dechery To: [EMAIL PROTECTED] christian@fincc: ep.gov.brSubject: Re: Need Ideas... big problem! (long) 07/10/02 01:02 PM Please respond to Tomcat Users List exaclty... I looked on HttpServlet... request and response are passed as parameters... so I don't HAVE it. And since it's passed as a parameter I would have to change 150 JSPs to pass this new parameter... and I don't wanna change anything, only create a new class... if in the solution comes changing all the JSPs and classes I'm sure that's not the best one... I may have asked the wrong question... let's say: public class TesteDispatcher extends HttpServlet { private static final String CONTENT_TYPE = text/html; //Initialize global variables public void init() throws ServletException { } //Clean up resources public void destroy() { } public String doSomething() { // this is the method... } } Is there anyway doSomething() can know in which Context it was called? Remember that this class is in \common\classes. thanks for ur patience .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332 [EMAIL PROTECTED] 10/07/02 14:23 Hi, Christian. I would recommend now taking a good look at the Java Servlet Specification and letting all these suggestions digest while you go through that. Things should start to make more sense once you have a better handle on servlets. Maybe take a look at the Tomcat servlet examples too. Your servlet should definitely have access to the request object, since if you look at the specs on HttpServlet, you'll see that it is passed as a parameter to its various methods. HTH, -Jeff Christian J. Dechery To: [EMAIL PROTECTED] christian@fin cc: ep.gov.br Subject: Re: Need Ideas... big problem! (long) 07/10/02 12:30 PM Please respond to Tomcat Users List But I want the code I would write in the A class... cuz I will create a Servlet to provide a connection to the JSPs, but I don't wanna change the JSPs... inside my Servlet (A) I don't have access to the request object. Could u write some example code for the A class to figure in which context the method doSomething() was called? Thanks... .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332 [EMAIL PROTECTED] 10/07/02 13:51 On Wed, 10 Jul 2002, Christian J. Dechery wrote: Date: Wed, 10 Jul 2002 13:27:26 -0300 From: Christian J. Dechery [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Need Ideas... big problem! (long) I'm having some difficulty understanding the solution u guys provided me... maybe I explained my problem badly, so u aren't fully understanding it... but I have a question that is quite simple: Is it possible for a class (or Servlet) located in $tomcat_home\common\classes - that will be accessed from all webapps - to know from which context a JSP/Servlet called it? for example... I have a class A in common\classes and it has a method doSomething()... say I have a JSP $tomcat_home\webapps\test\1.jsp that looks something like: %@page import=A% % String x = A.doSomething(); % so... would it be possible for A to know that when doSomething() was called, the context was test? Sure ... that's really easy. You've got at least the following options: * Call request.getContextPath() and you'll get the context path of the web application that is responding to this request. * The application
RE: Need Ideas... big problem! (long)
If you don't want to go the JNDI route, you could also do something like set init params in each application's web.xml file with the db connection info or create a .properties file for each application and read in the db connection info from that. HTH, -Jeff Kranson, Bob Bob_Kranson@compTo: 'Tomcat Users List' [EMAIL PROTECTED] uware.com cc: Subject: RE: Need Ideas... big problem! (long) 07/09/02 02:41 PM Please respond to Tomcat Users List Why don't you store the JDBC URL in JNDI and have DAO look it up dynamically Bob Kranson Software Technical Support Analyst UNIFACE and Optimal Products Technical Support U.S. Support Center 888-551-0404 New Calls: [EMAIL PROTECTED] 31440 Northwestern Hwy, Farmington Hills, MI 48334-2564 (248)737-7300 x12702 Fax:(248)737-7574 -Original Message- From: Christian J. Dechery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 09, 2002 2:38 PM To: [EMAIL PROTECTED] Subject: Need Ideas... big problem! (long) I have a huge problem here... and I can't think of a simple solution for it, I'm hoping u guys can give some light. :) Let me first describe the environment here, then the problem. We have here a webapp called FAP (c:\tomcat\fap). It is composed of: /fap/*.jsp (like a hundred of them) /fap/WEB-INF/classes/finep (this package finep has a lot of subpackages) /fap/WEB-INF/classes/finep/DAO.class -- here the problem resides... /fab/lib/OracleDrivers.jar the class DAO provides the Connection to an Oracle database... so far, everything is fine... but here's the thing... this webapp gets replicated... the whole dir, because there are other instances of this system with small changes, and we didn't have the time to create a self-configuring app to allow that... so we copy the whole dir and make the necessary changes... BUT... the classes never change... only the JSPs... AND another thing that may change is the database (and of course DAO)... so how it is done? we have /fap with DAO.class pointing to a specific db URL and; we have (for example) /fap2 with a few JSPs changes and DAO.class pointing to another URL. this of course sux! If we wanna change the database of a specific webapp we have to re-compile DAO and place it there... and if we change a class (any class) we have to update it in ALL the contexts... What I want: I would like to place the package finep and the OracleDrivers in the global context (c:\tomcat\common\classes, \lib), so all would be pretty and centralized; and create something like a Connection Dispatcher (also in the global context) that would receive requests from the JSPs and provide a Connection to the specific URL based in which context that JSP was when the request was made. I don't know if that's possible... I'm just guessing... of course I want do this as painless as possible... cuz we have like 80 classes and more than 150 JSPs... to confuse??? My english also sux... sorry! .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332 The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Database locked by Tomcat
Hi, Kevin. Correction: Database locked by YOU! :) You've closed the statement but not the connection. You need a conn.close() after the commit. This shouldn't lock the database by itself, although if you keep leaving connections open, then you will eventually hit a connection max limit, which could be what's hanging it. I would also recommend that you put all that stuff in a try block and finally close the connection, something like this: Statement stmt = null; Connection conn = DriverManager.getConnection(dbfUrl, , ); try { // do some stuff conn.commit(); } catch(Exception e) { conn.rollback(); } finally { if ( stmt != null ) { try { stmt.close(); } catch(SQLException e) { // handle or ignore } } conn.close(); } HTH, Jeff Kevin Andryc kandryc@miser.To: Tomcat Users List [EMAIL PROTECTED] umass.edu cc: Subject: Database locked by Tomcat 06/11/02 12:44 PM Please respond to Tomcat Users List I am Running Tomcat 4.0 on Windows 2000. I have a servlet, which calls a program that connects to a DBF database natively (not using JDBC-ODBC) and updates records in the database. The problem I am having is that Tomcat does not release the database until I restart the Tomcat service. I close the connection and even do a commit(). Has anyone else had a problem and if so, is there a solution? Below is some sample code: Class.forName(dbfDriverName).newInstance(); Connection conn = DriverManager.getConnection(dbfUrl, , ); Statement stmt = conn.createStatement(); // do some stuff statement.close(); connection.commit(); Thanks, Kevin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Jspc i18n
It looks like the output is probably in UTF-8 format. If you use the %@ page contentType=text/html;charset=UTF-8 % directive in your page, that should instruct the browser to use that encoding for display. To see if this should work, you should be able to just manually change your browser's encoding to UTF-8 (Unicode) while viewing the page that currently doesn't work and have it display properly for you. HTH, Jeff Christian Bourque To: Tomcat Users List [EMAIL PROTECTED] christian@alicc: osoft.comSubject: Re: Jspc i18n 04/10/02 04:57 PM Please respond to Tomcat Users List Hi Jeff ! I can't use the attribute encoding, I think my app server doesn't implements the last JSP specs ! But I have an update to my problem, I did a diff on two different .java file based on the same jsp file : 1) the one generated by using jspc command line (the one that doesn't works) 2) the one generated by tomcat/jspc when accessed the first time by a browser (the one that works) Its really weird because there are almost identical (only the class name is different but this is normal), the french text is scrambled in both versions ! Even more weird, if I access the command line generated version page (#1) in IE I see this : Joyeux noël et bonne année !!! But if I do a view source of the page look at this : Joyeux noël et bonne année !!! Everything is fine !! Christian - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 10, 2002 4:55 PM Subject: Re: Jspc i18n Hi, Christian. I haven't run into this problem before, so I'm not sure, but it looks like the compiler is encoding the accented characters. Perhaps if you specify the JSP page's encoding, it won't do that anymore...? Try using a directive at the top of your JSP to do this, something like %@ page encoding =ISO-8859-1 % or whatever specific encoding/character set you are using. HTH, -Jeff Christian Bourque To: Tomcat Users List [EMAIL PROTECTED] christian@alicc: osoft.comSubject: Re: Jspc i18n 04/10/02 02:16 PM Please respond to Tomcat Users List Hi Jay ! No, the bad characters are in the .java files that jspc creates ! The text is clean in the .jsp file but as soon as I convert it to .java with jspc all french accent are scrambled ! Christian - Original Message - From: Jay Gardner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 10, 2002 2:42 PM Subject: RE: Jspc i18n Are all the correct characters in the .java files that jspc creates? --Jay Gardner -Original Message- From: Christian Bourque [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 12:49 PM To: Tomcat Users List Subject: Jspc i18n Hi ! I'm having a weird problem with JSPC. We have a bilingual web application (english/french), so when I pre-compile all my jsp pages the ones which contains french accent are all screwed up : Vous avez oublié votre mot de passe ? = Vous avez oubliÃ(c) votre mot de passe ? chaîne = chaÃ(r)ne ??? Christian -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL
Re: Jspc i18n
Hi, Christian. I haven't run into this problem before, so I'm not sure, but it looks like the compiler is encoding the accented characters. Perhaps if you specify the JSP page's encoding, it won't do that anymore...? Try using a directive at the top of your JSP to do this, something like %@ page encoding =ISO-8859-1 % or whatever specific encoding/character set you are using. HTH, -Jeff Christian Bourque To: Tomcat Users List [EMAIL PROTECTED] christian@alicc: osoft.comSubject: Re: Jspc i18n 04/10/02 02:16 PM Please respond to Tomcat Users List Hi Jay ! No, the bad characters are in the .java files that jspc creates ! The text is clean in the .jsp file but as soon as I convert it to .java with jspc all french accent are scrambled ! Christian - Original Message - From: Jay Gardner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 10, 2002 2:42 PM Subject: RE: Jspc i18n Are all the correct characters in the .java files that jspc creates? --Jay Gardner -Original Message- From: Christian Bourque [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 10, 2002 12:49 PM To: Tomcat Users List Subject: Jspc i18n Hi ! I'm having a weird problem with JSPC. We have a bilingual web application (english/french), so when I pre-compile all my jsp pages the ones which contains french accent are all screwed up : Vous avez oublié votre mot de passe ? = Vous avez oubliÃ(c) votre mot de passe ? chaîne = chaÃ(r)ne ??? Christian -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: NullPointerException when using JDBC ResultSet next() method
You sure that your test table has a test column? Change rs.getString (test) to rs.getString(1) to see if that works... HTH Philip Kazmier, CEM To: '[EMAIL PROTECTED]' RD [EMAIL PROTECTED] philip.kazmiercc: @nice.com Subject: NullPointerException when using JDBC ResultSet next() method 04/08/02 12:55 PM Please respond to Tomcat Users List I am getting this error in a servlet compiled on Win2K, using JDK1.3.1 and Tomcat 3.3 with MySQL 3.23.47: Location: /PSSoftware/servlet/ListAllOpenBugs Internal Servlet Error: java.lang.NullPointerException at ListAllOpenBugs.doGet(ListAllOpenBugs.java:45) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source) at org.apache.tomcat.core.Handler.invoke(Unknown Source) at org.apache.tomcat.core.Handler.service(Unknown Source) at org.apache.tomcat.facade.ServletHandler.service(Unknown Source) at org.apache.tomcat.core.ContextManager.internalService(Unknown Source) at org.apache.tomcat.core.ContextManager.service(Unknown Source) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source) at java.lang.Thread.run(Thread.java:484) Here is the servlet code: public class MySQLTest extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { Connection con = null; Statement stmt = null; ResultSet rs = null; res.setContentType(text/html); PrintWriter out = res.getWriter(); try { // Load the MySQL driver Class.forName(org.gjt.mm.mysql.Driver); //try { //Class.forName(twz1.jdbc.mysql.jdbcMysqlDriver); //} //catch(Exception e){out.println(e);} // Get a connection to the database con = DriverManager.getConnection(jdbc:mysql://localhost:3306/test?user=rootpass word=typhoon); // Create a statement object stmt = con.createStatement(); // Execute and SQL query, get a result set rs = stmt.executeQuery(SELECT * from test); // Display the result set as a list out.println(HTMLHEADTITLETest/TITLE/HEAD); out.println(BODY); out.println(UL); while(rs.next()) { out.println(LI + rs.getString (test)); } out.println(/UL); out.println(/BODY/HTML); } catch (ClassNotFoundException e) { out.println(Couldn't load the database driver- + e.getMessage()); }
Re: Multiple users share java bean?
If you have multiple users sharing the same bean, then that's what's going to happen. By synchronizing the get and set method, all you're doing is saying Make sure the user finishes this whole get or set method before any other user can start it. However, that won't prevent another user from calling the set method right after the first user does and before the first user has a chance to call the get method. Are you sure you want multiple users sharing the same bean here? Or do you want multiple users using multiple instances of the bean (what it sounds like to me)?? Chenming ZhaoTo: Tomcat Users List [EMAIL PROTECTED] [EMAIL PROTECTED]cc: u Subject: Re: Multiple users share java bean? 03/25/02 12:52 PM Please respond to Tomcat Users List Dniel, There is still one problem: the value set by the second user2 updated the value of the first user1 before finishing user1's work. I paste the code. Please take a look. public class test { int numEvents= 5; public synchronized int test() { int real=0; int eventCounter=0; while(eventCounter=numEvents) { real=eventCounter; // wait for 0.01 second try{wait(10);} catch(InterruptedException e){}; eventCounter++; } return real; } public synchronized int setNumEvents(int sec) { numEvents= sec; } } For example, I input 200 as the value of numEvents for user1. Before finishing user1's task, user2 input 100 as numEvents and begin his work. I hope I can get results 200 and 100 respectively. But I got 100 both. - Original Message - From: Daniel Hinojosa [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 25, 2002 11:35 AM Subject: Re: Multiple users share java bean? If it's a shared bean, sycnchronize it. Make sure that all mutators(Setters) are synchronized, and it would be a bad idea to do that to the accessors (mututors) are synchronized too. If you have more open than private member variables in this bean, make sure they are private. e.g. public void synchronized setName(String name) { . } -- Daniel Hinojosa -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Struggling for one week please Help Help..................
I would suspect that your return boolean line in your defineCFDatabase method would be causing problems. Uma Munugala u.munugala@CellFTo: 'Tomcat Users List' [EMAIL PROTECTED] usion.com cc: Subject: RE: Struggling for one week please Help 03/19/02 05:45 PMHelp.. Please respond to Tomcat Users List Hi Jim Thanks for replying I tried the way you suggested but it does not work, it gives me same problem. Thanks Uma -Original Message- From: James Williamson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 3:11 PM To: Tomcat Users List Subject: Re: Struggling for one week please Help Help.. Uma, You've defined it the wrong way round, it should be: public static boolean gDefaultConnectionIsOracle = false; Regards, James Williamson www.nameonthe.net - Original Message - From: Uma Munugala [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 19, 2002 10:27 PM Subject: Struggling for one week please Help Help.. Hi I have written a servlet which implements SingleThreadModel and used already existing public static syncronized classes to access database. these classes were used for standalone application. does static synchronized has any problem with servlets when I deployment my servlet and try to run it gives me error, its stack trace is below. when login reaches to access static synchronized class member or static synchronized class method Iam getting problem. Funny thing is sames servlet and same code works in java web server. Do I need to do some thing else in tomcat 4.0.4-b1 to make it work. I tried with tomcat 4.0.3 also. I have seen similar problem in archives but that work around does not work for me. __ Error _ javax.servlet.ServletException: Invoker service() exception at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java :508) at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at filters.ExampleFilter.doFilter(ExampleFilter.java:149) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at filters.ExampleFilter.doFilter(ExampleFilter.java:149) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:475) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at
Re: Large pages not completely displayed with IE 5.x and Tomcat 4 .0.x
I ran into what I think is this problem before too, and here's what I ended up finding... I noticed the same thing as you, that the HTML was incomplete. My HTML was stopped right in the middle of a big list of SELECT OPTION's. I thought there was something wrong with the particular option that it died on, but then I added some more options to the database before that option. The HTML then stopped on a different option. I noticed that the HTML source for the page with the problem was always 16k. I checked my JSP page buffer size, thinking that it was 16k and there was something causing it to not flush subsequent buffers, but I found that my buffer was set to the default of 8k, so I was getting 2 buffers' worth of output. I checked the logs and found that I had gotten a run-time exception in the execution of my JSP page towards the end of it. So, what it looked like was that, if it got a run-time exception but had already sent back a full buffer, it was not sending the usual exception stack trace in the resulting page. I was thinking that this might be a Catalina bug (was using 4.0.1), but I didn't investigate this further after I fixed the cause of the run-time error. Hope this helps. -Jeff Robin Lee tech_supportTo: Tomcat Users List [EMAIL PROTECTED], Michael @uls.comGerdau [EMAIL PROTECTED] cc: 03/12/02 Subject: Re: Large pages not completely displayed with IE 5.x and 11:05 AM Tomcat 4 .0.x Please respond to Tomcat Users List Hi, I had the same problem as you did... One of my pages would not completely load... Using: Tomcat 4.02, j2sdk1.4. Windows 2K/NT, doesn't matter.. happens on both. At first I thought that it was because it was large. But it wasn't the problem. The page in question returned about 150K of html code. Another page returned 600K and that ALWAYS displayed in its entirety. So, after some checking and testing, i discovered it is because i had too many objects open. (Instantiated objects galore). One thing i did to make it work is to make sure that each object that i instantiate is opened ONCE... (I use a java mapping strategy to get data from the database). Once i did that, the rest of the data would show up with no problem... That is one thing i would check and see if there are too many objects being instantiated (same ones all the time). That's my suggestion. Good luck, If that's not it, then i'm not sure what else it could be. :) ...Robin - Original Message - From: Michael Gerdau [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 7:08 AM Subject: RE: Large pages not completely displayed with IE 5.x and Tomcat 4 .0.x I think an obvious first couple of questions: 1. Is the page competing execution or is it throwing an exception or perhaps hanging up due to deadlock? Not that I'm aware of. I get the effect by simply logging onto the webapp from a different machine immediately after starting tomcat. No concurrent users on Tomcat. This happens both with HTTP/1.1 on port 8080 and HTTP/1.0 on 8082 (both using the default configuration as of server.xml) 2. Are you ever clicking the stop button in IE (perhaps causing the browser to give up before the connection is completed?) No. Hi ! I have the following problem: I'm running Tomcat 4.0.x (x == 1, 2 or 3) standalone on a Win2000 machine. I have a WebApp (written with Struts) that accesses a RDBMS and creates pages which occasionally are 100+ kB in size. This takes some time (between 20-50 seconds). When I run Internet Explorer 5.0 or 5.5 on the machine running Tomcat (e.g. my development environment) everything works fine. When I'm trying to access those pages from another machine
Re: Error 500, Examples work
I ran into this a while back. Attribute page has no value!? ...quite a bizarre error, isn't it? I think that what I found out about this was that it happens for particularly large jsp pages (not large in terms of lots of HTML output but in terms of having lots of code in them) for some unknown reason. I believe that the solution was either to increase the heap size (using -Xms and -Xmx in the java command parameters) and/or to specify that java was running in server mode (I forget where that is done now - anyone?). HTH, -Jeff Heiko LettmannTo: [EMAIL PROTECTED] h.lettmann@acc: irsoft.de Subject: Error 500, Examples work 03/13/99 03:04 PM Please respond to Tomcat Users List These are the error messages I get when I try to open a *jsp file: org.apache.jasper.compiler.ParseException: /zeit.jsp(3,15) Attribute page has no value at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563) at org.apache.jasper.compiler.JspReader.parseTagAttributesBean(JspReader.java:6 16) at org.apache.jasper.compiler.Parser$Bean.accept(Parser.java:654) at org.apache.jasper.compiler.Parser.parse(Parser.java:1145) at org.apache.jasper.compiler.Parser.parse(Parser.java:1103) at org.apache.jasper.compiler.Parser.parse(Parser.java:1099) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe rvlet.java:177) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:189) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at
Re: Help : Error Starting Tomcat 4.0.1 in AIX
Did you actually look at these log files first? I only know a few words in French, but enough to see from your catalina.out that it could not create a jar file cache in your /tmp directory because it doesn't exist. The errors in the localhost_log file seem to result from this as well, so why don't you fix this first? If you still get errors, I would highly recommend reading your log files first before posting them to try to figure out your problem. If you do post, please give a better, more detailed account of what the problem is. -Jeff Andy Soedibjo [EMAIL PROTECTED]To: Tomcat Users List [EMAIL PROTECTED] a.slb.com cc: Subject: Help : Error Starting Tomcat 4.0.1 in AIX 03/11/02 02:21 PM Please respond to Tomcat Users List Hi Everyone, I've sent this mail before, but nobody answers it ... is it because none of you ever face this problem? I've tried to reinstall my tomcat and then run it directly, but still i have a problem. Is this a problem in the Tomcat, because i just install it, and run it with Tomcat's default configuration. I attach the log file that i got. Hope anyone of you give me suggestion / clues how to fix this problem. I appreciate all the suggestion or clue ... and i will try it. Thanks in advance. Best Regards, Andy S. (See attached file: localhost_log.2002-03-11.txt)(See attached file: catalina_log.2002-03-11.txt)(See attached file: catalina.out) -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] localhost_log.2002-03-11.txt Description: Binary data catalina_log.2002-03-11.txt Description: Binary data catalina.out Description: Binary data -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: How can I resolve this IllegalStateException: Response has a lrea dybeen committed problem?
If you are getting any pages back from the server, then you are using the response object! You may not be manipulating it with an explicit reference to it, but, when you have HTML or do an % out.println(STUFF) % or output a JSP expression like %= something % in your JSP pages, you are using the response object. And the deal is you can't forward if you've already started putting stuff in the response. What you should probably look into, and what some people are hinting at here, is using some sort of controller servlet that gets the request and then CALLS (not forwards to) the appropriate handler or action class. You can pass the request object along to your handler class so that you can get stuff from it or its session. Then, when your handler method is finished, you controller picks up immediately following its call to your handler. This allows you to have one very general controller servlet which can route the requests to more specialized handlers or actions depending on some parameter (command, action name) and can then handle forwarding to the appropriate new page. You might want to take a look at the Struts framework, which does this for you. Hope this helps. -Jeff lindsay.hamou [EMAIL PROTECTED]To: [EMAIL PROTECTED] cc: 03/08/02 Subject: RE: How can I resolve this IllegalStateException: Response 08:43 AM has a lrea dy been committed problem? Please respond to Tomcat Users List Don't think JSP is failing. It's quite a simple JSP and has been looked at exhaustively! Yes, I am setting session attributes in Create servlet, for use by create.jsp. I am only using the session object and the request throughout my application. The only time I ever knew I was using the response object was when I used response.sendRedirect(), but I don't use this anymore. I use the RequestDispatcher. There are no jsp:include or jsp:forward tags being used anywhere, and my servlets do not contribute anything to the response (apart from forwarding it around). Mark - your words of wisdom interest me. I thought that... when I invoke requestDispatcher.forward(), then control never returns (to the line following this invocation). So how do I go about returning to the Home servlet from the Create servlet. Surely I need to forward, because the session has changed? I have a lot to learn here I think, but I feel I'm getting closer to the holy grail - getting rid of this exception! -Original Message- From: Attila Szegedi [mailto:[EMAIL PROTECTED]] Sent: 08 March 2002 13:56 To:Tomcat Users List Subject:Re: How can I resolve this IllegalStateException: Response has a lrea dy been committed problem? I guess you JSP is failing with an uncaught exception. At that point, Tomcat would try to send a 500 Internal Server Error response code, but it can't since a 200 OK status code has already been sent (that is, the output committed) to the client. -- Attila Szegedi home: http://www.szegedi.org - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 2002. március 8. 14:45 Subject: RE: How can I resolve this IllegalStateException: Response has a lrea dy been committed problem? The exception seems to be occurring because the Home servlet forwards more than once (to different locations) - first to home.jsp, then later to the Create servlet. It is definitely the fact that it is forwarding to more than one place, that is causing the problem. I know this because if I call the Login servlet and fail the login authorization - this servlet consequently forwards to login.jsp more than once (first - to display the fresh login page, and second - to prompt user to try again). This however does not give me an exception. Given that my Home servlet is like the central servlet, it needs to be
Re: XSL - Reload a resource without restarting
Hi, Oliver. I can offer an idea (doubt it would qualify as brilliant though - sorry). If you do a getResource from the ServletContext, it will give you a java.net.URL. Then, maybe you could do an openConnection on the URL to get a URLConnection. Then, try the getLastModified method on that... Don't know if this will work, but figured I'd throw it out there as a suggestion. Best of luck, -Jeff -Ursprüngliche Nachricht- Von: Lauer, Oliver [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 28. Februar 2002 17:16 An: Tomcat Users List (E-Mail) Betreff: XSL - Reload a resource without restarting [snip] somebody a brilliant idea how to reload a resource dynamically within a webapp without having to restart. In my case I want to reload a XSL file only if it was changed. [snip] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Writing a bean
Additionally, there are syntax problems with your insert statement line as well (missing double quotes around the whole parameter). Might want to think about taking these kind of questions to a java newsgroup (comp.lang.java.help or comp.lang.java.programmer) for more/better responses, since they're not really Tomcat-related... yet. ;) HTH, -Jeff Mark markd@bellsoTo: Tomcat Users List [EMAIL PROTECTED] uth.net cc: Subject: Re: Writing a bean 02/25/02 01:05 PM Please respond to Tomcat Users List For starters, your lines of code using request.getParameter() seem to have syntax errors. The method getParameter() takes a String as it's argument and returns a String. At 10:01 PM 2/25/2002 +0530, you wrote: Hi, I wanted to write a java bean inside my JSP programme. My requirement is like this % Connection con = (.); statement = con.createStatement(); request.getParameter(name); request.getParameter(phone); rs = st.executeQuery(select * from uma where name=+name); if(rs.next()) { out.println(name is present in db); printContent(); } else { int x = st.executeUpdate(insert into uma values('+name+','+phone+'); } % % public void printContent() { I wanted to do some printing stuff here basically HTML coding. } % The printContent() method is giving me errors. I get Statement Expected near the above method. Can any one help me? If there is any other way could any one tell me what it is? Uma -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: still suffering character-encoding woes
Hi, Richard. I can definitely relate. This frustrated (sort of still does frustrate) me to no end. Let me try to explain what I understand after wrestling with this for a while. (gurus, if anything isn't quite right, please chime in!) 1.) The following are all supposed to have the same effect: - setting the META HTTP-EQUIV=ContentType CONTENT =text/html;charset=UTF-8 - using the JSP page directive %@ page contentType =text/html;charset=UTF-8 % - specifying response.setContentType(text/html;charset=UTF-8); These are all supposed to tell the browser what encoding to use when displaying the page it gets. I have found that the JSP directive works the best for me. The META tag didn't seem to be consistently working for me, and I find the JSP page directive easier to use than the response.setContentType. 2.) On the receiving end, when values are passed to you in the request, that's another issue. I'm not too sure how the charset for passing parameters is determined. I believe that they will be encoded according to the encoding of the page with the submitting form. I've also seen some discussion on specifying the char set in the Form tag, but it sounds like that doesn't work very well. Anyways, I have been able to get my parameters ok by setting the encoding for the page with the JSP directive mentioned above and then getting the parameter values like this... String param = request.getParameter(param); byte[] bytes = param.getBytes(UTF-8); String paramForDB = new String( bytes, UTF-8 ); I don't really understand what kind of transformation is happening with the getBytes and creation of the new String (***Can anyone else explain this to me?***), but it seems to get the job done. 3.) Also, make sure that your database can handle high-bit or extended ASCII values (greater than 127) in order to store the UTF-8 encoded data. Hope this helps. Please let me know if you come to an understanding of what's going on behind the scenes (I would LOVE to know!). Thanks. -Jeff Richard SandTo: Tomcat Users List [EMAIL PROTECTED] rsand@vgallecc: ries.comSubject: still suffering character-encoding woes 02/21/02 11:55 AM Please respond to Tomcat Users List Hi all, I've read with interest the recent threads about how to get posted form data to be handled properly containing special alphabetic characters used in many european languages. I've tried every suggestion that I saw in the threads to no avail, and am starting to tear my hair out. A quick summary: My development environment is Apache1.3.20, Tomcat 4.0.1, DB/2 on Windows2000, locale = Norwegian My production environment switches the database to Postgres and OS to Linux, environment has LANG=C and LC_CTYPE=iso-8859-1 Basically, on my development environment, everything works perfectly- i can post data containing norwegian characters and they are stored properly in the database and logged properly in the log files. On the production server, its '?' everywhere. Now to fix the problem, I've tried the following steps, in sequence: 1) I cut apache out of the loop and accessed tomcat directly to see if it interfered at all- no change 2) I added META HTTP-EQUIV=Content-Type CONTENT=text/html;charset=UTF-8 to inside my html-head tags 3) I added %@ page contentType=text/html; charset=UTF-8 to my JSP pages 4) Finally, I tried doing request.setCharacterEncoding(UTF-8) at the top of my doGet and doPut methods None of the first 3 steps helped- still that '?'- I should point out that
Re: Newbie can't run own JSP in Tomcat (404 - File Not Found)
Hi, Brian. This doesn't tell you that it can't find the class referenced in your JSP page. If that were the case, you wouldn't have gotten a 404 error - you would've gotten to a page with a class not found exception. That tells you that it can't find the JSP page itself. In order for Tomcat to know about your JSP page or a web application, you need to tell it about the new web context or put it somewhere Tomcat will naturally look for it. Tomcat will automatically create contexts for directories in its webapps directory, so one option would be to create a directory in there like mytest. If employees.jsp were in that directory, you'd go to http://localhost:8080/mytest/employees.jsp to get to it. The other option is to edit the conf/server.xml file to define a context somewhere else. There should be example(s) in there, so look at those and you should be able to figure it out. Hope this helps. -Jeff Brian PeaslandTo: [EMAIL PROTECTED] peasland@usgcc: s.gov Subject: Newbie can't run own JSP in Tomcat (404 - File Not Found) 02/17/02 11:17 AM Please respond to Tomcat Users List Hello, I'm running the following: Tomcat 3.3 w/ JDK 1.4.0 Microsoft IIS 5.0 I installed Tomcat as per the directions in Tomcat IIS HowTo. When I go to http://localhost:8080, I can get to the installed JSP examples. They all appear to run fine. So this tells me that Tomcat is up running just fine. Now I wish to run one of my own, albeit simple JSP pages that connects to a database and displays the results. When I try to load my JSP page in my browser, I get the 404 - File Not Found error message. I know that I've got the proper path to the JSP page. In my Tomcat window, I see the following error messages: Ctx() : Class not found: TOMCAT/JSP/dw/tkbrowse2/employees.jsp Ctx() : Status code: 404 request:R( + /dw/tkbrowse2/employees.jsp + null) msg:null This tells me that it can find the class I'm referencing in my JSP page. The only class in my JSP page is java.sql.*. I've added my jar files to my CLASSPATH environment variable for this class, but it still can't find it. Any ideas? Thanks, Brian == Brian Peasland - Database Administrator Raytheon Systems Company USGS - EROS Data Center Sioux Falls, SD 57198 Phone: (605) 594-2742 Fax: (605) 594-2525 Email: [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
restarting Tomcat 4
Hi. I was wondering if anyone out there has a good way of restarting Tomcat 4...? In version 3, I used to just be able to do $TOMCAT_HOME/bin/shutdown.sh; $TOMCAT_HOME/bin/startup.sh. Now, in version 4 though, since the starting and stopping scripts seem to have been modified to be background processes, this no longer works since it won't wait for the first script to finish anymore before starting the second one. Now, my restart alias looks like this: $CATALINA_HOME/bin/shutdown.sh; sleep 40; $CATALINA_HOME/bin/startup.sh. Pretty lame, and I just arrived at the sleep value by trial and error (actually as I add more stuff in my server.xml file, I think the shutdown might even take longer, so I may need to bump this value up). Does anyone have any more elegant/exact ways of doing this? Thanks, -Jeff -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: CDROM applications with tomcat
Hi, Franck. I'm not sure if this would work, but maybe you could try to define a $CATALINA_BASE that is on the hard disk while keeping the $CATALINA_HOME pointed to the CD...? Just a thought. Good luck. -Jeff Franck Delahaye franck.delahaye@xpTo: [EMAIL PROTECTED] s-pro.com cc: Subject: CDROM applications with tomcat 02/14/02 10:20 AM Please respond to Tomcat Users List Hi, I am new to tomcat and uses the 3.2 version to make a web application. I'd like to run tomcat from a cdrom on a windows boxe : after having tested my application on the hard disk, I have put the tomcat tree on a cd with a jvm and and launched the startup.bat script that launches tomcat It seems that tomcat wants to write in the log directory and also in the conf directory. Is it possible to make a specific configuration and launch tomcat sothat it does not try to write any files and run from a tomcat directory tree on a CDROM ? regards, Franck -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: CDROM applications with tomcat
Just noticed that you're using tomcat 3.2, so this wouldn't be an option unless you upgraded to version 4. I don't know of a way to do it under version 3 (doesn't mean there isn't one). jeff.guttadauro@ abbott.com To: Tomcat Users List [EMAIL PROTECTED] cc: 02/14/02 10:32 Subject: Re: CDROM applications with tomcat AM Please respond to Tomcat Users List Hi, Franck. I'm not sure if this would work, but maybe you could try to define a $CATALINA_BASE that is on the hard disk while keeping the $CATALINA_HOME pointed to the CD...? Just a thought. Good luck. -Jeff Franck Delahaye franck.delahaye@xpTo: [EMAIL PROTECTED] s-pro.com cc: Subject: CDROM applications with tomcat 02/14/02 10:20 AM Please respond to Tomcat Users List Hi, I am new to tomcat and uses the 3.2 version to make a web application. I'd like to run tomcat from a cdrom on a windows boxe : after having tested my application on the hard disk, I have put the tomcat tree on a cd with a jvm and and launched the startup.bat script that launches tomcat It seems that tomcat wants to write in the log directory and also in the conf directory. Is it possible to make a specific configuration and launch tomcat sothat it does not try to write any files and run from a tomcat directory tree on a CDROM ? regards, Franck -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Internationalization
Hi, Christopher. Here are some things to look into... - Make sure that your JSP page is set to use a font that can display the specific Unicode characters. If it's just a specific subset of the Unicode character set, then you may be able to find a lightweight font that handles that specific subset. If you need support for the whole Unicode character set, the only font I've found so far that handles this is Arial Unicode MS, which is a BIG font (about 24 Megs) and unfortunately, as you may have deduced from the MS in the name, is Microsoft and therefore a Windows-only font. - You may need to do some conversion of the parameter values coming over in the request or values that you retrieve from your database. I've been able to get the values out of the database (Oracle configured as extended-ASCII character set) by doing something like this... byte[] bytes = resultSet.getBytes(1); String stringToOutput = new String(bytes, UTF-8); Hope this helps! Good luck! -Jeff Christopher Cheng christopher@chengsfTo: 'Tomcat Users List' [EMAIL PROTECTED] amily.net cc: Subject: Internationalization 02/11/02 07:44 PM Please respond to Tomcat Users List I am struggling with double byte characters in JSP On the struts jsp form, I am putting %@ page contentType=text/html; charset=UTF-8 % on the top META http-equiv=Content-Type content=text/html; charset=UTF-8 in the head I got some question marks when I print the characters in the console by System.out.println(request.getParameter(parameter1) Or save those character to file The same thing happens with the data retrieved from MySQL displayed on JSP. Anybody helps? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Redirect after session expires?
There is no session.isInvalid() method - that wouldn't make any sense anyway. If you have an actual session to ask if it's valid or not, how could it ever be invalid? There is an isNew() method, and I have not used this, but from reading the spec it doesn't sound like it will do the trick. There is a way to define an errorPage, a page that your JSP will forward to if it throws an Exception. %@ page errorPage=relativeURL % You'll have to put this in each of your pages though, so it might not be what you're looking for, although then all the logic to handle the exception would just be in the errorPage. You could also look into binding the session by creating an object that implements HttpSessionBindingListener. Then when the session expires, the valueUnbound( event ) method will be called by the servlet engine. You could put code in that method to handle this case. Hope this helps. -Jeff Michael Molloy To: Tomcat Users List [EMAIL PROTECTED] mmolloy@ncyccc: les.com Subject: Re: Redirect after session expires? 02/13/02 09:54 AM Please respond to Tomcat Users List Well, we're trying to keep as much logic out of the jsps as possible, so if there is a setting for web.xml or something to foward all pages that throw exceptions to a certain url, that's what I'm looking for. I appreciate your suggestion, and if that's what we need to do, we'll do it, but I'd like to know about any other possibilities, also. Thanks --Michael On Wed, 13 Feb 2002 15:37:53 + David Cassidy [EMAIL PROTECTED] wrote: is there a session.isInvalid() method ? If so ... :) D Michael Molloy wrote: I've got an application that builds menus when a user logs in and sticks the menus in an object which I then put inside the session. All subsequent jsps get their menu from that object in the session. However, when their session expires and they try to access a jsp, they get a NullPointerException, as expected. How can I catch that error and redirect them to the logon page? Or is their some other way to handle it? Is there a better way than putting some if else statements in the jsp to check the session for the menu object? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Redirect after session expires?
Or you could just do that... :/ Very cool! Thanks for that nugget, Christopher. Christopher K. St. John To: Tomcat Users List [EMAIL PROTECTED] cks@distribucc: topia.com Subject: Re: Redirect after session expires? 02/13/02 10:57 AM Please respond to Tomcat Users List Michael Molloy wrote: ... if there is a setting for web.xml or something to foward all pages that throw exceptions to a certain url, that's what I'm looking for. In web.xml: error-page exception-type MyException /exception-type location /myexception.html /location /error-page the servlet spec[1] has a complete description in section SRV.9.9.2. [1] http://java.sun.com/products/servlet/download.html -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unjar a war??
jar -xf filename.war John Wadkin j.wadkin@hudTo: Tomcat Users List (E-mail) [EMAIL PROTECTED] .ac.uk cc: Subject: Unjar a war?? 02/13/02 11:45 AM Please respond to Tomcat Users List All, Is it possible to unjar a war file using something like jar -x? I've tried and nothing happens! TomCat obviously does it but how? Thanks, John -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Switching on UTF-8 Encoding
You can use %@ page contentType="text/html;charset=UTF-8" % in the JSP or alternatively include the META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" tag in your HTML. This will tell the browser to use the UTF-8 Encoding. Then when getting the requests, you can do a request.setCharacterEncoding ("UTF-8") before getting anything from the request to allow you to read in parameters as UTF-8. You could also try just reading in the parameters without setting that, and then doing param.getBytes("UTF-8"). I've been struggling with some encoding issues for a little while now, but I have it working, so if you have any other questions, please feel free to email me and I'll see if I can help. Good luck, -Jeff Antony Stace s45652001@yaTo: [EMAIL PROTECTED] hoo.com cc: Subject: Switching on UTF-8 Encoding 02/07/02 07:45 AM Please respond to "Tomcat Users List" Hi What do I need to do so that data returned from Tomcat 4 is returned in UTF-8 encoding to a requesting browser and requests received are read as UTF-8. -- Cheers Tony$B!#(B - _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: web.xml Question
It's included in $CATALINA_HOME/common/lib/servlet.jar. Tom Bednarz list@bednarzTo: [EMAIL PROTECTED] .ch cc: Subject: web.xml Question 01/22/02 01:48 AM Please respond to Tomcat Users List Hi everybody, Usually the web.xml file of a web application starts with the following: !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; This URL referst to the dtd file on SUN's server. I think most XML parsers like SAX need to read the dtd file to be able to parse the XML file. Questions: What happens if I deploy an application on an Intranet which allows access to the internet only through a proxy server (with username / password authentication)? The dtd cannot be accessed and must be someware on the local disk. I found that TOMCAT has a web.xml in its conf directory. Could anybody explain me, which XML files I need to change and where do I need to put the downloaded web-app_2_3.dtd file? Is the web.xml in the conf directory like a parent to all web.xml files found under webapps\application\WEB-INF? (Something like the defaults for all web apps)? Could anybody help me out of this XML jungle? Many thanks! Thomas -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: getInitParameter from within a bean?
Hi, Ross. This sort of defeats the purpose of beans. You should develop your beans without any dependencies whatsoever on servlet-specific stuff, like requests or sessions. This way, your model is independent of the web environment and could be used in some other context. Your servlet should get the request and handle it and also figure out any init parameters. Then, just pass the bean whatever it needs. HTH, -Jeff Fullerton Ross S To: '[EMAIL PROTECTED]' Ross.Fullerto[EMAIL PROTECTED] [EMAIL PROTECTED]cc: Subject: getInitParameter from within a bean? 01/17/02 05:06 AM Please respond to Tomcat Users List I've got a Bean that I want to be able to access some of the context-param entries in my web.xml on Tomcat 3.3. From the documentation, I access these values through String value = getServletContext().getInitParameter(name); I can't get this to work from within my bean, the compiler returns the following error: newUserBean.java:505: cannot resolve symbol symbol : method getServletContext () location: class newUserBean String emailReturnAddress = getServletContext().getInitParameter(emailReturnAddress); ^ 1 error Is there a way of accessing the context-params from within a bean rather than a servlet? Thanks, Ross Fullerton ICL Systems Engineer, Libra Project Phone: +44(0)118 377 5422 Internal: 730 35422 Mobile: +44(0)7810 697100 Address:Eskdale Road, Winnersh, Wokingham, Berkshire, RG41 5TT, UK. Internet: www.icl.com This e-mail is intended only for the addressee named above. As this e-mail may contain confidential or privileged information if you are not, or suspect that you are not, the named addressee or the person responsible for delivering the message to the named addressee, please telephone us immediately. Please note that we cannot guarantee that this message or any attachment is virus free or has not been intercepted and amended. The views of the author may not necessarily reflect those of the Company. International Computers Limited, Registered in England no 96056, Registered Office 26, Finsbury Square, London EC2A 1SL -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Use of Java Classes in .JSP fails under Tomcat 3.2
It's just like the message says... parseInt( String ) is not a method found in your jsp page. Make that Integer.parseInt(myString) and you're golden. also... fyi, you don't close the head tag in your html. HTH, -Jeff Jerry Jalenak Jerry.Jalenak@LTo: '[EMAIL PROTECTED]' ABONE.com [EMAIL PROTECTED] cc: 01/16/02 03:13 Subject: Use of Java Classes in .JSP fails under Tomcat 3.2 PM Please respond to Tomcat Users List org.apache.jasper.JasperException: Unable to compile class for JSP/usr/tomcat/work/localhost_8080%2Ftestapps/_0002fjavaTest_0002ejspjavaTes t_jsp_0.java:65: Method parseInt(java.lang.String) not found in class _0002fjavaTest_0002ejspjavaTest_jsp_0. int myInt = parseInt(myString) ; ^ 1 error -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Caching of JSPs within Tomcat
Hi, Michael. The %@ include ... % tag is a static include, and, once the page that includes something like this has been compiled, a change to the included file will not trigger a recompile of the page. As far as I know, you have to either change the modification date of the main page (can use touch on Unix, Linux to do this easily - don't know about Win XP) like you've done or delete the servlet in the work directory that was created from the page. The jsp:include .../ is a dynamic include that will cause the main page to be recompiled if the included page changes. I don't know of any way to configure a caching setting in Tomcat to change the way these are handled. HTH, -Jeff MTimpe@t-onli ne.deTo: TOMCAT Mailing List [EMAIL PROTECTED] (Michael cc: Timpe) Subject: Caching of JSPs within Tomcat 01/13/02 06:11 AM Please respond to Michael Timpe Hi, I have some trouble with the reload of JSPs. Basic data is - Win XP, Apache 1.3.xx, Tomcat 4.01, IE 6.0 (IE6 with the option to reload the page at each access) Suppose You have an JSP page prj_.jsp that includes another JSP page by using a tag like this: %@ include file=prj_0007.inc % If I have changed the file prj_0007.inc and I press Reload in the browser. The changes will have no effect (are not loaded into the browser). I have to change also the file prj_.jsp (by adding a blank line to the file to change the files modification date). How can I disable the caching of the JSPs within tomcat so that changes in included files have their effect? Greetings and thank you for your help Michael Timpe Melchiorstr. 24 50670 Köln eMail: [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat Apache JSP compilation error
Since it's not in the java.lang package (the one you get for free), you need to import the class... %@ page import=java.util.Vector % ... or reference it with its full package in your code. Stuart Stephen To: Tomcat Users List [EMAIL PROTECTED] swadge@swadgcc: e.co.uk Subject: Tomcat Apache JSP compilation error 01/14/02 08:31 AM Please respond to Tomcat Users List Hi all, For some reason i'm getting a class not found exception for a Vector? I can't think why the Vector class isn't found? Where should these classes be found or what am I doing wrong? The details are at the base of the email. Thanks Stuart Stephen An error occurred at line: 51 in the jsp file: /basket_edit_details_content.jsp Generated servlet error: T:\Tomcat\work\www.myonlineshop.com\shop\basket_0005fedit_0005fdetails_0005f content$jsp.java:128: Class org.apache.jsp.Vector not found. Vector points=(Vector)items.get(item_number); -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tomcat generating HTML character entities - WHY?
Hi. This seems to be a new thing in Tomcat 4. I have a page set to Unicode (UTF-8) encoding. When I submit the form on this page, the characters of the input values are getting magically (I hate when things are done magically) transformed into the corresponding HTML Unicode character entities, like #1234; for example. Anybody know where this sort of thing is controlled/configured in Tomcat? Thanks, -Jeff -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Problems with GET method
Hi, Luiz. I think the equals sign in the parameter value needs to be escaped. Take a look at the java.net.URLEncoder class to help with that. HTH, -Jeff Luiz Ricardo luizricardo@iTo: [EMAIL PROTECTED] tx.com.brcc: Subject: Problems with GET method 01/14/02 12:33 PM Please respond to Tomcat Users List Hi, I am trying to pass some parameters to my app by URL but when I try to get them I always get the null value when the parameter value contains the equal sign (=). If I try process the following URL www.server.com/page.jsp?var1=where+col=val and use request.getParameter(var1), it returns null. I would like to know if someone has faced this problem and/or has some solution?! Luiz Ricardo -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
form values being sent as HTML entities instead of UTF-8 chars
Hello. I'm having a problem which I believe is related to Tomcat 4, since I didn't see this happening on 3.2 before I upgraded. I have a form on a page that is set to UTF-8 character encoding. When I paste a Unicode character into an input field and submit the form, the characters are being received as HTML character entities ( for example, #1234; ) instead of the UTF-8 bytes. There seem to be so many encoding settings all over the place, and I'm really confused as to which settings control what. I used to just have the META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=UTF-8 tag in my page, and things worked fine before the upgrade. I thought that the tag would tell the browser which encoding to use, and it would handle displaying content using that encoding and would also submit form values in that same encoding. But, it seems as though Tomcat is affecting how the values are submitted. I've seen some discussion of a character encoding filter, but I'm not sure how it all works. I've seen a bunch of different things: the META tag, using a page directive for contentType, using a page directive for pageEncoding, using request.setCharacterEncoding, using response.setCharacterEncoding, using this SetCharacterEncodingFilter class. Could anyone offer some clarification of what the different ways to set character encoding do differently and in what situations they should be used? Thanks in advance for any light you can shed on this for me! -Jeff -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]