RE: Getting a request in a non English character
Mark , Sorry for nagging you )-; but this is exacly what I did : //THE CLIENT: import java.io.*; import java.net.*; public class HttpClientHebrew5Test { public static void main(String[] args) { try { String host = "127.0.0.1"; String port = "8083"; String line = null; BufferedReader bri = new BufferedReader(new InputStreamReader(new FileInputStream("send"),"Cp1255")); line = bri.readLine(); // read just one line from hebrew text String data = "name=" + URLEncoder.encode(line, "Cp1255"); URL test = new URL("http://"+host+":"+port+"/userprofiles/hebrew5test";); URLConnection req = test.openConnection(); req.setDoOutput(true); req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=windows-1255"); req.setRequestProperty("Content-Length", Integer.toString(data.length())); OutputStream out = req.getOutputStream(); out.write(data.getBytes("Cp1255")); out.close(); InputStream in = req.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(in,"Cp1255")); File f = new File("received.xml"); FileWriter fw = new FileWriter(f); while ((line = br.readLine()) != null) { System.out.println(line); fw.write(line); } fw.close(); } catch (Exception e) { e.printStackTrace(); } } } //THE SERVER import javax.servlet.*; import javax.servlet.http.*; import java.io.IOException; import java.io.PrintWriter; public class Hebrew5test extends HttpServlet { public Hebrew5test(){ super(); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("Cp1255"); response.setContentType("text/html; charset=windows-1255"); PrintWriter out = response.getWriter(); String name = request.getParameter("name"); System.out.println(name); out.println(name); } } The result is that i get a file received.xml with "" which are four 0x3F. The "send" file is "yair" in hebrew , windows -1255 encoded - which is 0xE9 0xE0 0xE9 0xF8 I use Tomcat5. and I have my server.xml configured with what else can it be ? Regards, Yair - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache virtual host mapped to tomcat context
Hello, I am trying to setup apache virtual hosts mapped to tomcat contexts using apache 2.0, jk2 and tomcat 5. Everything in the connection apache-jk2-tomcat seems to work fine, except for the fact it seems I'm not able to configure apache virtual hosts mapped to particular tomcat contexts. What I'd like is having virtual hosts such as wiki.xxx.com blog.xxx.com mapped to tomcat contexts such as /wiki and /blog I have already read a lot of online documentation, tutorials and examples, but nothing seems to specifically cover this issue. The jk2 documentation specifies there should be a "context" property that should specify the webapp context we want to be called for a particular virtual host, but this doesn't seem to work. More specifically, I have this in my httpd.conf: ServerAdmin [EMAIL PROTECTED] DocumentRoot c:/web/jspwiki ServerName wiki2.xxx.com ErrorLog logs/wiki2-error_log CustomLog logs/wiki2-access_log common JkUriSet group lb JkUriSet context /wiki ServerAdmin [EMAIL PROTECTED] DocumentRoot c:/web/jspwiki ServerName blog2.xxx.com ErrorLog logs/blog2-error_log CustomLog logs/blog2-access_log common JkUriSet context /roller I've tried various entries in the tag (putting "worker" and "uri" properties as well, more or less by hazard because the documentation is not very clear), but none of them seem to matter: with this configuration, what happens is simply that if I call wiki2.xxx.com or blog2.xxx.com the normal tomcat root is served, and if I try to access the subcontexts (i.e.: wiki2.xxx.com/wiki) everything works normally. In workers2.properties I have the following: [logger] level=INFO [uriMap:] info=Maps the requests. Options: debug debug=1 [workerEnv:] info=Global server options timing=1 debug=1 [lb:lb] info=Default load balancer. debug=1 [channel.socket:localhost:8009] info=Ajp13 forwarding over socket host=localhost port=8009 debug=1 tomcatId=localhost:8009 group=lb [status:] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [uri:wiki2.xxx.com/] info=jspwiki context=/wiki group=lb debug=0 [uri:blog2.xxx.com/] info=roller weblogger context=/roller group=lb Any idea why this won't work? Many thanks, Davide Baroncelli. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting a request in a non English character
This article may shed some light on your problem.. http://www.javaworld.com/javaworld/jw-04-2004/jw-0419-multibytes.html? Mark Thomas wrote: Try specifying the encoding in your client as as "windows-1255" Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, April 25, 2004 6:28 PM To: [EMAIL PROTECTED] Subject: RE: Getting a request in a non English character Mark, Your client and servlet works!! Thanks. Now I have only one request, I tried to modify the client, that instead of preparing a predefined line: String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); The client will read a file that is written in a windows -1255 encoding BufferedReader bri = new BufferedReader(new InputStreamReader(new FileInputStream("request"),"Cp1255")); String line = bri.readLine(); // read just one line from hebrew request text String data = URLEncoder.encode(line, "cp1255"); And this some how doesn't work , Any suggestions? Regard Yair -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Sunday, April 25, 2004 5:09 PM To: 'Tomcat Users List' Subject: RE: Getting a request in a non English character Got this working. Mainly just the issue of the encoding that was being used for the response from the servlet. You need to be careful with the names of the encoding as they can differ between operating systems. My recommendation would be to always use UTF-8. My version of your servlet and client are below. Hope this helps Mark SERVLET === package test.encoding; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Echo extends HttpServlet { public Echo() { super(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("cp1255"); response.setContentType("text/html; charset=windows-1255"); PrintWriter out = response.getWriter(); String name = request.getParameter("name"); out.println(name); } } CLIENT == package test.encoding; import java.io.BufferedReader; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; public class Client { public static void main(String[] args) { try { String host = "localhost"; String port = "8080"; // the unicode for "Yair" in hebrew. String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); // URL test = new URL("http://"+host+":"+port+"/Bugfix/encoding/bug14742Output.jsp";); URL test = new URL("http://"+host+":"+port+"/Bugfix/servlet/Echo";); URLConnection req = test.openConnection(); req.setDoOutput(true); req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=windows-1255"); req.setRequestProperty("Content-Length", Integer.toString(data.length())); OutputStream out = req.getOutputStream(); // writing the request in Cp1255 encoding. out.write(data.getBytes("cp1255")); out.close(); InputStream in = req.getInputStream(); // reading the response in Cp1255 encoding. BufferedReader br = new BufferedReader(new InputStreamReader(in)); // instead of getting my name in hebrew . I get "" four times 0xF9 in the text file in.txt File f = new File("in.txt"); FileWriter fw = new FileWriter(f); int code; while ((code = br.read()) != -1) { System.out.println(code); fw.write(code); } fw.close(); } catch (Exception e) { e.printStackTrace(); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- (¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯) The early bird gets the worm, but the second mouse gets the cheese... ICQ 1202948 (¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯)
RE: Getting a request in a non English character
Try specifying the encoding in your client as as "windows-1255" Mark > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 25, 2004 6:28 PM > To: [EMAIL PROTECTED] > Subject: RE: Getting a request in a non English character > > Mark, > Your client and servlet works!! Thanks. > Now I have only one request, > I tried to modify the client, that instead of preparing a > predefined line: > String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", > "cp1255"); > The client will read a file that is written in a windows > -1255 encoding > > BufferedReader bri = new BufferedReader(new > InputStreamReader(new > FileInputStream("request"),"Cp1255")); > String line = bri.readLine(); // > read just one line from hebrew request text > String data = URLEncoder.encode(line, "cp1255"); > > And this some how doesn't work , > Any suggestions? > Regard > Yair > > > -Original Message- > From: Mark Thomas [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 25, 2004 5:09 PM > To: 'Tomcat Users List' > Subject: RE: Getting a request in a non English character > > Got this working. Mainly just the issue of the encoding that > was being used > for > the response from the servlet. You need to be careful with > the names of the > encoding as they can differ between operating systems. My > recommendation > would > be to always use UTF-8. My version of your servlet and client > are below. > > Hope this helps > > Mark > > > SERVLET > === > package test.encoding; > > import java.io.IOException; > import java.io.PrintWriter; > > import javax.servlet.ServletException; > import javax.servlet.http.HttpServlet; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > public class Echo extends HttpServlet { > > public Echo() { > super(); > } > > public void doGet(HttpServletRequest request, HttpServletResponse > response) > throws ServletException, IOException { > > doPost(request, response); > } > > public void doPost( > HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > > request.setCharacterEncoding("cp1255"); > > response.setContentType("text/html; charset=windows-1255"); > > PrintWriter out = response.getWriter(); > String name = request.getParameter("name"); > out.println(name); > } > > } > > CLIENT > == > package test.encoding; > > import java.io.BufferedReader; > import java.io.File; > import java.io.FileWriter; > import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStream; > import java.net.URL; > import java.net.URLConnection; > import java.net.URLEncoder; > > public class Client { > > public static void main(String[] args) { > try { > String host = "localhost"; > String port = "8080"; > > // the unicode for "Yair" in hebrew. > String data = "name=" + > URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); > // URL test = new > URL("http://"+host+":"+port+"/Bugfix/encoding/bug14742Output.jsp";); > URL test = new > URL("http://"+host+":"+port+"/Bugfix/servlet/Echo";); > URLConnection req = test.openConnection(); > req.setDoOutput(true); > req.setRequestProperty("Content-Type", > "application/x-www-form-urlencoded; charset=windows-1255"); > req.setRequestProperty("Content-Length", > Integer.toString(data.length())); > OutputStream out = req.getOutputStream(); > // writing the request in Cp1255 encoding. > out.write(data.getBytes("cp1255")); > out.close(); > > InputStream in = req.getInputStream(); > // reading the response in Cp1255 encoding. > BufferedReader br = new BufferedReader(new > InputStreamReader(in)); > // instead of getting my name in hebrew . I get > "" four > times > 0xF9 in the text file in.txt > File f = new File("in.txt"); > FileWriter fw = new FileWriter(f); > int code; > while ((code = br.read()) != -1) { > System.out.println(code); > fw.write(code); > } > fw.close(); > } catch (Exception e) { > e.printStackTrace(); > } > > } > } > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Fw: new apps won't deploy, not sure what's going on
Jonathan R. Myers wrote: OK, I get this message: No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. I have tomcat installed in C:\Tomcat5.0 and %CATALINE_HOME is: C:\Tomcat5.0 JAVA_HOME is:C:\j2re1.4.2_04 which is where I have java installed I can get tomcat to run and it loads the default tomcat page and I can load the examples but I tried creating a new context and I always get the error above. I just wanted one of the new contexts to be a folder with subfolders that contained images and that won't even load. I'm running XP with Tomcat5.0.19-all settings are default for Tomcat except running on port 80. I've installed Tomcat4.0 before and was able to get it up and running in no time. Does anyone have any ideas? Thanks, J.R. C:\j2re1.4.2_04 is your problem. You need to download a JDK not a JRE. The JSP's use javac and JRE doesn't have any development tools (javac nor any other JDK tool). That's why the error message you got mentions getting tools.jar from a JDK not a JRE ;-). Hope that helps you out. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting a request in a non English character
Mark, Your client and servlet works!! Thanks. Now I have only one request, I tried to modify the client, that instead of preparing a predefined line: String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); The client will read a file that is written in a windows -1255 encoding BufferedReader bri = new BufferedReader(new InputStreamReader(new FileInputStream("request"),"Cp1255")); String line = bri.readLine(); // read just one line from hebrew request text String data = URLEncoder.encode(line, "cp1255"); And this some how doesn't work , Any suggestions? Regard Yair -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Sunday, April 25, 2004 5:09 PM To: 'Tomcat Users List' Subject: RE: Getting a request in a non English character Got this working. Mainly just the issue of the encoding that was being used for the response from the servlet. You need to be careful with the names of the encoding as they can differ between operating systems. My recommendation would be to always use UTF-8. My version of your servlet and client are below. Hope this helps Mark SERVLET === package test.encoding; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Echo extends HttpServlet { public Echo() { super(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("cp1255"); response.setContentType("text/html; charset=windows-1255"); PrintWriter out = response.getWriter(); String name = request.getParameter("name"); out.println(name); } } CLIENT == package test.encoding; import java.io.BufferedReader; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; public class Client { public static void main(String[] args) { try { String host = "localhost"; String port = "8080"; // the unicode for "Yair" in hebrew. String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); // URL test = new URL("http://"+host+":"+port+"/Bugfix/encoding/bug14742Output.jsp";); URL test = new URL("http://"+host+":"+port+"/Bugfix/servlet/Echo";); URLConnection req = test.openConnection(); req.setDoOutput(true); req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=windows-1255"); req.setRequestProperty("Content-Length", Integer.toString(data.length())); OutputStream out = req.getOutputStream(); // writing the request in Cp1255 encoding. out.write(data.getBytes("cp1255")); out.close(); InputStream in = req.getInputStream(); // reading the response in Cp1255 encoding. BufferedReader br = new BufferedReader(new InputStreamReader(in)); // instead of getting my name in hebrew . I get "" four times 0xF9 in the text file in.txt File f = new File("in.txt"); FileWriter fw = new FileWriter(f); int code; while ((code = br.read()) != -1) { System.out.println(code); fw.write(code); } fw.close(); } catch (Exception e) { e.printStackTrace(); } } }
Re: Fw: new apps won't deploy, not sure what's going on
Are you running as a service? If so, try running running with the startup script. The default "service.bat" doesn't add tools.jar to the "ImagePath". You will need to do this in order for JSP's to be compiled. The examples run because they are all pre-compiled and mapped as servlets. I don't see why they are because then you get questions like this where you think that JSP's work for the apps that ship with Tomcat, but not yours so you try to figure out what you are doing wrong when you aren't doing anything wrong because it is a problem with Tomcat itself. Plus it would make it more apparent to the Tomcat developers that tools.jar needs to be added to the "ImagePath" since the jsp examples won't work until that happens. As for running over Port 80, are you fronting that with Apache or did you change the Tomcat connector config to use port 80? When you say images won't even load, I suspect it is bad configuration of the former. I suggest getting everything to work with the defaults with no jk connector stuff and only then modifying things to your liking. Jake At 09:53 AM 4/25/2004 -0400, you wrote: OK, I get this message: No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. I have tomcat installed in C:\Tomcat5.0 and %CATALINE_HOME is: C:\Tomcat5.0 JAVA_HOME is:C:\j2re1.4.2_04 which is where I have java installed I can get tomcat to run and it loads the default tomcat page and I can load the examples but I tried creating a new context and I always get the error above. I just wanted one of the new contexts to be a folder with subfolders that contained images and that won't even load. I'm running XP with Tomcat5.0.19-all settings are default for Tomcat except running on port 80. I've installed Tomcat4.0 before and was able to get it up and running in no time. Does anyone have any ideas? Thanks, J.R. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting a request in a non English character
Got this working. Mainly just the issue of the encoding that was being used for the response from the servlet. You need to be careful with the names of the encoding as they can differ between operating systems. My recommendation would be to always use UTF-8. My version of your servlet and client are below. Hope this helps Mark SERVLET === package test.encoding; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Echo extends HttpServlet { public Echo() { super(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("cp1255"); response.setContentType("text/html; charset=windows-1255"); PrintWriter out = response.getWriter(); String name = request.getParameter("name"); out.println(name); } } CLIENT == package test.encoding; import java.io.BufferedReader; import java.io.File; import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; public class Client { public static void main(String[] args) { try { String host = "localhost"; String port = "8080"; // the unicode for "Yair" in hebrew. String data = "name=" + URLEncoder.encode("\u05d9\u05d0\u05d9\u05e8", "cp1255"); // URL test = new URL("http://"+host+":"+port+"/Bugfix/encoding/bug14742Output.jsp";); URL test = new URL("http://"+host+":"+port+"/Bugfix/servlet/Echo";); URLConnection req = test.openConnection(); req.setDoOutput(true); req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=windows-1255"); req.setRequestProperty("Content-Length", Integer.toString(data.length())); OutputStream out = req.getOutputStream(); // writing the request in Cp1255 encoding. out.write(data.getBytes("cp1255")); out.close(); InputStream in = req.getInputStream(); // reading the response in Cp1255 encoding. BufferedReader br = new BufferedReader(new InputStreamReader(in)); // instead of getting my name in hebrew . I get "" four times 0xF9 in the text file in.txt File f = new File("in.txt"); FileWriter fw = new FileWriter(f); int code; while ((code = br.read()) != -1) { System.out.println(code); fw.write(code); } fw.close(); } catch (Exception e) { e.printStackTrace(); } } } > -Original Message- > From: Yair Fine [mailto:[EMAIL PROTECTED] > Sent: Sunday, April 25, 2004 12:16 AM > To: [EMAIL PROTECTED] > Subject: RE: Getting a request in a non English character > > Hi Mark, > > Thanks again for you help. > In order to help you help me (-' , I will give more details on my goal > and my problem: > I want to build a servlet which let application clients ( not HUMAN.a > client application, thus HTML forms will do no use here) > Send HTTP requests to the servlet, which queries a DB > (Oracle), and then > the servlet sends back a response to the client application > The requests must support windows-1255 charset encoding > (Windows Hebrew) > > At first I decided to receive the request parameters , using > GET request > , and I attached previously the code, which works fine , and I could > even for debug purpose send the request in the url of IE > browser (though > the client application wouldn't use a browser ,but call GET > request with > the parameters desired, using windows-1255 charset encoding) > > After reading your response and other forums response, which > agreed that > sending a non English characters in GET request is a bad idea, > I decided to implement it with POST. So now I have two problems > 1. writing the servlet. > 2. writing a client that will send requests using POST. > > Here is a sample servlet and client. It should have worked > but it don't > (-: , I figure it is a small thing, but did not found it till far. > > > THIS IS THE SERVER'S CODE: > import javax.servlet.*; > import javax.servlet.http.*; > import java.io.IOException; > import java.io.PrintWriter; > public class Hebrew3test extends HttpServlet { > public void doPost(HttpServletRequest request, > HttpServletResponse response) > throws Ser
Fw: new apps won't deploy, not sure what's going on
OK, I get this message: No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path. I have tomcat installed in C:\Tomcat5.0 and %CATALINE_HOME is: C:\Tomcat5.0 JAVA_HOME is:C:\j2re1.4.2_04 which is where I have java installed I can get tomcat to run and it loads the default tomcat page and I can load the examples but I tried creating a new context and I always get the error above. I just wanted one of the new contexts to be a folder with subfolders that contained images and that won't even load. I'm running XP with Tomcat5.0.19-all settings are default for Tomcat except running on port 80. I've installed Tomcat4.0 before and was able to get it up and running in no time. Does anyone have any ideas? Thanks, J.R.
Re: Re: Bean's problem
On Sun, Apr 25, 2004 at 12:57:53PM +0200, [EMAIL PROTECTED] wrote: : Yeah, I've changed my source code and add : package beanservlets; situation is the same. I'll assume the following: Tomcat sees the new, corrected .class file and not the old one (in WEB-INF/lib) Tomcat was restarted My only other idea is that there's a rogue JAR in one of: WEB-INF/lib {tomcat install}/common/lib {tomcat install}/server/lib Duplicate jars cause some very misleading error messages. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jasper: out.write() for every tag
On Sun, Apr 25, 2004 at 11:36:10AM +0200, Folke Behrens wrote: : AFAIK the javac and the jit compiler are both not allowed to optimize : this. So this must somewhat hurt performance, right? What does your profiler tell you? If you're adventurous, you could take the generated Java source and fold all of those write()s into a single call, then compare. : I did some search and read earlier posts in the tomcat-* lists but : couldn't find any information about this. Have you any tips/URLs for me? Well, since you asked for tips ;) don't worry about it Better yet, don't worry about it until you're having an IO-based performance problem and a profiler has determined that out.write() is at fault If JSPWriter is buffered (should be), buffering offsets the impact of the write() calls. It's not as though every call to write() sends data across the wire. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sendng automatic email with tomcat
Masood Drop me an email at [EMAIL PROTECTED] and I will send you some code. Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volume4.Development.Multimedia.Branding emotionalize.conceptualize.visualize.realize Tel: +27125468436 Fax: +27125468436 email:[EMAIL PROTECTED] web: www.volume4.com This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you. :: -Original Message- :: From: Masood Reyhanei Hamedani [mailto:[EMAIL PROTECTED] :: Sent: Sunday, April 25, 2004 1:03 PM :: To: [EMAIL PROTECTED] :: Subject: Sendng automatic email with tomcat :: :: Dear all :: :: I have a registration webpage for a Mathematics seminar and I want to send an reply :: email for anyone that registers for it. :: :: I know that, I must using Javamail with tomcat, but how? :: :: Is there anyone to help me? :: :: with thanks. :: masood. :: :: :: - :: Do you Yahoo!? :: Yahoo! Photos: High-quality 4x6 digital prints for 25¢ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sendng automatic email with tomcat
Dear all I have a registration webpage for a Mathematics seminar and I want to send an reply email for anyone that registers for it. I know that, I must using Javamail with tomcat, but how? Is there anyone to help me? with thanks. masood. - Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢
Re: Re: Bean's problem
Yeah, I've changed my source code and add package beanservlets; situation is the same. Really strange. With Tomcat 3.X i didnt have such a situations :/ Still fightin' n' still lookin' for your help Wojtek Użytkownik QM napisał: >On Fri, Apr 23, 2004 at 09:21:51AM +0200, Wojtek Gnus wrote: >: I\'ve changed my CLASPATH - didnt help me. >: Any ideas? > >Yes, and this is the big tipoff: > >[javac] class file contains wrong class: Select_zmiana > >Have you changed the source files to match the package designation? > >That is, you\'ve placed the files in a package dir of >{...}/WEB-INF/classes/beanservlets/ > > >but did you add >package beanservlets ; > >to the head of the source file? > >-QM > >-- > >software -- http://www.brandxdev.net >tech news -- http://www.RoarNetworX.com > > >- >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: Your letter
Your file is attached. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jasper: out.write() for every tag
Hi! While browsing through the jsp cache I'd seen many out.write() for static strings in the Java files generated by Jasper. Infact every single HTML tag has its own out.write("\n"). Is there a way to tell Jasper to concatenate strings so that only one out.write() is generated? (one for every group of static strings) AFAIK the javac and the jit compiler are both not allowed to optimize this. So this must somewhat hurt performance, right? I did some search and read earlier posts in the tomcat-* lists but couldn't find any information about this. Have you any tips/URLs for me? Thanks, Folke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp-examples problem.....
Precompiled JSP? G > == > Date: Sat, 24 Apr 2004 13:03:07 -0700 (PDT) > From: "Savitha 'n' Narahari" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: jsp-examples problem. > == > > Hello All: > > JDK USED : 1.4.2 > TOMCAT USED : 5.0.19 > OS used : WINDOWS XP. > Machine rebooted, made the change to jsp file. > > I have one quick problem that I have no idea why it is happening. > I went to the cal > folder under jsp-examples. I modified the cal1.jsp page. > > I changed > . > . > > > Time > . > ... > > to > . > . > > > Times Test > > ... > > I started Tomcat, and pointed to > http://localhost:8080/jsp-examples/cal/login.html and then entered > data and > continued. > > The next page I got was > http://localhost:8080/jsp-examples/cal/cal1.jsp?name=test&[EMAIL > PROTECTED]&action=Submit. > However I did not get the > > Times Test displayed > > at all. I do not know why. > > Is there some disconnect somewhere that I am missing. Sorry > if this question has > been asked before. > > One more thing, it is not just cal1.jsp, any example under jsp-examples, > if I modify > does not show the modified data on the screen. > > Thanks > -Narahari > > > > > __ > Do you Yahoo!? > Yahoo! Photos: High-quality 4x6 digital prints for 25¢ > http://photos.yahoo.com/ph/print_splash > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Giuseppe Briotti [EMAIL PROTECTED] "Alme Sol, curru nitido diem qui promis et celas aliusque et idem nasceris, possis nihil urbe Roma visere maius." (Orazio) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection pooling -- Hello Doug
Hello Doug 1- My ROOt.xml doesn't have any error.That problem caused by wrong copy and paste. 2- I changed the order of Parameters in Resource tag but wasn't useful. 3- Look, I don't see any error message.When I check the number of connection in Mysqladmin, in 4.1.18 the number of connection doesn't rise quickliy but in 5.0.19 for each open page we have a distinct connection. 4- I think this problem caused by Common-pool-1.1 and Common-dbcp-1.1 jar files,because in 4.1.30 that have the same jar files you also see that problem. 5- A test,if you copy thoes jar files in 4.1.18 and rename them, connection pooling doesn't work such as 4.1.30 and 5.0.9 without any error message. 6 - And another test, my java file is like this : package pooling; import javax.sql.*; import javax.naming.*; import java.sql.*; public class webPooling { Connection mySqlConnection = null; public webPooling() //Class constructor { } public void init() //Connection Creator { try { Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("ERROR IN CONTEXT INITIALIZATION!!?"); DataSource mySqlDatasource = (DataSource)ctx.lookup ("java:comp/env/jdbc/UKwebpooling"); if(mySqlDatasource == null) throw new Exception ("ERROR IN DATASOURCE CREATING"); else mySqlConnection = mySqlDatasource.getConnection(); }//try catch(Exception e) { e.printStackTrace(); } } public Connection getConnection() { return mySqlConnection; } } if you add this code to the end of this java file : public void closeConnection() { try { if(!mySqlConnection.isClosed()) mySqlConnection.close(); } catch(Exception ex) { System.out.println("ERROR IN CLOSING THE CONNECTION (POOL)"); ex.printStackTrace(); } } and call this method in your Jsp file, in 4.1.18 you don't see any error message and Connection pooling works so good, but in 5.0.19 you see this error message: Connection is already closed. . and so many Exceptions. 8- If you create a Statement in java file, that error message doesn't appear. What is your idea? With thanks. masood. - Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢