PreparedStatement Unicode MySQL
Hi, I am having trouble inserting and retrieving Asian characters in my MySQL DB using PreparedStatement. I have set up my table thus: CREATE TABLE `messages` ( `id` int(10) unsigned NOT NULL auto_increment, `message_body` text NOT NULL, `sender_number` text NOT NULL, `shortcode` text NOT NULL, `image` longblob, PRIMARY KEY (`id`) ) CHARACTER SET utf8 TYPE=MyISAM; and am inserting using a PreparedStatement - pstmt.setString(indexOfColumnInQuestion, asianTextString); to insert in to message_body. However, when viewing the column in the query browser, and retrieving it from a ResultSet, it reads ? ??? and so on (I am attempting to insert Thai characters in this instance). Is there a method of PreparedStatement I am missing? thanks and regards Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
io.File relative path constructor
Hi, A should-be easy one - I do not wish to define an absolute path to a File as it will packaged in a JAR, therefore its path will change. How do I construct a File relative to my src root, something like File file = new File(/path/myFile.xml);? I tried passing in a URL, URI but am getting: Exception in thread main java.lang.IllegalArgumentException: URI is not hierarchical when I jar and run it. Am using Win XP + Java 1.5. Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Input stream
Hi All, I have a socket receiving streams of XML. I receive an InputStream, but short of a dirty hack, do not know when (or how) I pass the stream/contents to be parsed. Any thoughts/resources on parsing streaming XML please? Thanks Paul.
RE: Input stream
Hi thanks, Parsing a file would not normally be a problem, but as it is a stream, there is no EOF and when I parse the stream into: DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); db.parse(in); I get: org.xml.sax.SAXParseException: The processing instruction target matching [xX][mM][lL] is not allowed. What I have read on this message means invalid XML. And if there were no EOF that would be expected? I have tried parsing the simplest of XML files. This is my dirty hack - I can delimit the 'packet' with some obscure character while populating say a StringBuffer, write it to File, and re-parse it (I did say it was dirty;). A packet is the contents of a complete XML file which are sent randomly. So my problem is not the parsing, but capturing the fragment of an inputstream that will parse as valid XML. All input appreciated rgds Paul. You can use different things, but directly programming you can use SAX2, XMLReader, and XMLReaderFactory.createXMLReadersee JDK javax.xml package documentation. You could use a DOM object, but I wouldn't recommend it because of memory usage. You can change the underlying XML parser impls for your JDK as well. Hope it helps, Wade --- Chris Lamprecht [EMAIL PROTECTED] wrote: See XmlPull: http://www.xmlpull.org/ On 8/15/05, Paul Wallace [EMAIL PROTECTED] wrote: Hi All, I have a socket receiving streams of XML. I receive an InputStream, but short of a dirty hack, do not know when (or how) I pass the stream/contents to be parsed. Any thoughts/resources on parsing streaming XML please? Thanks Paul. - 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]
data push
Hi All, I would like server A (TC 5.5) to 'push' streams of data to server B (TC 5.5) at random points in time, and for server B to accept the data when it is received. This is not using request / response, hence I am new to this topic. A couple of questions - what protocol(s) can be used, HTTP? How does one push data, than than have it requested? Can anyone point me towards a resource of this nature please? I understand sockets are in the picture - also new to me. Thanks Paul. Paul Wallace BSc Hons. IPTV Specialist Two Way TV Australia Level 3, City West Centre 55 Pyrmont Bridge Road Pyrmont Sydney, NSW 2009 Australia Tel +61 2 9017 7000 Fax +61 2 9017 7001 Mb +61 422 538 465 Skype wallacpaul
control Array
Hi, How might I request a series of checkboxes that all share the same name? E.g: form input type=checkbox name=myCheck value=01 input type=checkbox name=myCheck value=02 input type=checkbox name=myCheck value=03 /form I understand in VB something called a control array exists, that retrieves the checked checkbox values and stores them in an array. This is also possible in CFM. Is there the equivalent in Java/HTTP? Something where I DON'T have to do: input type=checkbox name=myCheck1 value=01 input type=checkbox name=myCheck2 value=02 input type=checkbox name=myCheck3 value=03 % for (int i = 0;i noofCheckboxes; i++) { myarr[i] = request.getParameter(myCheck + i); } % Thanks for any replies, or direction towards doco re this. Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
double format
Hi all, A simple one for most..how do I enforce a double primitive format? E.g 00.00, or to enforce 2 and only 2 decimal points? Thanks Paul.
RE: double format
Obviously I am, I now have a value with approx 30 decimal points. What method formats to ii.dd ? Paul. BigDecimal? Or am I on drugs? -Original Message- From: Paul Wallace [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 September 2003 2:23 PM To: [EMAIL PROTECTED] Subject: double format Hi all, A simple one for most..how do I enforce a double primitive format? E.g 00.00, or to enforce 2 and only 2 decimal points? Thanks Paul. The content of this e-mail, including any attachments is a confidential communication between Virgin Blue and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). Virgin Blue respects your privacy. Our privacy policy can be accessed from our website: www.virginblue.com.au - 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: double format
That's sorted..thanks. I'll have some of what you're having.. Paul. I meant I was on drugs.. I never post to anything.. And I guessed I as going to post wrong.. You can do something linke BigDecimal bleh = new BigDecimal(12345.678); BigDecimal blah = bleh.setScale(2, BigDecimal.ROUND_HALF_DOWN); Or something... -Original Message- From: Paul Wallace [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 September 2003 2:46 PM To: Tomcat Developers List Subject: RE: double format Obviously I am, I now have a value with approx 30 decimal points. What method formats to ii.dd ? Paul. BigDecimal? Or am I on drugs? -Original Message- From: Paul Wallace [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 September 2003 2:23 PM To: [EMAIL PROTECTED] Subject: double format Hi all, A simple one for most..how do I enforce a double primitive format? E.g 00.00, or to enforce 2 and only 2 decimal points? Thanks Paul. The content of this e-mail, including any attachments is a confidential communication between Virgin Blue and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). Virgin Blue respects your privacy. Our privacy policy can be accessed from our website: www.virginblue.com.au - 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] The content of this e-mail, including any attachments is a confidential communication between Virgin Blue and the intended addressee and is for the sole use of that intended addressee. If you are not the intended addressee, any use, interference with, disclosure or copying of this material is unauthorized and prohibited. If you have received this e-mail in error please contact the sender immediately and then delete the message and any attachment(s). Virgin Blue respects your privacy. Our privacy policy can be accessed from our website: www.virginblue.com.au - 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: window close session invalidate
Hi, That might be the case, but the window I am closing is a popup window that derives from the original. The original window remains unscathed. Paul. That is according to the spec, The session only lives for the time of the application,closing your browser window, means that you are ending your application Filip -Original Message- From: Paul Wallace [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 9:01 PM To: Tomcat Developers List Subject: window close session invalidate Dear all, May someone enlighten me on why my session is being invalidated when I close a browser window? I am doing this in one of two ways - the application close icon on the top right of the window, or a simple: a href=javascript:window.close();CLOSE/a Does anyone have any experience of this? The session is being killed and thus so is my app. I will submit this query to the user list, but thought it appropriate for this list as I am getting the same result from multiple instances of TC on different servers, implying it is not a configuration issue as first suspected. Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: window close session invalidate
OK, Thanks for that. An interesting note however..after some testing, the session is not killed when run from another terminal i.e running the same instance of TC (same server) but from different terminals. That would suggest it is an IE configuration issue (at much annoyance to certain developers). I will at this stage bring this up on the user list! Thanks Paul. i had the same problem with internet explorer. mozilla seems to work properly. i tracked the problem down and found out that internet explorer looses the session cookie when closing the popup browser window. then i added DefaultContext cookies=false / to my virtualhost definition in server.xml to disable the session-cookie mechanism. after that everything worked fine for me. remember to encode all urls with response.encodeURL(). jochen schwörer Wednesday, August 6, 2003, 6:00:57 AM, you wrote: PW Dear all, PW May someone enlighten me on why my session is being invalidated PW when I close a browser window? I am doing this in one of two ways - the PW application close icon on the top right of the window, or a simple: PW a href=javascript:window.close();CLOSE/a PW Does anyone have any experience of this? The session is being killed and PW thus so is my app. I will submit this query to the user list, but PW thought it appropriate for this list as I am getting the same result PW from multiple instances of TC on different servers, implying it is not a PW configuration issue as first suspected. PW Thanks PW Paul. PW - PW To unsubscribe, e-mail: [EMAIL PROTECTED] PW For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: window close session invalidate
-Original Message- From: Paul Wallace Sent: Thursday, 7 August 2003 9:20 AM To: Tomcat Developers List Subject: RE: window close session invalidate OK, Thanks for that. An interesting note however..after some testing, the session is not killed when run from another terminal i.e running the same instance of TC (same server) but from different terminals. That would suggest it is an IE configuration issue (at much annoyance to certain developers). I will at this stage bring this up on the user list! Thanks Paul. i had the same problem with internet explorer. mozilla seems to work properly. i tracked the problem down and found out that internet explorer looses the session cookie when closing the popup browser window. then i added DefaultContext cookies=false / to my virtualhost definition in server.xml to disable the session-cookie mechanism. after that everything worked fine for me. remember to encode all urls with response.encodeURL(). jochen schwörer Wednesday, August 6, 2003, 6:00:57 AM, you wrote: PW Dear all, PW May someone enlighten me on why my session is being invalidated PW when I close a browser window? I am doing this in one of two ways - the PW application close icon on the top right of the window, or a simple: PW a href=javascript:window.close();CLOSE/a PW Does anyone have any experience of this? The session is being killed and PW thus so is my app. I will submit this query to the user list, but PW thought it appropriate for this list as I am getting the same result PW from multiple instances of TC on different servers, implying it is not a PW configuration issue as first suspected. PW Thanks PW Paul. PW - PW To unsubscribe, e-mail: [EMAIL PROTECTED] PW For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: window close session invalidate
Also, I was under the impression that 'session' is good for the amount of time specified in your configuration file, or until session.invalidate(); is called? Thanks Paul. That is according to the spec, The session only lives for the time of the application,closing your browser window, means that you are ending your application Filip -Original Message- From: Paul Wallace [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 9:01 PM To: Tomcat Developers List Subject: window close session invalidate Dear all, May someone enlighten me on why my session is being invalidated when I close a browser window? I am doing this in one of two ways - the application close icon on the top right of the window, or a simple: a href=javascript:window.close();CLOSE/a Does anyone have any experience of this? The session is being killed and thus so is my app. I will submit this query to the user list, but thought it appropriate for this list as I am getting the same result from multiple instances of TC on different servers, implying it is not a configuration issue as first suspected. Thanks Paul. - 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]
window close session invalidate
Dear all, May someone enlighten me on why my session is being invalidated when I close a browser window? I am doing this in one of two ways - the application close icon on the top right of the window, or a simple: a href=javascript:window.close();CLOSE/a Does anyone have any experience of this? The session is being killed and thus so is my app. I will submit this query to the user list, but thought it appropriate for this list as I am getting the same result from multiple instances of TC on different servers, implying it is not a configuration issue as first suspected. Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session expiry
Hello All, A simple one? I have my session defined in a servlet thus: HttpSession session = req.getSession(); session.setAttribute(userSession, h); // (h = HashMap) how or where do define session parameters such as expiry? I would ideally like my session to die when I call a specified method e.g close() { // kill my session here } or failing that, how do I define a length of time for the session life? Thanks Paul.
oddity
Hello, Can someone please tell me how to configure (I am assuming it is a configuration issue) TC such that my servlets do not insist on persisting. Even when I clear IE history, delete temporary Internet files, cookies, delete the class its self! I literally removed the servlet class and it was still running and outputting to the browser! I eventually had to restart the server each time this happened. Obviously not an acceptable way to develop. Is it an entry in conf/server.xml? Many thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect from Servlet
Hi, thanks, I added the line. No 404 is present, but the servlet maintains, ie the browser is completely blank. What about the (/xxx.jsp) path? Thanks Paul. Try this getServletConfig().getServletContext().getRequestDispatcher(/xxx.jsp). forward(request, response); - Original Message - From: Paul Wallace [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Thursday, June 26, 2003 11:21 AM Subject: redirect from Servlet Hello, I have a packaged servlet (com.mypackage.servlets;) in WEB-INF\classes\com\mypackage\servlets, where it performs its logic dutifully. From the servlet I wish to redirect back to the JSP that called it. Currently the JSP origin cannot be found (404). I have tried all manner of variations of path: res.sendRedirect(addAgent.jsp); including a fully formed URL (local and HTTP). How do I redirect to the desired file please? Thanks Paul. - 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]
redirect from Servlet
Hello, I have a packaged servlet (com.mypackage.servlets;) in WEB-INF\classes\com\mypackage\servlets, where it performs its logic dutifully. From the servlet I wish to redirect back to the JSP that called it. Currently the JSP origin cannot be found (404). I have tried all manner of variations of path: res.sendRedirect(addAgent.jsp); including a fully formed URL (local and HTTP). How do I redirect to the desired file please? Thanks Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
var retrieval from checkbox (with single name)
Hi, I wish to retrieve / store values of multiple checkboxes checked in the previous page. The problem here is I dont know how many boxes (a dynamic amount of them is output), and the checkboxes must have the same name. I wish to do something similar to Hotmail where I check an amount of checkboxes, then manipulate the values in the next page. The reason they all must be name the same - chkboxarray - is to allow a Hotmail style 'check-all', 'uncheck all' facility (below). The reason for this being that the check boxes checked contain email recipient ID's (JSP) where I am concatonating email address as a String value to add to a BCC field. I have tried retrieving and storing in an array but all I get is the value for the first checkbox. Any ideas how I can achieve what I'm trying to do while retrieveing the values with a single checkbox name, or maybe there's someone with a better solution out there?! Perhaps I need to assign the checkboxes different names, and edit the JS? (I dont know how to do this)! Thanks for all input Paul. script language= JavaScript function modify_boxes(to_be_checked,total_boxes){ for ( i=0 ; i total_boxes ; i++ ) { if (to_be_checked) { document.forms[0].chkboxarray[i].checked=true; } else { document.forms[0].chkboxarray[i].checked=false; } } } /script -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat in industry
Hello, I don't know where I heard it, or if indeed I heard it all, but can someone clarify if Tomcat can be used in industrial strength web applications? That is, is it able to handle for example, traffic of 100 hits p/s? Must it be integrated with the Apache web server to make it so? Where may I find such information regarding this please? Thanks Paul. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Pandora's box / can of worms etc.
What is MinTC? Where can I get information on it? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Synchronous Tomcat and Apache
Hi, I would like to use Tomcat to run my JSP, with Apache serving the HTML output. How may I configure Tomcat and Apache to acheive this please? Perhaps I may be directed toward / emailed an appropriate document where I can find out how to do this. Currently, I have Tomcat 4.0, Apache 1.3.? on Linux Redhat 7.0 and have been developing / testing my JSP on the Tomcat server on port 8080, while Apache is running on port 80. Thanks for your help Paul. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
ResultSet
Hi, For the brave, can anyone guess why with this rather unsociable code: if ((res.getString(3) == null) || (res.getString(3) == )) { out.println(tda href=takeDetails.jsp?timeSlot= + res.getString(2) + myDate= + myDate + + res.getString(2) + /a/td); } if ((res.getString(3) != null) || (res.getString(3) != )) { out.println(td + res.getString(3)+ + res.getString(2) + /td); } the first condition is NEVER satisfied, even though out.println of res.getString(3) does not display anything! Ie res.getString(3) IS null, empty or whatever, but the condition is never satisifed. Quickly again, this is executed: if ((res.getString(3) != null) || (res.getString(3) != )) { out.println(td + res.getString(3)+ + res.getString(2) + /td); } even though - out.println(td + res.getString(3)+ - shows it is empty (no output)! Thanks Paul. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cookie retrieval II
Hello Everyone, Similar to a previous posting, I have some code to make a cookie: Cookie cook = new Cookie(memberCookie, userid); cook.setPath(/mydir); response.addCookie(cook); and to retreive the cookie: Cookie cookies[] = request.getCookies(); for(int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(memberCookie)); { out.println(Welcome: + cookies[i].getValue() + p); } } to retrieve the cookie. It retrieves the value but with an additional nuisance. I get the desired cookie, but also what appears to be the session ID (output below). Welcome: paul Welcome: 61D0D4C3E11302B07308C3D960D13840 I am obviously looping through the length of the cookies array, retrieving the value, but also this unwanted text. What can I do to retrieve just the value please? It looks like my if condition is being satisified twice?! Frustrated Paul. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cookie retrieval
Hi, a have a JSP page to setup a cookie (Tomcat server): cook = new Cookie(memberCookie, userid); cook.setPath(c:/Program Files/jakarta-tomcat-4.0/webapps/mydir/login/); response.addCookie(cook); response.sendRedirect(http://myhost/somelocation/mydir/bookings/enterDate.j sp); and the page to retrieve the cookie (enterDate.jsp) is: Cookie cookies[] = request.getCookies(); if(cookies != null) { for(int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(memberCookie)); out.println(Welcome: + cookies[i].getValue()); } } Here's the conundrum, if the cookie is retrieved from a page that is in a DIFFERENT directory that setup the cookie , the output (getValue) returns only a sessionID ie 8455352001D0C01849A2C480576723D8 and not the required value. BUT, if the cookie is retrieved from a file in the SAME directory of setup, the desired output is obtained, plus the same JSESSIONID info. How may I simply obtain the value of the cookie from any directory, and not the session ID? I have tried using setPath (above) pointing to the setup and destination directories with same unwanted session ID output. Perhaps my syntax of setPath is the problem here? Surely I do not have to setup and retrieve cookies using files that are in the same directory? Thanks for all input Paul. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]