Tomcat security
Dear List, I am using tomcats integrated security options, available inside the web.xml (see below). When ever the session times out and the user makes a request for a html/or jsp page within this protected context, appears the login.jsp page. My problem is that my app uses frames, and when the user makes a request from a sub-frame the login page shows in this sub-frame window. Is there a simple way to configure in the web.xml, that the login.jsp page always is shown in the parent frame of the browser or document, so causing the whole window to be reloaded. I guess there isnt and I must do some jscript, or fiddle around with html. I would be extremely impressed if there would be a web.xml solution. regards BB p.s. It was very hard to find as Newbie, the email address to post this mail to!! +---+ | GIStec GmbH - Ihr Partner für GIS - Technologie | | | | Ben Bookey| | [EMAIL PROTECTED] Fraunhoferstraße 5 | | Tel 0 61 51 / 155 - 254 D-64283 Darmstadt | | Fax 0 61 51 / 155 - 259 http://www.gistec-online.de | | | | http://www.ingeoic.de http://www.geo-watermarking.de | +---+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Tomcat security
Hi Yoav Shapira, Thanks for the reply. I know my question is client based, but I thought the web.xml might have an option to specify target="_self" or something similar, for the login.jsp (that should be theoretically poss.?) woops. as regards mailing list, I have v. little xp with lists (at all) , and am not honestly sure how they work. I joined the list <[EMAIL PROTECTED]> because I thought then I would get an email to which I could post to (this email was not in this list either as far as I could see). In addition on this Tomcat website about mailing lists http://jakarta.apache.org/site/mail2.html#Tomcat I could not find reference to [EMAIL PROTECTED] Do I need to be registered (somehow- either digest or high traffic) to post questions to this list? regards Ben -Ursprüngliche Nachricht- Von: Shapira, Yoav [mailto:[EMAIL PROTECTED] Gesendet: Montag, 17. Mai 2004 15:25 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: Tomcat security Hi, The declarative security options offered by the Servlet Specification, those you refer to as the "integrated security options," have no understanding of the client side, i.e. the browser. There is no concept of frame or browser, so you can't do what you're asking for with these declarative security directives. As to finding the mailing list: I'm troubled that you found that so difficult. Links to the mailing list are on the top apache page (www.apache.org), top jakarta page (jakarta.apache.org), top tomcat page (jakarta.apache.org/tomcat), both the binary and source apache download pages (http://jakarta.apache.org/site/binindex.cgi, and http://jakarta.apache.org/site/sourceindex.cgi), the jakarta contact us page (http://jakarta.apache.org/site/contact.html), the home page of a new tomcat installation (webapps/ROOT/index.jsp), and many other locations. Where did you look or what made it difficult to find? Yoav Shapira Millennium Research Informatics >-Original Message- >From: Ben Bookey [mailto:[EMAIL PROTECTED] >Sent: Monday, May 17, 2004 9:12 AM >To: [EMAIL PROTECTED] >Subject: Tomcat security > > >Dear List, >I am using tomcats integrated security options, available inside the >web.xml >(see below). When ever the session times out and the user makes a request >for a html/or jsp page within this protected context, appears the login.jsp >page. My problem is that my app uses frames, and when the user makes a >request from a sub-frame the login page shows in this sub-frame window. Is >there a simple way to configure in the web.xml, that the login.jsp page >always is shown >in the parent frame of the browser or document, so causing the whole window >to be reloaded. I guess there isnt and I must do some jscript, or fiddle >around >with html. I would be extremely impressed if there would be a web.xml >solution. > >regards >BB >p.s. It was very hard to find as Newbie, the email address to post this >mail >to!! > >+---+ >| GIStec GmbH - Ihr Partner für GIS - Technologie | >| | >| Ben Bookey| >| [EMAIL PROTECTED] Fraunhoferstraße 5 | >| Tel 0 61 51 / 155 - 254 D-64283 Darmstadt | >| Fax 0 61 51 / 155 - 259 http://www.gistec-online.de | >| | >| http://www.ingeoic.de http://www.geo-watermarking.de | >+---+ > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Catalina.out
Dear List, I have specified for my app in the web.xml context a logging file. I thought this would therefore result in ALL System.out.println(""); messages to be printed to my app_.txt file. Instead, my app continues to log all output to the catalina.out file. Is there anyway of printing content to this app_.txt file from inside my JSP and servlets ? as I would prefer to have ALL of my app related information in one logfile, to make it easier for the customer to maintain. Would appreciate any support. regards BB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.* compilation of the WEB-INF classes
Dear List, I am using tomcat 4.0. My experience sofar is that when I put my uncompiled .java files inside the WEB-INF\classes directory, and do a restart the java files will ALL be compiled. This is not due to my web-xml settings, but default Tomcat 4. behaviour. However, later when I made a change to one .java file, I thought I would just need to remove the affected .class file, do a re-start and I would see the effects of my changes. This does not seem to be the case, and I got a 404 type error I think that the class file was not available. What is the behaviour of Tomcat regarding compilation? There must be an option inside the server.xml regarding this, and why when I removed one .class file did tomcat not see that it was missing and re-compile it !! regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Frames vs Tables, I think Tables are the future! HTML examples please !
Dear list, I think most of us need to have a mechanism where we can have multiple elements, "or jsp pages" in our jsp solutions. We have a web solution based on frames, (and tomcat) and have realised that on a normal sesion time-out, we get 404 on some of the frames, and could lead to major confusion (& jscript errors)for the user [to be more precise we have a data entry tool with a series of buttons in a left frame which then load the various jsp pages into the center frame]. Could anyone give me a sample table solution? which runs on all browsers. I have read around a little and still not sure what the simplest/best/most effective cross-browser solution is. i.e. Netscape prefers layers, and IE prefers DIV. Would appreciate any help, and some HTML samples would be great regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RFC and j_security_checks
Dear List, Q.1 We implement the integrated security model inside our app context [defined in server.xml ]. When Tomcat 4.1.27 has been started and I goto the site, I get sometime http://myapp/j_security_check in the navigation bar of my browser, and then we get a 500 error I believe (might even be 404). Could anyone explain what could be going on ? Q.2 We have inside our WEB-INF\classes directory a com.ourapp.appname with all our database classes. When I copy the app, from our development windows machine on to the linux server, and start tomcat there, it compiles the jsp files and servlets but not the java files inside the WEB-INF\classes DIR. How can I force Tomcat to compile all the contents of the WEB-INF dir including the java classes we have written. Q.3 I am actually amazed (and impressed) that the windows compiled classes, work on the linux machine!! My understanding is that the compiled byte-code is operating system dependent. i.e. our windows .class files should not be able to work on linux ? or am I imagining it ? I understood that "write-once and run-anywhere" meant that the java files still needed to be recompiled ?? Q.4 I recently had a reply´to a question(in the Apache FileUpload commons mailing list!) that the file name passed from a browser uploading to a server is not set by any standard and he mentioned the RFC (after I googled, I guess means Request for Change). Who is actually responsible for determining the HTTP standard itself, is there an org called RFC or is it a mechanism of the WC3 ? Looking forward to any replies. regards, BB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tmcat 4.1.27 Access Logs. Switching on the the Access logs.
Dear List, In my NetBeans environment which has Tomcat integrated, I can find logs which show the individual requests for each HTML file. Where can I switch this on/off in my "real" installation of Tomcat for just my application (i am sharing a tomcat instance) with other apps.? I want to find any 404 File Not Found errors in my app. regards BEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What is the latest version of Tomcat ?
Dear List, On 9th May 2004 - Tomcat 5.0.24 Stable was released. Which version would you all recomend for a critical commercial product ? regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Tmcat 4.1.27 Access Logs. Switching on the the Access logs.
Hi Yoav Can I do this just for my context ? i.e. Not for the whole server? regards Ben -Ursprungliche Nachricht- Von: Shapira, Yoav [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. Juni 2004 14:55 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: Tmcat 4.1.27 Access Logs. Switching on the the Access logs. Hi, In the server.xml file, comment the AccessLogValve element in or out as you need. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Ben Bookey [mailto:[EMAIL PROTECTED] >Sent: Thursday, June 10, 2004 8:52 AM >To: Tomcat User List >Subject: Tmcat 4.1.27 Access Logs. Switching on the the Access logs. > >Dear List, > > In my NetBeans environment which has Tomcat integrated, I can find logs >which > show the individual requests for each HTML file. Where can I switch >this >on/off in my "real" > installation of Tomcat for just my application (i am sharing a tomcat >instance) with other apps.? > > I want to find any 404 File Not Found errors in my app. > >regards > >BEN > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
pre-loading "normal" java classes..
Hello Mailing list, I know its possible to pre-load jsp pages, and servlets in the web.xml. How would one go around pre-loading simple java classes ? Can I add these to the web.xml too? regards Ben Bookey. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Override the system.outs so that no Tomcat Logfile is produced.
Is it possible with a single server.xml (or web.xml) paramter, to overide all the System.out's in my webApp so that no logfile is produced. Many thanks in advance. BB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
myapp's problems with 4.0.*
Dear List, This is the context of my app from the server.xml. It seems that the app works o.k with Tomcat 4.1.* but not 4.0.*. As you will see we are using the Oracle driver and we have both the necessary oracle jar files in the %CATALINA_HOME%\common\lib directory. Could anyone explain why this might not be working with 4.0.* ? This is not so bad it is an older version, but it would be nice to explain why it doesnt work ;) I would really appreciate (again) any pointers. regards Ben Bookey. === factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:thin:@146.140.211.60:1521:ingeo username myappdbuser password myappdbpwd maxActive 20 maxIdle 10 maxWait -1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat--> web.xml --> context --> element query
Hi Yoav (et. al.), Thanks for the info. regarding switching off debugging compeltely. I am aware of the swallowOutput and the DefaultContext parameters. Could you please tell me which parameter I could use, to switch-off the debugging completely inside the context( presumably its the same for DefaultContext). I have tried setting debug="0" but it doesnt work as you described, i.e. that the logfile size remains at 0 bytes. Please find an extract from my context below. I hope you can help. regards, Ben p.s. what paramter can I set to garantee that the servlets in /work/Standalone/* is always re-generated each time Tomcat is re-started. -Ursprungliche Nachricht- Von: Shapira, Yoav [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 16. Juni 2004 17:25 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: Override the system.outs so that no Tomcat Logfile is produced. Hi, It's possible to redirect System.out/System.err from each webapp to the context's log instead of catalina.out using the Context's swallowOutput attribute. Further, you can add swallowOutput to the DefaultContext element, thereby establishing that for all webapps using one parameter in in server.xml. However, tomcat will still use System.out (which goes to $CATALINA_HOME/logs/catalina.out by default) for some of its own logging: you can configure that further by configuring commons-logging (see the tomcat FAQ entry on configuring tomcat's internal logging). I think even with these configuration entries, however, the catalina.out file will still be touched, so it will be produced although stay at zero size. You can probably avoid even the latter using OS-specific redirection syntax, such as 2&>1 /dev/null or whatever. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Ben Bookey [mailto:[EMAIL PROTECTED] >Sent: Wednesday, June 16, 2004 11:14 AM >To: Tomcat User List >Subject: Override the system.outs so that no Tomcat Logfile is produced. > > >Is it possible with a single server.xml (or web.xml) paramter, to overide >all the System.out's in my webApp >so that no logfile is produced. > >Many thanks in advance. >BB > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Logging.. whats the best way ?
Dear List, We have written a webapp, and now I want to add some logging inside. The app has jsp pages, servlets and a java package of classes for jdbc database interaction. O.k. as I understood Tomcat does support logging via, catalina.out etc. The logfile can even be configured based on each web descriptor web.xml file. This seems quite flexible until you want to start monitoring whats going on inside of the com.package, not just inside the servlet container. So it seems to me that we need to create/use a logger class (e.g. log4j) for the package. Am i right in understanding that its normal-case to use a log4j type method of logging denug info for internal purposes. Its not recommended to use JUST Tomcat logging for the complete web app.? Would appreciate any view, regards BB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Determination if a client has sessions enabled or not.
Dear List, I would like to check if a client has cookies/sessions enabled in the start page of my webapp. whats the best way of doing this? regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to handle client session information if client has sessions disabled?
Dear list, What is the normal way of persisting session type information if the client has sessions/cookies disabled. I guess if he's got sessions switched off, then session.getId() will return null ? The userID must therefore be invented somehow on the server, and passed between the server and client. Objects normally stored in a session, could be stored inside the application object ? or persisted to disk ? with this userID. Would appreciate any advice, regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to handle client session information if client has sessions disabled?
Hi Mike Thanks for the reply. I think I have missed something here. I believe if we store an object in the session its still stored on the server, but is specific to the active user-session. I cant imagine any java objects been sent across the network to the client ... In addition, i am suprised that storing objects in the session object works, when the client has sessions switched off hence app.setAttribute() ?? Help !!! regards, Ben - Original Message - From: "Mike Fowler" <[EMAIL PROTECTED]> To: "Ben Bookey" <[EMAIL PROTECTED]> Sent: Friday, June 25, 2004 5:41 PM Subject: Re: How to handle client session information if client has sessions disabled? > Ben- > > Once you encode the URL, the subsequent request to Tomcat will cause > tomcat to pull the JSESSIONID from the URL (in the referer header) so > session.getId() will work just the same as before. > > As for your second question, I'd store everything in the session. > Something like: > > session.setAttribute("key","value"); > > This eliminates all serverside processing of the user (save finding the > session ID) and off-loads the memory required to store your objects to > the client. > > Hope this helps! > > -Mike Fowler > "I could be a genius if I just put my mind to it, and I, > I could do anything, if only I could get 'round to it" > > > Ben Bookey wrote: > > Thanks for the reply. > > > > O.k so I can store the session userid, which is very useful, for a > > stateless exchange between > > client and server. Can i still use session.getId() to get the id, or > > must I do something special, when the id is stored in > > the url ? > > > > Where would you recommend storing all my objects, particular to a user > > ? inside the application object, something like ? > > > > application.setAttribute(userid & myObject ,myObject); > > > > I would really appreciate your help > > > > regards > > > > Ben > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does the ready-to-go realm always have to use a cookie ?
Dear List, Does the REALM security feature in Tomcat, always have to store a cookie JSESSION in the client ? Is there an easy-work-around so that a cookie is not stored ? Please help! Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SUN or APACHE, xml parser -- How do I know which is used ?
Dear List, xmlParserAPIs.jar and xercesImpl.jar (version 2) libs are supplied in the %CATALINA_HOME%/common/endorsed path. This path allows Tomcat to load a parser (or any other none jcp library) and override the default jar bundled with the JDK 1.4 release. a)The SUN JDK 1.4 release contains a version of Xerces. When I remove the xmlParserAPIs.jar and xercesImpl.jar located in the %CATALINA_HOME%/common/endorsed path, then Tomcat can not read the web and server.xml. Is this because the version of xerces bundled with the JDK 1.4 is an older version, or is this a class-path configuration error on my machine? I would expect the JDK to contain xerces v2 like that supplied with Tomcat 4.1.x. b) The following code works on new Tomcat 4.1.* test installations, but NOT always. How can I garantee that the parser xerces supplied with Tomcat 4.1.* is always loaded. documentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); regards Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: SUN or APACHE, xml parser -- How do I know which is used ?
Hi Yoav, I will not remove the xmlParserAPIs.jar and xercesImpl.jar files from the TC path!! But my xml-file generator app only seems to work when i add xerces.jar also to this TC/commons/lib/endorsed path aswell. Any gueses why? Do you recommend to distribute this needed xerces.jar package inside my webapp classpath (web-inf..) instead? regards Ben p.s. Could you give me some info. on the differences between the sun jdk and the xerces supplied with tomcat. -Ursprungliche Nachricht- Von: Shapira, Yoav [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 3. August 2004 17:31 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: SUN or APACHE, xml parser -- How do I know which is used ? Hi, Tomcat loads the pasrser from the common/endorsed directory per the Endorsed Classloader Mechanism specified by the JDK. Your argument is a bit flawed in that different Tomcat 4.1 releases have different parser versions, and these in turn are different from the parser versions shipped with various JDKs. Don't remove the ones from common/endorsed. Update them if you want, but don't remove them. For other possible configurations, read the release notes and the classloader how-to. The former specifically discusses how to use different XML parsers with tomcat. Yoav Shapira Millennium Research Informatics >-Original Message----- >From: Ben Bookey [mailto:[EMAIL PROTECTED] >Sent: Tuesday, August 03, 2004 11:28 AM >To: Tomcat User List >Subject: SUN or APACHE, xml parser -- How do I know which is used ? > > >Dear List, > >xmlParserAPIs.jar and xercesImpl.jar (version 2) libs are supplied in the >%CATALINA_HOME%/common/endorsed path. This path allows Tomcat to load a >parser (or any other none jcp library) and override the default jar bundled >with the JDK 1.4 release. > >a)The SUN JDK 1.4 release contains a version of Xerces. When I remove the >xmlParserAPIs.jar and xercesImpl.jar located in the >%CATALINA_HOME%/common/endorsed path, then Tomcat can not read the web and >server.xml. Is this because the version of xerces bundled with the JDK 1.4 >is an older version, or is this a class-path configuration error on my >machine? I would expect the JDK to contain xerces v2 like that supplied >with >Tomcat 4.1.x. > >b) The following code works on new Tomcat 4.1.* test installations, but NOT >always. How can I garantee >that the parser xerces supplied with Tomcat 4.1.* is always loaded. > > documentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); > > >regards > >Ben Bookey > > > > > > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Realm--> pasword encryption & servlet location in a webApp
Dear list, 2 questions 1) I think I remember reading somewhere that there was a .bat batch file which we could run on production machines, so that passwords are encrypted. Can anyone enlighten ? 2) Whats the best configuration mechanism for my servlets? I think its better to add the the servlets to my com.mycompany.myapp package (or?), BUT, is it a security flaw when I set in my app, the begininning with /servlet/* (see below example). I again have read that the servlet url-pattern should not begin with /servlet servletName /servlet/servletName regards. Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP/HTML Encoding
Dear List, I am having unexpected results when setting the encoding of my inputForm.jsp, to iso-8859-15 (changing from iso-8859-15 to iso-8859-1 will allow me to use the Euro symbol and a few others). When i give a Euro symbol into a form input control, the client ends up saving a question-mark instead, which is exactly what happens then I leave the standard iso-8859-1 encoding(the jsp default). I am using Tomcat 5 and Internet Explorer 6.x which supports charset=iso-8859-15. Here is my jsp page header attributes. <%@ page language="java" errorPage="myErrorPage.jsp" pageEncoding="iso-8859-15" contentType="text/html; charset=iso-8859-15"%> If by setting the above jsp attributes, do I still need to set (inside the tag) like this ? Another factor which might be affecting the encoding of my input form, is that its a page within a frameset, and it could be that the parent frame HTML page might be incorrectly pre-determining the encoding of the whole frameset overriding the child frame settings. kind regards, Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: JSP/HTML Encoding
Hi Allistair, Where can I set this JVM property exactly ? Thanks in advance. Ben p.s. I am beginning to think that my problem is associated with working with HTML framesets(with possible mixtures of html encoding). -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 31. August 2004 17:08 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: JSP/HTML Encoding make sure also that you set file.encoding=utf8 in tomcat's startup options so that the jvm also operates in that mode. ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 31 August 2004 16:00 > To: Tomcat User List > Subject: JSP/HTML Encoding > > > > > Dear List, > > I am having unexpected results when setting the encoding of my > inputForm.jsp, to iso-8859-15 (changing from > iso-8859-15 to iso-8859-1 will allow me to use the Euro > symbol and a few > others). When i give a Euro symbol into a form input control, > the client > ends up saving a question-mark instead, which is exactly what > happens then I > leave the standard iso-8859-1 encoding(the jsp default). I am > using Tomcat 5 > and Internet Explorer 6.x which supports charset=iso-8859-15. > > Here is my jsp page header attributes. > > <%@ page language="java" errorPage="myErrorPage.jsp" > pageEncoding="iso-8859-15" contentType="text/html; > charset=iso-8859-15"%> > > If by setting the above jsp attributes, do I still need to > set (inside the > tag) like this ? > > > > Another factor which might be affecting the encoding of my > input form, is > that its a page within a frameset, and it could be that the > parent frame > HTML page might be incorrectly pre-determining the encoding > of the whole > frameset overriding the child frame settings. > > > kind regards, > Ben Bookey > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: JSP/HTML Encoding
ommon.filters; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; /** * Example filter that unconditionally sets the character encoding to be used * in parsing the incoming request to a value specified by the * encoding filter initialization parameter in the web app * deployment descriptor (/WEB-INF/web.xml). This filter could * easily be extended to be more intelligent about what character encoding to * set, based on characteristics of the incoming request (such as the values * of the Accept-Language and User-Agent headers, * or a value stashed in the current user's session). * * @author Craig McClanahan * @version $Revision: 1.1 $ $Date: 2001/07/24 00:26:55 $ */ public class SetCharacterEncodingFilter implements Filter { // - Instance Variables /** * The default character encoding to set for requests that pass through * this filter. */ protected String encoding = null; /** * The filter configuration object we are associated with. If this value * is null, this filter instance is not currently configured. */ protected FilterConfig filterConfig = null; // - Public Methods /** * Take this filter out of service. */ public void destroy() { this.encoding = null; this.filterConfig = null; } /** * Select and set (if specified) the character encoding to be used to * interpret request parameters for this request. * * @param request The servlet request we are processing * @param result The servlet response we are creating * @param chain The filter chain we are processing * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // Select and set (if needed) the character encoding to be used String encoding = selectEncoding(request); if (encoding != null) request.setCharacterEncoding(encoding); // Pass control on to the next filter chain.doFilter(request, response); } /** * Place this filter into service. * * @param filterConfig The filter configuration object */ public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; this.encoding = filterConfig.getInitParameter("encoding"); } // -- Protected Methods /** * Select an appropriate character encoding to be used, based on the * characteristics of the current request and/or filter initialization * parameters. If no character encoding should be set, return * null. * * The default implementation unconditionally returns the value configured * by the encoding initialization parameter for this * filter. * * @param request The servlet request we are processing */ protected String selectEncoding(ServletRequest request) { return (this.encoding); } } ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 31 August 2004 16:28 > To: Allistair Crossley; Tomcat Users List > Subject: AW: JSP/HTML Encoding > > > Hi Allistair, > > Where can I set this JVM property exactly ? > Thanks in advance. > Ben > p.s. I am beginning to think that my problem is associated > with working with > HTML framesets(with possible mixtures of html encoding). > > -Ursprüngliche Nachricht- > Von: Allistair Crossley [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 31. August 2004 17:08 > An: Tomcat Users List; [EMAIL PROTECTED] > Betreff: RE: JSP/HTML Encoding > > > make sure also that you set file.encoding=utf8 in tomcat's > startup options > so that the jvm also operates in that mode. > > ADC > > > -Original Message- > > From: Ben Bookey [mailto:[EMAIL PROTECTED] > > Sent: 31 August 2004 16:00 > > To: Tomcat User List > > Subject: JSP/HTML Encoding > > > > > > > > > > Dear List, > > > > I am having unexpected results when setting the encoding of my > > inputForm.jsp, to iso-8859-15 (changing from > > iso-8859-15 to iso-8859-1 will allow me to use the Euro > > symbol and a few > > others). When i give a Euro symbol into a form input control, > > the client > >
How to pre-determine the browser request character encoding type
Hi Alistair, I hope you find time to do your work more questions :) Why should the IE client which is definitely reading/parsing as ISO-8859-15(i can see this in the IE menu bar), then post to the server converting the Euro to a questionmark . its rather stupid of IE isn't it, its definitely reading as ISO-8859-15 then posts anyway as ISO-8859-1 ? Could you explain in simple english, how the filter ensures that the request is in utf8 encoded. regards Ben p.s. greetings from germany. -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. September 2004 10:19 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: JSP/HTML Encoding The filter I sent you ensures that the "request" is encoded as UTF-8 which includes the euro character. When you are posting your forms with the euro character I believe your request is set to ISO-8859-1 and you lose the information, hence the ?. pageEncoding just sets the "response" encoding for the client and does not affect the other direction, i.e client => server. I am not sure if there is another setting where request character encoding can be set. Perhaps a more experienced Tomcat user knows this Cheers! > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 31 August 2004 17:06 > To: Allistair Crossley > Cc: Tomcat User List > Subject: AW: JSP/HTML Encoding > > > Hi Allistair > > +++ Many thanks for your help. +++ > > I apologise when I ask some stupid questions... > :) > > 1) I am not exactly sure what the benefit is, of seeing if > the client is > posting a utf8 encoded response ? Surely, the server controls > anyway what > encoding the html pages are in so if i post with Latin9 then > the client can > either read it or not. I guess this filter is useful in the > case that the > client browser doesnt support the character encoding > (something hopefully > similar) and posts the request in another character-code. The > filter can > then be used to see if this is happening or not ? > > > 2) I would assume that Tomcat( being java) would always use > either utf8 or > utf16 so making the necessity of setting a jvm tomcat > property unnecessary ? > > > > regards > Ben > > > > -Ursprüngliche Nachricht- > Von: Allistair Crossley [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 31. August 2004 17:32 > An: [EMAIL PROTECTED] > Betreff: RE: JSP/HTML Encoding > > > Hm, tell a lie Ben...I've just checked our startup options > and we don't seem > to do that anymore ... however if you were to do it .. > add -Dfile.encoding=utf8 > > rem Set extra parameters > "%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions > "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOM > E%;-Djava.endo > rsed.dirs=%CATALINA_HOME%\common\endorsed";-Xrs;-Xms128m;-Xmx3 > 84m;-Duser.dir > =%CATALINA_HOME%;-Dfile.encoding=utf8 --StartMode jvm --StopMode jvm > > I think you just need to make sure you use utf8 at the UI. > Our databases are > all Windows Cp1252 which also include the euro symbol. > > I also forgot to mention we put an explicit filter on all > inbound requests > that set the inbound encoding to utf-8. Try adding this > filter to web.xml > > > Set Character Encoding > > com.qas.newmedia.common.filters.SetCharacterEnco > dingFilter lter-class> > > encoding > UTF-8 > > > > with the code ... > > /* > * $Header: > /home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/ filters/SetCha > racterEncodingFilter.java,v 1.1 2001/07/24 00:26:55 craigmcc Exp $ > * $Revision: 1.1 $ > * $Date: 2001/07/24 00:26:55 $ > * > * > > * > * The Apache Software License, Version 1.1 > * > * Copyright (c) 1999-2001 The Apache Software Foundation. All rights > * reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > * > * 1. Redistributions of source code must retain the above copyright > *notice, this list of conditions and the following disclaimer. > * > * 2. Redistributions in binary form must reproduce the above > copyright > *notice, this list of conditions and the following disclaimer in > *the documentation and/or other materials provided with the > *distribution. > * > * 3. The end-user documentation included with the redistribution, if > *any, must include the following acknowleg
++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding.
Dear list, We have a web-based jsp-servlet application performing updates, deletes and inserts into an oracle database running with Tomcat 5. We want to support both american, and european customer client locales, so we want to use either ISO-8859-15 or utf-8. But we are having problems saving the Euro symbol when using ISO-8859-15 encoding. I had previously assumed that because java works with unicode as default, that all data entered in a HTML form would be saved therefore as UTF-8 into the database. (i.e. as soon as a value is assigned to the a java dataobject e.g. string or int). I am beginning to think this not to be case, and that all data is saved in the database based on the original encoding as posted by the browser. Please can someone explain what is really going on?? Do i need to have some code which, checks the browser encoding in the HTTP header, and then convert/parse accordingly to a chosen standard. This will then avoid the situation that our database could end up containing records in different character encoding systems, which I suspect is what is now happening. In addition, how does TC deal with framsets containing many html pages. Are they all treated individually (in theory allowing many character encodings to be used in each HTML frame), or as one unit. I LOOK very much forward to any reply on this matter. Sincerely, Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding.
Hi Allistair, I have installed your filter and it seems to be working, and utf-8 is processed on the server. <%@ page language="java" errorPage="MainIdentificationMainError.jsp"%> <%@ page import="java.lang.*,java.io.*,java.sql.*,javax.naming.*,javax.sql.*,java.uti l.Enumeration,java.util.*"%> <%@ page import="com.gistec.webentrytool. *,org.apache.torque.om.BaseObject,org.apache.torque.Torque,org.apache.torque .TorqueException,org.apache.torque.TorqueRuntimeException,org.apache.torque .util.Criteria,java.sql.*"%> <%@ page session="true"%> <%@ page contentType="text/html;charset=utf-8"%> <%@ page pageEncoding="utf-8"%> But even when I use the above header in my jsp page, the euro symbol is displayed incorrectly (with a utf-8 display) I would appreciate any support. regards Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. September 2004 10:50 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding. We had to look at several areas: 1. JSP pageEncoding <%@ page contentType="text/html; charset=UTF-8" %> This ensures that the JSPs will display pretty much everything. Actually, our SQL Server database runs Latin1_General_CI_AS (which does include euro). 2. Database Connection URL jdbc:jtds:sqlserver://intratestgbr:1433/db_iQ;charset=Cp1252;TDS=7.0 We discovered that we _had_ to talk to the database using an encoding it understood. It turned out that Cp1252 was actually Latin1_General_CI_AS, so we make sure the character encoding is set on our database driver. 3. Request Character Encoding Taken from http://weblogs.java.net/pub/wlg/1078 Submitting information via a HTML form. Most browsers don't appear to send back a charset in the request that corresponds to the encoding that was used to format the page. In this case, the request character encoding defaults to ISO-8859-1 meaning that there's potentially a mismatch between form data being sent (in UTF-8) and information retrieved from the request (in ISO-8859-1) using the getParameter() method on the HttpServletRequest class. To fix this, all you need to do is explicitly set the character encoding of the request before accessing data. request.setCharacterEncoding("UTF-8"); This is what the filter code I sent you does for all requests. I hope this clears up your issue! Alles gut, ich wuensche Dir Glueck! ADC. > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 01 September 2004 09:37 > To: Allistair Crossley > Cc: Tomcat User List > Subject: How to pre-determine the browser request character encoding > type > > > Hi Alistair, > > I hope you find time to do your work more questions :) > > Why should the IE client which is definitely reading/parsing as > ISO-8859-15(i can see this in the IE menu bar), then post to > the server > converting the Euro to a questionmark . its rather stupid of > IE isn't it, > its definitely reading as ISO-8859-15 then posts anyway as > ISO-8859-1 ? > > Could you explain in simple english, how the filter ensures > that the request > is in utf8 encoded. > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 01 September 2004 09:37 > To: Tomcat User List > Cc: Allistair Crossley > Subject: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character > encoding. > > > > Dear list, > > We have a web-based jsp-servlet application performing > updates, deletes and > inserts into an oracle database running with Tomcat 5. We > want to support > both > american, and european customer client locales, so we want to > use either > ISO-8859-15 or utf-8. But we are having problems saving the > Euro symbol when > using ISO-8859-15 encoding. > > I had previously assumed that because java works with unicode > as default, > that all data entered in a HTML form would be saved therefore > as UTF-8 into > the database. (i.e. as soon as a value is assigned to the a > java dataobject > e.g. string or int). I am beginning to think this not to be > case, and that > all data is saved in the database based on the original > encoding as posted > by the browser. Please can someone explain what is really > going on?? Do i > need to have some code which, checks the browser encoding in the HTTP > header, and then convert/parse accordingly to a chosen > standard. This will > then avoid the situation that our database could end up > containing records > in different character encoding s
++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding.
Hi Allistair, Nikola, et al. Allistair = >>>>>what made you give up setting up the encoding via the -djvm ?? Nikola == >>>>>Since you have to support multiple character sets, it would be cleaner if you chose UTF-8 for your DB, in the first place. I do realise that data >>>>conversion can be a tremendous task, so your mileage may vary. Q. Do you mean in converting the data inside the database ? It sounds like you have experience --> what does it involve? Q. Any idea to the extent to which oracle, sqlserver and mysql supports utf-8 ? DBname supports utf? == oracle8 oracle9 oracle10 sqlserver2000 sqlserver97 mysql41 Many thanks in advance for your help. regards Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. September 2004 15:42 An: [EMAIL PROTECTED] Betreff: RE: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding. dear dear! this reminds me of when i was pulling my hair out for days 4 months back ;) are you saying that when you submit a form, the euro correctly goes into the database? make sure you are pulling out euro characters that are correctly encoded in the database .. have you tried entering a new row in the database with a euro character from your form or are you trying existing data? Is your database encoding UTF-8 or something else? you could just for the sake of it try <%@ page contentType="text/html;charset=ISO8859-15"%> <%@ page pageEncoding="ISO8859-15"%> it sounds to me like the encoding is still being switched incorrectly somewhere. ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 01 September 2004 14:37 > To: Tomcat User List > Cc: Allistair Crossley > Subject: AW: ++ Best practive ?? ++ > (JSP-->Servlet-->Database) character > encoding. > > > > Hi Allistair, > > I have installed your filter and it seems to be working, and utf-8 is > processed on the server. > > > <%@ page language="java" > errorPage="MainIdentificationMainError.jsp"%> > <%@ page > import="java.lang.*,java.io.*,java.sql.*,javax.naming.*,javax. > sql.*,java.uti > l.Enumeration,java.util.*"%> > <%@ page import="com.gistec.webentrytool. > *,org.apache.torque.om.BaseObject,org.apache.torque.Torque,org > .apache.torque > .TorqueException,org.apache.torque.TorqueRuntimeException,org. > apache.torque > .util.Criteria,java.sql.*"%> > <%@ page session="true"%> > <%@ page contentType="text/html;charset=utf-8"%> > <%@ page pageEncoding="utf-8"%> > > But even when I use the above header in my jsp page, the euro > symbol is > displayed incorrectly (with a utf-8 display) > > I would appreciate any support. > > regards > > Ben > > > > > > > > > > -Ursprüngliche Nachricht- > Von: Allistair Crossley [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 1. September 2004 10:50 > An: Tomcat Users List; [EMAIL PROTECTED] > Betreff: RE: ++ Best practive ?? ++ > (JSP-->Servlet-->Database) character > encoding. > > > We had to look at several areas: > > 1. JSP pageEncoding > > <%@ page contentType="text/html; charset=UTF-8" %> > > This ensures that the JSPs will display pretty much > everything. Actually, > our SQL Server database runs Latin1_General_CI_AS (which does > include euro). > 2. Database Connection URL > > jdbc:jtds:sqlserver://intratestgbr:1433/db_iQ;charset=Cp1252;TDS=7.0 > > We discovered that we _had_ to talk to the database using an > encoding it > understood. It turned out that Cp1252 was actually > Latin1_General_CI_AS, so > we make sure the character encoding is set on our database driver. > > 3. Request Character Encoding > > Taken from http://weblogs.java.net/pub/wlg/1078 > > Submitting information via a HTML form. Most browsers don't > appear to send > back a charset in the request that corresponds to the > encoding that was used > to format the page. In this case, the request character > encoding defaults to > ISO-8859-1 meaning that there's potentially a mismatch > between form data > being sent (in UTF-8) and information retrieved from the request (in > ISO-8859-1) using the getParameter() method on the > HttpServletRequest class. > To fix this, all you need to do is explicitly set the > character encoding of > the request before accessing data. > > request.setCharacterEncoding("UTF-8"); > > This is what the filter code I sent you does for al
WG: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding.
Thanks for your help. I think I am beginning to understand what is happening ...and know what i will try. Just before I do, perhaps you could explain if all the browser client supports Windows-1250 ? inluding linux machines for example ? on the client ? Is there anything else I should watch out for when converting my database, from iso-8859 to utf-8. I presume this will only determine the way chars are stored in the database. and will not affect anything else..like for example how integers, or floats are stored ? thanks Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. September 2004 15:42 An: [EMAIL PROTECTED] Betreff: RE: ++ Best practive ?? ++ (JSP-->Servlet-->Database) character encoding. dear dear! this reminds me of when i was pulling my hair out for days 4 months back ;) are you saying that when you submit a form, the euro correctly goes into the database? make sure you are pulling out euro characters that are correctly encoded in the database .. have you tried entering a new row in the database with a euro character from your form or are you trying existing data? Is your database encoding UTF-8 or something else? you could just for the sake of it try <%@ page contentType="text/html;charset=ISO8859-15"%> <%@ page pageEncoding="ISO8859-15"%> it sounds to me like the encoding is still being switched incorrectly somewhere. ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 01 September 2004 14:37 > To: Tomcat User List > Cc: Allistair Crossley > Subject: AW: ++ Best practive ?? ++ > (JSP-->Servlet-->Database) character > encoding. > > > > Hi Allistair, > > I have installed your filter and it seems to be working, and utf-8 is > processed on the server. > > > <%@ page language="java" > errorPage="MainIdentificationMainError.jsp"%> > <%@ page > import="java.lang.*,java.io.*,java.sql.*,javax.naming.*,javax. > sql.*,java.uti > l.Enumeration,java.util.*"%> > <%@ page import="com.gistec.webentrytool. > *,org.apache.torque.om.BaseObject,org.apache.torque.Torque,org > .apache.torque > .TorqueException,org.apache.torque.TorqueRuntimeException,org. > apache.torque > .util.Criteria,java.sql.*"%> > <%@ page session="true"%> > <%@ page contentType="text/html;charset=utf-8"%> > <%@ page pageEncoding="utf-8"%> > > But even when I use the above header in my jsp page, the euro > symbol is > displayed incorrectly (with a utf-8 display) > > I would appreciate any support. > > regards > > Ben > > > > > > > > > > -Ursprüngliche Nachricht- > Von: Allistair Crossley [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 1. September 2004 10:50 > An: Tomcat Users List; [EMAIL PROTECTED] > Betreff: RE: ++ Best practive ?? ++ > (JSP-->Servlet-->Database) character > encoding. > > > We had to look at several areas: > > 1. JSP pageEncoding > > <%@ page contentType="text/html; charset=UTF-8" %> > > This ensures that the JSPs will display pretty much > everything. Actually, > our SQL Server database runs Latin1_General_CI_AS (which does > include euro). > 2. Database Connection URL > > jdbc:jtds:sqlserver://intratestgbr:1433/db_iQ;charset=Cp1252;TDS=7.0 > > We discovered that we _had_ to talk to the database using an > encoding it > understood. It turned out that Cp1252 was actually > Latin1_General_CI_AS, so > we make sure the character encoding is set on our database driver. > > 3. Request Character Encoding > > Taken from http://weblogs.java.net/pub/wlg/1078 > > Submitting information via a HTML form. Most browsers don't > appear to send > back a charset in the request that corresponds to the > encoding that was used > to format the page. In this case, the request character > encoding defaults to > ISO-8859-1 meaning that there's potentially a mismatch > between form data > being sent (in UTF-8) and information retrieved from the request (in > ISO-8859-1) using the getParameter() method on the > HttpServletRequest class. > To fix this, all you need to do is explicitly set the > character encoding of > the request before accessing data. > > request.setCharacterEncoding("UTF-8"); > > This is what the filter code I sent you does for all requests. > > I hope this clears up your issue! > > Alles gut, ich wuensche Dir Glueck! > > ADC. > > > > -Original Message- > > From: Ben Bookey [mailto:[EMAIL PROTECTED] > > Sent: 01 September 2004 09:
????? +++ problem saving &Euro symbol character to database from my JSP form using TC5
HI Nikola. et. al., thanks for your help. I "really" appreciate it !! 1. I have a Windows-1250 oracle database, and I am using TC 5. and jsp/html pages to perform updates/inserts. Despite using iso-8859-15 in my jsp/html, the client is still posting a ? (question mark symbol) instead of a Euro symbol. Anybody know what is happening ? 2. If I do change our product database, from Windows-1250 to UTF-8, how will this affect existing applications I wonder writing to the database using Windows-1250 or iso-8859-1. I guess because utf-8 is backward compatable it should not affect the existing apps. making updates or inserts? Would appreciate any help ! thanks BEn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Real problem posting &Euro symbol from jsp page, using TC 5.0
Dear TC profis, (allistair and Nikola) I have had this problem for a week (aaahhh!), and would really appreciate ANY help or pointers to what I may be doing wrong. When I post a value from a form from either Netscape 6.0 or IE 6.0, and do a system.out.println in my test servlet there is always something other than the Euro symbol arriving in my test servlet. Most often is a ? which indicates the browser-client is posting using ISO8859-1 Please take a look at the simple jsp pages below, which is using UTF-8. ( in another test I have also changed all the various encoding parameters to ISO8859-15, but there is still no Euro symbol on the server).! PLEASE. WHAT AM I DOING WRONG ?? :-( Ben '=== == <%@ page language="java"%> <%@ page contentType="text/html;charset=utf-8"%> <%@ page pageEncoding="utf-8"%> encoding data test. <% String reqURL = "/InGeoWebEntryTool/servlet/EncodingValidationServlet"; String strEncodeTest=""; %> '=== === Here are some system properties from my server. file.encoding = Cp1252 java.specification.version = 1.4 catalina.home = D:\Program Files\NetBeans3.6\jakarta-tomcat-5.0.19 java.version = 1.4.2 sun.cpu.endian = little sun.io.unicode.encoding = UnicodeLittle '=== === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Real problem posting &Euro symbol from jsp page, using TC 5.0
Hi Allistair, I am using win2k and your filter with it set to UTF-8 encoding. Indeed I have not been able to set JVM [file.encoding = utf-8]in the catalina.bat yet (my catalina.out doesnt look like your catlina.bat example that you gave me before!). I am going to continue trying setting the encoding because currently my > file.encoding = Cp1252, and I am thinking this is the root of my problems. But I have now discovered when I view the logfile where all my system.outs goto(catalina.out) as iso-8859-15, I can view the symbol inside of the logfile . This is not visible when the editor is using utf-8, which is what java will treat this text as. In addition when I use the command request.getCharacterEncoding() i get a null string. Also I have come to the conclusion, that the oracle jdbc string doesnt support passing of character encoding like with sqlserver. I will let you know how I get on when I change the jvm file.encoding. I am pulling my hair now !! regards Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Montag, 6. September 2004 12:28 An: [EMAIL PROTECTED] Betreff: RE: Real problem posting &Euro symbol from jsp page, using TC 5.0 Hi Ben, OK, here is my setup. Can you do the same for yours considering the various layers I have drawn below. You did not mention in your post if you are using the request filter servlet to ensure request encoding is set to utf-8. Remember, Tomcat defaults to ISO-8859-1 for inbound requests. I am not sure if it pays attention to the form accept encoding, so be sure to use the filter. Someone else may have a better way or confirm whether form accept-encoding works on forms. I suppose you could test this in your Servlet by printing request.getCharacterEncoding(). This needs to be UTF-8 if all is well. Can you confirm this? == Windows 2000 -- | JVM [file.encoding = utf-8] --- | TOMCAT -- DB | DB URL CHARSET | SERVLET | SERVLET FILTER | JSP -- Cp1252 | Cp1252 |-| set req. utf-8 | utf-8 == > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 06 September 2004 11:19 > To: Tomcat User List > Cc: Allistair Crossley; [EMAIL PROTECTED] > Subject: Real problem posting &Euro symbol from jsp page, using TC 5.0 > > > > Dear TC profis, (allistair and Nikola) > > I have had this problem for a week (aaahhh!), and would > really appreciate > ANY help or pointers to what I may be doing wrong. > > When I post a EUR value from a form from either Netscape 6.0 or > IE 6.0, and do > a system.out.println in my test > servlet there is always something other than the Euro symbol > arriving in my > test servlet. Most often is a ? which indicates the browser-client > is posting using ISO8859-1 > > Please take a look at the simple jsp pages below, which is > using UTF-8. ( in > another test I have also changed all the various > encoding parameters to ISO8859-15, but there is still no Euro > symbol on the > server).! > > PLEASE. WHAT AM I > DOING WRONG ?? > > :-( > > Ben > > '= > == > == > <%@ page language="java"%> > <%@ page contentType="text/html;charset=utf-8"%> > <%@ page pageEncoding="utf-8"%> > > > http-equiv="Content-Type" content="text/html" charset='utf-8'> > encoding data test. > > > > > <% > String reqURL = > "/InGeoWebEntryTool/servlet/EncodingValidationServlet"; > String strEncodeTest=""; > %> > > value="<%=strEncodeTest%>" size="98"> > > > > > > '= > == > === > Here are some system properties from my server. > > file.encoding = Cp1252 > java.specification.version = 1.4 > catalina.home = D:\Program Files\NetBeans3.6\jakarta-tomcat-5.0.19 > java.version = 1.4.2 > sun.cpu.endian = little > sun.io.unicode.encoding = UnicodeLittle > > '= > == > === > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting JVM ==> file.encoding = Cp1252
Dear list, I am new to Java and to TC. When I write all the java.system properties to the logfile on my windows machine, I see I am using file.encoding = Cp1252 on my linux machine this is file.encoding = iso-8859-15 I know I can configure this jvm paramter in the catalina.bat/sh file, but is there a way of doing this inside the server.xml or something ? regards, Ben +---+ | GIStec GmbH - Ihr Partner für GIS - Technologie | | | | Ben Bookey| | [EMAIL PROTECTED] Fraunhoferstraße 5 | | Tel 0 61 51 / 155 - 254 D-64283 Darmstadt | | Fax 0 61 51 / 155 - 259 http://www.gistec-online.de | | | | http://www.ingeoic.de http://www.geo-watermarking.de | +---+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Setting JVM ==> file.encoding = Cp1252
Hi Allistair (once again), I have no hair anymore !! Just so I understand correctly, this parameter means that all text files "read" and "written" with java, will write using the specified encoding. regards Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 8. September 2004 11:46 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: Setting JVM ==> file.encoding = Cp1252 Ben, file.encoding is a JVM parameter specified e.g java -Dfile.encoding=Cp1252 SomeClass There is no need to set this in server.xml when you can do this in the startup scripts for TC. You could even try within Java code System.setProperty("file.encoding", "Cp1252"); ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 08 September 2004 10:44 > To: Tomcat User List > Subject: Setting JVM ==> file.encoding = Cp1252 > > > Dear list, > > I am new to Java and to TC. When I write all the java.system > properties > to the logfile on my windows machine, I see I am using > > file.encoding = Cp1252 > > on my linux machine this is > > file.encoding = iso-8859-15 > > > I know I can configure this jvm paramter in the > catalina.bat/sh file, but > is there a way of doing this inside the server.xml or something ? > > regards, > > Ben > > > +---+ > | GIStec GmbH - Ihr Partner für GIS - Technologie | > | | > | Ben Bookey| > | [EMAIL PROTECTED] Fraunhoferstraße 5 | > | Tel 0 61 51 / 155 - 254 D-64283 Darmstadt | > | Fax 0 61 51 / 155 - 259 http://www.gistec-online.de | > | | > | http://www.ingeoic.de http://www.geo-watermarking.de | > +---+ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Setting JVM ==> file.encoding = Cp1252
Dear Allistair, (et.al) Many many many thanks for ALL your help. The problem has "disapeared"! "oh joy, oh rapture unforseen" The problem seemed to disapear when I inserted a filter-mapping where servlets are mapped, for the incoming request filter which converts all request objects to utf-8 for the application, which was missing from my web.xml. Then I set the various page-encoding , etc. (see below) //v/ /v//v <%@ page language="java"%> <%@ page contentType="text/html;UTF-8"%> <%@ page pageEncoding="UTF-8"%> encoding data test. <% String reqURL = "/InGeoWebEntryTool/servlet/EncodingValidationServlet"; String strEncodeTest=""; if (request.getParameter("text")!=null && !request.getParameter("text").equalsIgnoreCase("")){ strEncodeTest = request.getParameter("text"); } %> //v/ /v//v Now i have this working using utf-8. I am sure this will now work for all encodings, but I think we shall stick with utf-8. regards, Ben -Ursprüngliche Nachricht- Von: Allistair Crossley [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 8. September 2004 12:41 An: [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: RE: Setting JVM ==> file.encoding = Cp1252 hi ben, the jvm always operates with utf. Data transferred into or out of the jvm is in a format matching the file.encoding property. i don't understand why you wish to change the file.encoding. the jvm file encoding should really match your file system, that's why on windows it is Cp1252 and on linux iso-8859-15. the file.encoding will not affect the way your request encoding or database encoding aligns. why don't you email me your web.xml, your jsp, your servlet, your JNDI or database connectivity config and I will take a look. ADC > -Original Message- > From: Ben Bookey [mailto:[EMAIL PROTECTED] > Sent: 08 September 2004 11:12 > To: Allistair Crossley > Subject: AW: Setting JVM ==> file.encoding = Cp1252 > > > Me yet again.. > would it be a good idea to convert all my app config files to > utf8 too, once > I change this file.enoding setting? > > regards > Ben > > -Ursprüngliche Nachricht- > Von: Allistair Crossley [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 8. September 2004 11:46 > An: Tomcat Users List; [EMAIL PROTECTED] > Betreff: RE: Setting JVM ==> file.encoding = Cp1252 > > > Ben, > > file.encoding is a JVM parameter specified e.g > > java -Dfile.encoding=Cp1252 SomeClass > > There is no need to set this in server.xml when you can do this in the > startup scripts for TC. You could even try within Java code > > System.setProperty("file.encoding", "Cp1252"); > > ADC > > > -Original Message- > > From: Ben Bookey [mailto:[EMAIL PROTECTED] > > Sent: 08 September 2004 10:44 > > To: Tomcat User List > > Subject: Setting JVM ==> file.encoding = Cp1252 > > > > > > Dear list, > > > > I am new to Java and to TC. When I write all the java.system > > properties > > to the logfile on my windows machine, I see I am using > > > > file.encoding = Cp1252 > > > > on my linux machine this is > > > > file.encoding = iso-8859-15 > > > > > > I know I can configure this jvm paramter in the > > catalina.bat/sh file, but > > is there a way of doing this inside the server.xml or something ? > > > > regards, > > > > Ben > > > > > > > +---+ > > | GIStec GmbH - Ihr Partner für GIS - Technologie > | > > | > | > > | Ben Bookey > | > > | [EMAIL PROTECTED] Fraunhoferstraße 5 > | > > | Tel 0 61 51 / 155 - 254 D-64283 Darmstadt > | > > | Fax 0 61 51 / 155 - 259 http://www.gistec-online.de | > | | > | http://www.ingeoic.de http://www.geo-watermarking.de | > +---+ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --- QAS Ltd. Developers of QuickAddress Software http://www.qas.com";>www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Workaround for using JNDI sources in the web.xml instead of the server.xml?
Dear list, We use a datasource and realm for our app, which is currently inside of the server.xml file for tomcat. This is used in the application descriptor (web.xml) to control access. When my app. is packaged the server.xml is not inside the .war file. This makes the installation task, just that little bit more complex. It would be nicer if the jdbc realm (referenced in the web.xml) could be installed along with the .war file. Can anyone make a suggestion? '=== = factory org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc.driver.OracleDriver url jdbc:oracle:thin:@111.111.111.11:1521:mySID username myAppUser password myAppUser '=== = regards. Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does Tomcat 4.* recognise /META-INF/context.xml at all ?
Hi Yoav, many thanx for your reply. Of course TC5 is going to be better, and perhaps even more stable (pause) Could you perhaps tell me if the context.xml is a brand new TC5 concept. Does TC 4.* read it at all ? regards. Ben -Ursprungliche Nachricht- Von: Shapira, Yoav [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 15. September 2004 18:15 An: Ben Bookey Betreff: RE: Workaround for using JNDI sources in the web.xml instead of the server.xml? Hi, I don't know if you customizing context.xml would cause any problems. Frankly, I don't care to support TC4. It's old, TC5 is much better, and you and your customer should upgrade. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Ben Bookey [mailto:[EMAIL PROTECTED] >Sent: Wednesday, September 15, 2004 12:11 PM >To: Shapira, Yoav >Subject: RE: Workaround for using JNDI sources in the web.xml instead of >the server.xml? > > >Thanks very much. > >I suppose, this is definitely not available in Tomcat 4.*. !! > >If not is there a similar solution that would work on TC 4.* as well as TC >5.*. Our customers have been told until now at least, to have TC 4.* and >above. > >say I implement this context.xml. And indeed a customer installs on a TC >4.* >machine. Apart from >not working because the datasource is missing, would it cause any problems >to the TC 4.0 server? i.e. invalid context document or bad resource etc. >etc- > >Looking forward (as ever) to your great replies! > >regards > >Ben Bookey > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using request.getLocale() inside of the sessionListener event
Dear List, We are using a sessionlistener to count users. Is it possible for us to use the request object somehow inside of the sessionCreated event? We want to determine the client.locale and then store this in the session object. This would therefore mean, we can determine the language GUI interface to sue once for a session, and not in the'header' of every jsp page. To me there doesnt seem a way to use the request object in this sessionCreated event ? I would really appreciate any help! regards BEn import javax.servlet.http.HttpSessionListener; import javax.servlet.http.HttpSessionEvent; public void sessionCreated(HttpSessionEvent e) { ... count users } public void sessionDestroyed(HttpSessionEvent e) { count users } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Including Zip functionality in a filter...
Dear list, I have seen an example of using a filter, to Zip/compress the outgoing request. This for me is an exciting way of speeding up the load time for my webApp. ( For those who dont know, most internet browsers have an integrated unzip function, so a server can send the client a zipped html file, with the mime type set correctly and the browser will display the page, reducing drastically the bandwidth) i) Is this technique recommended at all ? could this lead to a bottleneck at the filter ? ii) IS this limited to html pages or graphics ? etc. Kind regards Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat classloading...a theory question..
Dear List, Which packages would "normally" be used by an app. running on Tomcat 4 and Tomcat 5, if identical packages are placed in the paths, i) common\lib ii) mywebapp\WEB-INF\lib iii) jre\lib\ext (Java-Run-Time) It would be logical to me that the version in the app WEB-INF\lib directory would be used 'first' before the TC ClassLoader looks into the common lib. I have been responsible for the dev of an wepapp. which often runs alongside other apps. To avoid the bugs that the customers often have, I would like to put ALL the trouble jar files (in my case the xml parser api jar files), inside my webapp and these will be hopefully used by my app. rather than it using possibly older versions that have been placed inside of the common/lib or even the jre\lib path. I would really appreciate any insight. regards Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat classloading...a theory question..
Dear Mathew, Thanks for the link. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html I am afraid I dont understand the paragraph below, regarding the class patterns "In addition, for the following class patterns, the classloader will always delegate first (and load the class itself if no parent classloader loads it)" = As mentioned above, the web application class loader diverges from the default Java 2 delegation model (in accordance with the recommendations in the Servlet Specification, version 2.3, section 9.7.2 Web Application Classloader). When a request to load a class from the web application's WebappX class loader is processed, this class loader will look in the local repositories first, instead of delegating before looking. There are exceptions. Classes which are part of the JRE base classes cannot be overriden. For some classes (such as the XML parser components in JDK 1.4+), the JDK 1.4 endorsed feature can be used (see the common classloader definition above). In addition, for the following class patterns, the classloader will always delegate first (and load the class itself if no parent classloader loads it): javax.* org.xml.sax.* org.w3c.dom.* org.apache.xerces.* org.apache.xalan.* = Can I put the above class pattern in my WEB-INF/lib path or not ? regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Including Zip functionality in a filter...
HI Tim // Don't worry about writing a compression filter - tomcat comes with one on its HTTP connector. // Or if your using apache - use mod_gzip. I here the latest IIS also has compression support. Thanks ALOT for the suggestion. We are just using Tomcat 4.1 and Tomcat 5, is this still possible. Could you send me an example how to use the HTTP Connector. I would be VERY grateful.. regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
GZip compression in 4.1.27 ..
Dear Ladies and Gentlemen, This is a follow-on for a question from last week, but as its now on a "different-page" of the mailing list. I decided to post another new questions, so no-one misses it. 1) Below is an original extract of my tomcat 4.1.27 server.xml. I want to enable compression in my HTTP connector. I have a customer with v. low bandwidth. I have read the Apache readme http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/coyote.html on this, but I am still not 100% clear. Would I be right in understanding that *ALL* I need to do (in the case of TC 4.*) is add the following attribute compression="on" ??? 2) Any suggestions on a way of testing this in our high bandwidth environment first ? regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
xml processing inside Tomcat
Dear List, We are using java sdk 1.4.2 which includes dom objects and a xml transformer - EVERYTHING I need for my code to work. ALL my code imports begin with javax.xml.* [interfaces] and org.w3c.dom [xml API] and javax.trasform [for xslt processing]. I want my code ALWAYS -SPECIFICALLY to use the 1.4.2 API, and not use parsers which provided by Apache Tomcat. 1] How can I force my servlet code which writes xml and returns html to the client, to ignore all the xml stuff delivered with tomcat. Here is a simplification of the code that writes the xml file. // This method writes a DOM document to a file public static void writeXmlFile(Document doc, String filename) { try { // Prepare the DOM document for writing Source source = new DOMSource(doc); // Prepare the output file File file = new File(filename); Result result = new StreamResult(file); // Write the DOM document to the file Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.transform(source, result); } catch (TransformerConfigurationException e) { } catch (TransformerException e) { } } 2] With linux even with JDK 1.4.2 and TC 1.4.27 installed I need ALWAYS to have xalan.jar installed in my WEB-INF/lib path for the code above, and for a html transformation to run. On windows with JDK 1.4.2 and TC 1.4.27 installed I dont need xalan.jar in the WEB-INF classpath. Can anyone shed light ? regards, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: xml processing inside Tomcat
Hi Yoav, Why are the classes in the lib/endorsed path better ? Surely the sun sdk is better to use !! I tried removing. But it uses crimson instead of xalan (as it should see below), and it doesnt work. I would like it to use the xalan api provided also inside of the JDK1.4.2 package. Based on the methods below to set the parser via the system properties;how would you do this in TC env ? - The value of the javax.xml.parsers.DocumentBuilderFactory Java system property - The value of the javax.xml.parsers.DocumentBuilderFactory property specified in the lib/jaxp.properties properties file in the JRE directory - The first value found in a META-INF/services/javax.xml.parsers.DocumentBuilderFactory file in the JAR files available to the runtime - The platform default (org.apache.crimson.jaxp.DocumentBuilderFactoryImpl in Suns JDK 1.4). regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using Single Sign on to access another webapp.
Dear List, We are using Tomcat 4.1.xx. We are NOT using the built in security framework which comes with TC. In the login.jsp page the user/password is validated by an external organisation wide process, which returns simply true or false. If the user is valid, the user is forwarded to the application JSP pages. The user can not access the application pages at will, because the pages check to see if a particular session flag is checked. Now my problem. I have been asked to assess if single sign On (SSO) could be used to create a URL link to another similar webapp's JSP page (TC with no security framework), where the user doesnt need to login for a second time. There is not so much info. about SSO around, but from what I gather it persists login info. inside a session which is passed between web applications. My first problem is that "my application" never knows what the password is. Can anyone see a possibilty of using SSO for me, allowing direct access to another webapps JSP page with out re-login ? Would really appreciate any help on this. Especially ones with info. more than simply "No" ;-) kind regards, Ben p.s. might be that the 2nd app has to create a web-service or something to provide the information for us!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Single Sign on to access another webapp.
Hi Everyone, Thanks for the replies. If i understand correctly, then the SSO should work between Tomcat and another j2EE type servlet container? The other app. in question is websphere. regards, Ben Bookey From: Tim Funk <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" To: Tomcat Users List Subject: Re: Using Single Sign on to access another webapp. Date: Fri, 08 Jul 2005 06:48:44 -0400 One way to do SSO is to utilize a cookie (lets call it SSO, and to be really secure - it should only be transfered over https). The existence of a cookie says the person might be logged in. The value of the cookie needs to be checked. The value of the cookie shold NOT be the user id. It can be an encrytped form of the user id, or it can be a token which the web server would use in a hash lookup to get the real user id. In the case of the hash - you'd need a "service" to be be able to handle maintenance of getting userids/tokens into the hash. Luckily for you, there are some projects out there that do this. Google is your friend here. -Tim Ben Bookey wrote: Dear List, We are using Tomcat 4.1.xx. We are NOT using the built in security framework which comes with TC. In the login.jsp page the user/password is validated by an external organisation wide process, which returns simply true or false. If the user is valid, the user is forwarded to the application JSP pages. The user can not access the application pages at will, because the pages check to see if a particular session flag is checked. Now my problem. I have been asked to assess if single sign On (SSO) could be used to create a URL link to another similar webapp's JSP page (TC with no security framework), where the user doesnt need to login for a second time. There is not so much info. about SSO around, but from what I gather it persists login info. inside a session which is passed between web applications. My first problem is that "my application" never knows what the password is. Can anyone see a possibilty of using SSO for me, allowing direct access to another webapps JSP page with out re-login ? Would really appreciate any help on this. Especially ones with info. more than simply "No" ;-) kind regards, Ben p.s. might be that the 2nd app has to create a web-service or something to provide the information for us!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Putting JNDI configurable info. inside of a properties file only
Dear List, In the example docs on the Apache web-site, all the JNDI info. is configured inside of the server.xml and web.xml. Is it possible or better said "usual" to make a data source, with the Oracle configurable JDBC URL connection info. in a separate properties file. This would mean that the JNDI info. is isolated from the web application itself, and means the web administrator need not ediit the server and web.xml files. Is this a reasonable request ? Kind regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
can I prevent DoS (Denial of Service) Attacks in JSP?
Dear List, I have been asked if its possible to prevent DoS attacks inside Java (JSP/Servlet). I guess it is ... is this something however that TC would be configured to deal with, or must I do something myself. Whats normal ? Many thanks in advance! Best wishes Ben Bookey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
global variables inside a Tomcat JSP-Servlet app.
Dear List, I hope someone can give some hints to a none java/TC -specialist. We have a jsp-servlet app, which has some important app variables inside the web.xml. Because the validation for these parameters is quite complex we have a single public class with public static setters and getters available to the all servlets and jsp pages within the application. We use a context listener to read the parameters, so we can initalise this public object reading the web.xml This works fine but I was wondering if there is a better way of doing this ? Would appreciate any comment. We are using TC 4.0 and 5.0 regards, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Login filter
Dear List, I would like to perform an action after the user logs in to our app. We are using the tomcat Realm security model, with an Oracle database. So therefoer I am trying to implement a filter in Tomcat 4.1.27, which checks for all requests on the url /j_security_check I know my filter is initialised because I do a out.println to a logfile. But for some reason when I do a successful login it doesnt perform the doFilter() method, so I suspect its something to with the mapping below. Any hints? regards '=== Here is the entry to the web.xml LoginFilter Performs pre-login and post-login operation com.myorg.myapp.filter.LoginFilter LoginFilter /j_security_check '=== == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Login filter
Hi Tim, Apologies for hassling you again with this. Any idea without getting inside of the TC source, how I can write some code just b4 and after the user login validation into the webapp with using the TC Realm and j_security_check ?? or must I go inside of the source :-( regards Ben p.s. I got this idea from a ibm websphere help doc, where it is possible ! -Ursprungliche Nachricht- Von: Tim Funk [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 3. Februar 2005 12:41 An: Tomcat Users List Betreff: Re: Login filter Filters cannot be run on j_security_check. -Tim Ben Bookey wrote: > Dear List, > > I would like to perform an action after the user logs in to our app. > We are using the tomcat Realm security model, with an Oracle database. > So therefoer I am trying to implement a filter in Tomcat 4.1.27, which > checks for all requests on the url /j_security_check > > I know my filter is initialised because I do a out.println > to a logfile. But for some reason when I do a successful login > it doesnt perform the doFilter() method, so I suspect its something > to with the mapping below. > > Any hints? > > regards > > '=== > > Here is the entry to the web.xml > > LoginFilter > Performs pre-login and post-login > operation > > com.myorg.myapp.filter.LoginFilter > > > LoginFilter > /j_security_check > > '=== > == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
, EJB's and Tomcat?, Login-valves, Realms with Oracle.. and other silly questions
Dear Tomcat users, 1. what exactly should the tags inside the web.xml do ? Is it simply a central reference for components within the webapp or does it have more powerful implications. i.e. the small icon will be used as an favicon type icon, whenever a user bookmarks a page from the webapp. 2. If I was want to make an App which levers EJB, what do *you* tomcat-users use as an EJB container normally ? I know there is Orion which is free! 3. to what extent is EJB supported within Tomcat 4 and 5? (i have seen some references to an ejb in the /examples). 4. Does any have a sample of a Tomcat valve which I could use, which causes a servlet to be processed after each time a user successfully logs in. 5. Currently we are using a form based realm, with an oracle database. We create a datasource inside of the server.xml using the commons dbcp package from apache. This works fine with Tomcat. Just for fun, we ported the webapp to an OracleApplication server 10g, where the security system failed. Am i right in thinking that we just need to copy the Oracle DataSourceFactory class inside of the server.xml (the database and hence parameters are the same)?, or could it more complicated ? regards, Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to configure a Realm in the server.xml which doesnt ask the browser to store a session.
Dear List, We have implemented the Realm with Oracle. It works fine. (see below from TC sample server.xml) However, we are wondering about upgrading our system so we dont use cookies. We believe (after earlier questions on the list! thanks! ) that this should be easy to achieve. However, we use the integrated Tomcat security Realm model, and this automatically saves a JSESSIONID sesion id as a cookie to the client browser. Is there a way around this? i.e. that this information is sent over HTTP? Would appreicate any info regards Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Subject: Re: How to handle client session information if client has sessions disabled?
Is it possible to use this sort of session handling (passing the SESSION ID over HTTP) when using the Realm security feature within TC ? I have noticed that there is a cookie saved, JSESSIONID which stores the SessionID. Would appreciate any info. Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]