Re: [Slightly OT] MVC approach when JSP are not allowed
Elihu Smails wrote: I am working on a project that uses servlets exclusively. I would like to take advantage of a Model-View-Controller system in order to develop my servlets. For the last servlet project I worked on, I was in charge of the back-end data processing and did not have to mess with HTML. This time I do have to roll up my sleeves and play with HTML. So I ask the question. Since the requirement that I have is to use servlets only, can I use something like Struts or Java Server Faces? I am reading some information and it looks like they both rely on JSP to ge the job done. Struts can help you, but the views will have to be done as JSPs. Of course, you can alway compile JSPs into servlets, Ant can help you with it. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Struts = Problems with my first page
In the /WEB-INF/web.xml of your application u must have !-- The Usual Welcome File List -- welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list to describe wich is the first page open when someone access your application Lost World wrote: You cannot access the jsp like http://localhost:8080/MyFirstPage.jsp You should use Sturts-config to map your action to that JSP page. Then you should access the page which looks similar to http://localhost:8080/FirstAction.do --- [EMAIL PROTECTED] wrote: Yes, this is correct.. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - 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]
java.lang.NoClassDefFoundError: org/apache/tools/ant/types/RedirectorElement
Hi All! I have just installed Tomcat 5.5 on Windows XP Pro with apache-ant-1.6.1. I have placed the catalina-ant.jar in in apache-ant-1.6.1's lib dir and am attempting to install my first app. I am using the basic build.xml file from the local Application Developer's Guide and am seeing the following error when I attempt to install on the command line: F:\cml\websiteant -version Apache Ant version 1.6.1 compiled on February 12 2004 F:\cml\websiteant install Buildfile: build.xml prepare: compile: install: BUILD FAILED java.lang.NoClassDefFoundError: org/apache/tools/ant/types/RedirectorElement Total time: 6 seconds F:\cml\website I got exactly the same result when I moved the website dir to C:\temp\website as well. Any advice would be most appreciated! Rob :) -- Robert Mark Bram http://phd.netcomp.monash.edu.au/RobertMarkBram/default.asp B.Comp.(Systems Development/Business Systems) B.Net.Comp.(Hons) Doctor of Philosophy Student School of Network Computing Faculty of Information Technology Monash University Peninsula Campus McMahons Rd Frankston, VIC 3199 AUSTRALIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP being interpreted?
Hi All, Not sure if I am way off mark, but it almost seems as if my JSP is not being interpreted. Using the /manager web app, I get my app deployed (I still can't figure out why my command line install doesn't work) and I publish this page: == %@ taglib uri=/WEB-INF/tld/c.tld prefix=c % html body bgcolor=white c:set var=message value=Hi there!/ c:out value=6. ${message}/br/ c:out value=7. ${'message'}/br/ bParameter values passed to this page for each parameter: /b c:forEach var=current items=${param} bc:out value=${current.key} //b c:forEach var=aVal items=${paramValues[current.key]} c:out value=${aVal} / /c:forEach /c:forEach /body /html == But the result is this: == 6. ${message} 7. ${'message'} Parameter values passed to this page for each parameter: ${current.key} ${aVal} == Is it possible that my jsp code is not being interpreted? A bit lost... Rob :) -- Robert Mark Bram http://phd.netcomp.monash.edu.au/RobertMarkBram/default.asp B.Comp.(Systems Development/Business Systems) B.Net.Comp.(Hons) Doctor of Philosophy Student School of Network Computing Faculty of Information Technology Monash University Peninsula Campus McMahons Rd Frankston, VIC 3199 AUSTRALIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP being interpreted?
Am Samstag, 19. Mrz 2005 12:36 schrieb Robert Mark Bram: == %@ taglib uri=/WEB-INF/tld/c.tld prefix=c % html body bgcolor=white c:set var=message value=Hi there!/ c:out value=6. ${message}/br/ c:out value=7. ${'message'}/br/ bParameter values passed to this page for each parameter: /b c:forEach var=current items=${param} bc:out value=${current.key} //b c:forEach var=aVal items=${paramValues[current.key]} c:out value=${aVal} / /c:forEach /c:forEach /body /html == But the result is this: == 6. ${message} 7. ${'message'} Parameter values passed to this page for each parameter: ${current.key}${aVal} == Is it possible that my jsp code is not being interpreted? Does the deployment descriptor of yout web-app declare conformance to the Servlet-API spec 2.4 - i. e. does it contain something like web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 ? Regards mks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Slightly OT] MVC approach when JSP are not allowed
On Fri, Mar 18, 2005 at 11:33:02PM -0500, Elihu Smails wrote: : I am working on a project that uses servlets exclusively. I would : like to take advantage of a Model-View-Controller system in order to : develop my servlets. : [snip] : So I ask the question. Since the requirement that I have is to use : servlets only, can I use something like Struts or Java Server Faces? : I am reading some information and it looks like they both rely on JSP : to ge the job done. Yes and no. Struts separates the calls business logic (Action classes) to the formatting of the display. The formatting defaults to JSP, but really, can be any resource in your context: another servlet, a Velocity template, etc. The real question is why the JSPs have been banned. If all such display components are not permitted in your project, handling raw HTML inside a servlet will be a maintenance nightmare. That's why JSPs were invented! -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]
servlet api question
What are the advantages or the reason for the popularity of servlet api vis-a-vis the web server specific api ? Say Netscape server or IIS server also have their own specific api's as well where one could write server side code. But the servlet api is so popular and wide spread and one could argue that java sdk is free but then companies buy the third party j2ee servers like websphere or weblogic. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP compile with jdk 1.5 in 5.5.7
Tomcat 5.5.7/8 documentation suggest setting 'compilerSourceVM' and 'compilerTargetVM' to enable jdk 1.5 JSP compilation (along with removing |jasper-compiler-jdt.jar and replacing with ant.jar|) However, those 2 parameter names are not in web.xml's commented list of optional flags. I've tried this in 5.5.8 and in the 5.5.7 distributed with net-beans 4.1 beta. init-param param-namecompilerSourceVM/param-name param-value1.5/param-value /init-param init-param param-namecompilerTargetVM/param-name param-value1.5/param-value /init-param I get an error saying that the [java 5 ] features are not supported in source 1.4 Seems like these flags are not being passed to ant. Are these flags still valid? Can JSPs be compile using Java 5 in Tomcat 5.5.x? I know the docs say that the IBM compiler will be updated to support the Java 5 syntax as soon as possible. Thanks, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Slightly OT] MVC approach when JSP are not allowed
You could look into alternate MVC approachs like Freemarker, Velocity, or XSLT; these are processed by a servlet, but allow you to extract the presentation logic into a text-based template file. Also, as others have pointed out JSPs are compiled into servlets; and if you know your deployment target server then they can be precompiled. Elihu Smails wrote: I am working on a project that uses servlets exclusively. I would like to take advantage of a Model-View-Controller system in order to develop my servlets. For the last servlet project I worked on, I was in charge of the back-end data processing and did not have to mess with HTML. This time I do have to roll up my sleeves and play with HTML. So I ask the question. Since the requirement that I have is to use servlets only, can I use something like Struts or Java Server Faces? I am reading some information and it looks like they both rely on JSP to ge the job done. Thank you for your time... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert r. Sanders Chief Technologist iPOV (334) 821-5412 www.ipov.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP being interpreted?
That was the answer mks! Is it possible that my jsp code is not being interpreted? Does the deployment descriptor of yout web-app declare conformance to the Servlet-API spec 2.4 - i. e. does it contain something like web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 ? Once I put this in my web.xml, undeployed the application and redeployed it through the manager, it worked! Shameful thing is that the basic web.xml file in the developer's guid did not have this - it only had web-app. One question left.. I had to undeploy/redeploy using the WebApp manager because command line install doesn't work for me atm (as per my java.lang.NoClassDefFoundError: org/apache/tools/ant/types/RedirectorElement post). How do you deploy your apps and update them after code changes? Thank you for your response! Rob :) -- Robert Mark Bram http://phd.netcomp.monash.edu.au/RobertMarkBram/default.asp B.Comp.(Systems Development/Business Systems) B.Net.Comp.(Hons) Doctor of Philosophy Student School of Network Computing Faculty of Information Technology Monash University Peninsula Campus McMahons Rd Frankston, VIC 3199 AUSTRALIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.NoClassDefFoundError: org/apache/tools/ant/types/RedirectorElement
Found the answer to this one. I needed Ant 1.6.2.. Rob :) On Sat, 19 Mar 2005 22:01:58 +1100, Robert Mark Bram [EMAIL PROTECTED] wrote: Hi All! I have just installed Tomcat 5.5 on Windows XP Pro with apache-ant-1.6.1. I have placed the catalina-ant.jar in in apache-ant-1.6.1's lib dir and am attempting to install my first app. I am using the basic build.xml file from the local Application Developer's Guide and am seeing the following error when I attempt to install on the command line: F:\cml\websiteant -version Apache Ant version 1.6.1 compiled on February 12 2004 F:\cml\websiteant install Buildfile: build.xml prepare: compile: install: BUILD FAILED java.lang.NoClassDefFoundError: org/apache/tools/ant/types/RedirectorElement Total time: 6 seconds F:\cml\website I got exactly the same result when I moved the website dir to C:\temp\website as well. Any advice would be most appreciated! Rob :) -- Robert Mark Bram http://phd.netcomp.monash.edu.au/RobertMarkBram/default.asp B.Comp.(Systems Development/Business Systems) B.Net.Comp.(Hons) Doctor of Philosophy Student School of Network Computing Faculty of Information Technology Monash University Peninsula Campus McMahons Rd Frankston, VIC 3199 AUSTRALIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Slightly OT] MVC approach when JSP are not allowed
Thanks for the information. I have not written a single JSP, but have alot of experience with Servlets. I am targetting Tomcat 5.5.x only, so I think it is safe to say that I can compile my JSP. Thanks again everyone for the help. On Sat, 19 Mar 2005 08:15:38 -0600, Robert r. Sanders [EMAIL PROTECTED] wrote: You could look into alternate MVC approachs like Freemarker, Velocity, or XSLT; these are processed by a servlet, but allow you to extract the presentation logic into a text-based template file. Also, as others have pointed out JSPs are compiled into servlets; and if you know your deployment target server then they can be precompiled. Elihu Smails wrote: I am working on a project that uses servlets exclusively. I would like to take advantage of a Model-View-Controller system in order to develop my servlets. For the last servlet project I worked on, I was in charge of the back-end data processing and did not have to mess with HTML. This time I do have to roll up my sleeves and play with HTML. So I ask the question. Since the requirement that I have is to use servlets only, can I use something like Struts or Java Server Faces? I am reading some information and it looks like they both rely on JSP to ge the job done. Thank you for your time... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Robert r. Sanders Chief Technologist iPOV (334) 821-5412 www.ipov.net - 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: mod_jk under Win32 (Tomcat 5.0.28, apache 1.13.33)
I thought that for apache 1.3, the modules go in the libexec directory, and if so then your statement above should look like: LoadModule jk_module libexec/mod_jk.so On Fri, 18 Mar 2005 13:10:42 +0100 (CET), Christoph Kukulies [EMAIL PROTECTED] wrote: I installed apache 1.13.33 and tomcat 5.0.28. Both servers are running. I can test tomcat fine on port 8080. Now I want to integrate apache with tomcat and downloaded the mod_jk 1.2 binary .so file from http://jakarta.apache.org/site/downloads/downloads_tomcat-connectors.cgi I installed it as mod_jk.so in Apache\modules but when starting apache I get an error G:\Programme\Apache_Group\Apacheapache Syntax error on line 992 of g:/programme/apache_group/apache/conf/httpd.conf: Cannot load g:/programme/apache_group/apache/modules/mod_jk.so into server: (127 ) Die angegebene Prozedur wurde nicht gefunden: Portions of my httpd.conf: ClearModuleList #AddModule mod_vhost_alias.c AddModule mod_env.c AddModule mod_log_config.c #AddModule mod_mime_magic.c AddModule mod_mime.c AddModule mod_negotiation.c #AddModule mod_status.c #AddModule mod_info.c AddModule mod_include.c AddModule mod_autoindex.c AddModule mod_dir.c # and at the end: LoadModule jk_module modules/mod_jk.so JkWorkersFile g:\Programme\Apache_Group\Tomcat 5.0\conf\workers.properties JkLogFile g:\Programme\Apache_Group\Apache\logs\mod_jk.log JkLogLevel info JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkMount /*.jsp ajp13 --- AddModule mod_isapi.c AddModule mod_cgi.c AddModule mod_asis.c AddModule mod_imap.c AddModule mod_actions.c #AddModule mod_speling.c AddModule mod_userdir.c AddModule mod_alias.c #AddModule mod_rewrite.c AddModule mod_access.c AddModule mod_auth.c #AddModule mod_auth_anon.c Any clues? -- Chris Christoph P. U. Kukulies kuku_at_kukulies.org - 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: [Slightly OT] MVC approach when JSP are not allowed
Out of curiosity only, why were JSPs banned? That seems to be a bit of a mystery. Do they ban html too? Jack On Fri, 18 Mar 2005 23:33:02 -0500, Elihu Smails [EMAIL PROTECTED] wrote: I am working on a project that uses servlets exclusively. I would like to take advantage of a Model-View-Controller system in order to develop my servlets. For the last servlet project I worked on, I was in charge of the back-end data processing and did not have to mess with HTML. This time I do have to roll up my sleeves and play with HTML. So I ask the question. Since the requirement that I have is to use servlets only, can I use something like Struts or Java Server Faces? I am reading some information and it looks like they both rely on JSP to ge the job done. Thank you for your time... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat not running(4.0.6/5.0.19)-urgent
Dear Sir/Madam, I have been using tomcat 4.x/5.0.x version for web developmen (JSP/Servlets)but i am finding difficulties in starting the server itself many times.I have set the JAVA_HOME environmental variable to the directory where i have installed the j2sdk1.4.2. e.g. E:\j2sdk1.4.2. and under that folder all other subfolders like bin, jre are there.When i am trying to start the tomcat server by double clicking on the startup.bat inside bin folder the tomcat console comes only for 3-4 seconds and then disappears.I also tried to solve it by changing the port no 8080 which is inside server.xml file to any other port (e.g. 9020,8090 etc.),but still it's not working. Also sometimes even though the server starts and runs fine and i am able to see the index.html page(featuring the cat) i get a 404 error of resource not found while trying to access my own webapplication which i create inside the webapps folder.though it is there already.For an example i create a folder named my_apps/WEB-INF/classes inside webapps but i get a 404 error (resource not found) when i type http://localhost:8080/my_apps These two problems are really making me annoyed.I am fade of these problems.Please tell me the solution to these problems. Ayaskant - Do you Yahoo!? Yahoo! Small Business - Try our new resources site!
Re: Tomcat not running(4.0.6/5.0.19)-urgent
It's tough to say what your problem is without more information. Did you check Tomcat's logs to see what the error is when starting up? Have you tried running tomcat from the console instead of from a batch file so that you can see the output of the server when it erors and quits? Give those a try and let us know what the output is and maybe some one can help. Regards ayaskant swain wrote: Dear Sir/Madam, I have been using tomcat 4.x/5.0.x version for web developmen (JSP/Servlets)but i am finding difficulties in starting the server itself many times.I have set the JAVA_HOME environmental variable to the directory where i have installed the j2sdk1.4.2. e.g. E:\j2sdk1.4.2. and under that folder all other subfolders like bin, jre are there.When i am trying to start the tomcat server by double clicking on the startup.bat inside bin folder the tomcat console comes only for 3-4 seconds and then disappears.I also tried to solve it by changing the port no 8080 which is inside server.xml file to any other port (e.g. 9020,8090 etc.),but still it's not working. Also sometimes even though the server starts and runs fine and i am able to see the index.html page(featuring the cat) i get a 404 error of resource not found while trying to access my own webapplication which i create inside the webapps folder.though it is there already.For an example i create a folder named my_apps/WEB-INF/classes inside webapps but i get a 404 error (resource not found) when i type http://localhost:8080/my_apps These two problems are really making me annoyed.I am fade of these problems.Please tell me the solution to these problems. Ayaskant - Do you Yahoo!? Yahoo! Small Business - Try our new resources site! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to setup demo app?
Ah, yes. That seems easier. Thank you. Now if I can get my Tomcat to stay running. Jon Cline - Enthusiast, Inc. wrote: Hey Justin, I think this might help: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html You could use wget from cron to send url commands to an isolated port. thx. jc On Fri, 18 Mar 2005 15:21:15 +, Stanczak Group [EMAIL PROTECTED] wrote: I'm trying to setup a demo site for my web app. I want customers to be able to try out this app and do what they like. Then once a day or so I want to shutdown that web app and refresh it back to original. How can I do this without having to shutdown Tomcat? I don't know how to undeploy an app from a cron script. -- Justin Stanczak Stanczak Group 812-735-3600 All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke .....__. ./ _/....._/..|_..... /...\../.__.\./\...__\/.._.\./._..\ \\_\..\..___/|...|..\..|.(.._.|._..) .\__../\___.._\__|../__|..\/.\/.. \/.\/.\/.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Justin Stanczak Stanczak Group 812-735-3600 All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke .....__. ./ _/....._/..|_..... /...\../.__.\./\...__\/.._.\./._..\ \\_\..\..___/|...|..\..|.(.._.|._..) .\__../\___.._\__|../__|..\/.\/.. \/.\/.\/.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 on VPS service stops, still no luck.
Well I still can't seem to get this server running on my vps. They show that they have no limits that would keep me from running this. It's a RH 9 machine and I put the export LD_ASSUME_KERNEL=2.4.1 in the catalina.sh. I can't seem to even keep one running. I'm using jdk1.5.0_02. The only error I've found it here http://www.codedemons.net/pb/?show=2963 , but I don't see this error anymore. Does that have anything to do with the export of that variable? Anyway, I need serious help. I just can't seem to figure out why if won't stay running. I've got it where it will run for maybe an hour or so, but that's it. I think I'm going to start from scratch on it. Stanczak Group wrote: I'm having a strange issue with my Tomcat 5 server. I have two instances of Tomcat 5 running on my VPS system I pay for. For some reason just the Tomcat services just stop. I can't find any errors that tell me why it just stops. This is the fifth time I've re-started them today. The systems are running RedHat. I'm at a loss trying to understand why these services just stop. One of them has a startup script so if the machine reboots it should start back up. I start the service with -Xmx64m -server and I'm using jdk 1.5.0_01. The history of this problem is that the last few days has been the worse, but it's had these shutdown issues from the start. One of the services has a cron that shuts down one of the services and erased the web app the copies a fresh one back, not sure that matters in this issue. If anyone has had this problem or has suggestions on solving it please let me know. -- Justin Stanczak Stanczak Group 812-735-3600 All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke .....__. ./ _/....._/..|_..... /...\../.__.\./\...__\/.._.\./._..\ \\_\..\..___/|...|..\..|.(.._.|._..) .\__../\___.._\__|../__|..\/.\/.. \/.\/.\/.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not running(4.0.6/5.0.19)-urgent
Thanks for your instant reply.But i just checked whatever u had said.I tried to start it from the console by giving the command %CATALINA_HOME%\bin\startup.bat but same problem still persists.The tomcat console came only for 2-3 seconds and then dissapeared.So i could not read the error messages.I am using Windows 2000 server.some times it runs fine and gives me the desired output. Ok what about that resource not found(404 error).I have created my own folder called my_apps inside webapps and the whole directory structure WEB-INF/classes inside that.but when am typing http://localhost:8080/my_apps in the address bar of the browser am getting this error.Ya one clue is that in the tomcat console am getting org.xml.sax.SAXPARSEException. web-app should match with a ending /web-app.But i have checked my webapplication's web.xml file it is correct and there is no other user's application inside the webapps folder. Currently am doing a project and i need the solution very badly. First let me help in starting the server.What about that logs? Ayaskant Torrey Rice [EMAIL PROTECTED] wrote: It's tough to say what your problem is without more information. Did you check Tomcat's logs to see what the error is when starting up? Have you tried running tomcat from the console instead of from a batch file so that you can see the output of the server when it erors and quits? Give those a try and let us know what the output is and maybe some one can help. Regards ayaskant swain wrote: Dear Sir/Madam, I have been using tomcat 4.x/5.0.x version for web developmen (JSP/Servlets)but i am finding difficulties in starting the server itself many times.I have set the JAVA_HOME environmental variable to the directory where i have installed the j2sdk1.4.2. e.g. E:\j2sdk1.4.2. and under that folder all other subfolders like bin, jre are there.When i am trying to start the tomcat server by double clicking on the startup.bat inside bin folder the tomcat console comes only for 3-4 seconds and then disappears.I also tried to solve it by changing the port no 8080 which is inside server.xml file to any other port (e.g. 9020,8090 etc.),but still it's not working. Also sometimes even though the server starts and runs fine and i am able to see the index.html page(featuring the cat) i get a 404 error of resource not found while trying to access my own webapplication which i create inside the webapps folder.though it is there already.For an example i create a folder named my_apps/WEB-INF/classes inside webapps but i get a 404 error (resource not found) when i type http://localhost:8080/my_apps These two problems are really making me annoyed.I am fade of these problems.Please tell me the solution to these problems. Ayaskant - Do you Yahoo!? Yahoo! Small Business - Try our new resources site! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard.
Re: Tomcat not running(4.0.6/5.0.19)-urgent
Try putting an html or jsp file in your my_apps folder. I'm not sure what Tomcat does when you navigate to the web app with nothing other than WEB-INF in the web app's folder. When I navigate to one of my web apps the way you're trying, I get a directory listing of the files and folders I have there, but I notice that that WEB-INF is not included in that listing, even though it is present. So a better test of your web app would be to try to hit an html or jsp page. As someone else pointed out, the log files should give you a good clue as to why Tomcat isn't starting up sometimes. -Mark ayaskant swain wrote: Dear Sir/Madam, I have been using tomcat 4.x/5.0.x version for web developmen (JSP/Servlets)but i am finding difficulties in starting the server itself many times.I have set the JAVA_HOME environmental variable to the directory where i have installed the j2sdk1.4.2. e.g. E:\j2sdk1.4.2. and under that folder all other subfolders like bin, jre are there.When i am trying to start the tomcat server by double clicking on the startup.bat inside bin folder the tomcat console comes only for 3-4 seconds and then disappears.I also tried to solve it by changing the port no 8080 which is inside server.xml file to any other port (e.g. 9020,8090 etc.),but still it's not working. Also sometimes even though the server starts and runs fine and i am able to see the index.html page(featuring the cat) i get a 404 error of resource not found while trying to access my own webapplication which i create inside the webapps folder.though it is there already.For an example i create a folder named my_apps/WEB-INF/classes inside webapps but i get a 404 error (resource not found) when i type http://localhost:8080/my_apps These two problems are really making me annoyed.I am fade of these problems.Please tell me the solution to these problems. Ayaskant - Do you Yahoo!? Yahoo! Small Business - Try our new resources site! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Authentication for streaming file (OT)
Have you tried other browsers than MSIE? If it works for FireFox, then you've probably hit http://issues.apache.org/bugzilla/show_bug.cgi?id=28750. Mark Leone [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Slightly off-topic -- Tomcat related I have a servlet that is invoked by clicking a hyperlink that is rendered by a JSP running in Tomcat. The servlet receives a file path parameter in the HTTP request, and then streams that file to the requesting client. I have a security-constraint/ defined in Tomcat for the JSP, requiring basic password authentication. However, if I define the security-constraint/ so that it applies to the servlet also, then the following error occurs when the servlet attempts to stream the file to the client. The browser presents the file info and prompts to save or open the file, but then when the actual streaming is attempted, the browser reports that the site is unreachable. This is apparently caused by the lack of any authentication during the file streaming operation, because when I define the security-constraint/ so that it applies to the JSP but not the servlet, the problem does not occur. I don't really understand why it behaves this way, since the servlet was invoked with proper authorization, and the problem occurs only when the servlet starts streaming a file to the client. But it does seem to be an authorization problem, since it goes away when I don't constrain the servlet for authentication. I can operate this way, but then my JSP is protected and the servlet is not. Is there a way to specify authentication parameters during the file streaming operation? Does anyone have an explanation for what I'm experiencing? Here's my servlet code: public class FileSender extends HttpServlet{ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ String filename = request.getParameter(file); File file = new File(filename); MimetypesFileTypeMap mimeTypes = new MimetypesFileTypeMap (C:\\Program Files\\Java\\jdk1.5.0_01\\lib\\mime.types); String mime = mimeTypes.getContentType(file); response.setContentType(mime); response.setHeader(Content-Disposition, attachment; + filename= + file.getName()); FileInputStream in = new FileInputStream(file); OutputStream out = response.getOutputStream(); byte[] buf = new byte[1024]; int i = 0; while((i=in.read(buf))!=-1) { out.write(buf, 0, i); } in.close(); out.close(); } } And here's my web.xml. With this configuration, the file downolad fails as described above. To make it work, I remove the second url-pattern/ element as indicated. !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app display-name File Port /display-name description Makes files available through the web container /description servlet servlet-nameFilePort/servlet-name description Retrieves specified file and sends it to requester /description servlet-classFileSnatcher.FileSender/servlet-class /servlet servlet-mapping servlet-nameFilePort/servlet-name url-pattern/FilePort/url-pattern /servlet-mapping !-- Define a Security Constraint on this Application -- security-constraint web-resource-collection web-resource-nameFileSnatcher/web-resource-name url-pattern*.jsp/url-pattern url-pattern/FilePort/url-pattern !-- remove this to make it work -- /web-resource-collection auth-constraint role-namemanager/role-name /auth-constraint /security-constraint !-- Define the Login Configuration for this Application -- login-config auth-methodBASIC/auth-method realm-nameJDBCRealm/realm-name /login-config !-- Security roles referenced by this web application -- security-role description The role that is required to log in to the Manager Application /description role-namemanager/role-name /security-role /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using RealmBase.Digest(...)
1) If you have catalina.jar in the $CATALINA_HOME/server/lib/ directory, then it's only going to be available to the Tomcat server internal code, not to your web apps. If you want it to be available to Tomcat and your web apps, then you should put it in the $CATALINA_HOME/common/lib/ directory. You don't need to copy it- you can move it there- since that will make it available to Tomcat and all your web apps. 2) As stated in Footnote 19 of the HTTP/1.1 spec, the IANA Character Set Registry (Reynolds, J. and J. Postel, Assigned Numbers http://www.ietf.org/rfc/rfc1700.txt , STD 2, RFC 1700, October 1994.) is the authoritative listing of charset values. However, I noticed that the API for setDigestEncoding() says that the String charset parameter can be null to indicate the platform default character set. I suggest you give that a try when invoking Digest(). Pass it a null String value for the third parameter and see if it works. I think that what you're trying to match is the charset the client browsers will use when the users attempt to authenticate to the realm. If you want to know what your default charset is, invoke getDigestEncoding(). Whatever value is returned is the charset you need all your users to use when they authenticate (or a charset that is compatible within the ranges of characters that the users will be entering). If they will be using other charsets, you should be able to determine what they're using from the Content-Type entity header field in the HTTP request message, and then set that charset value for your realm using setDigestEncoding(). The charset will be specified as a parameter value in the Content-Type field. For example, Content-Type: text/html; charset=ISO-8859-4 See section 14.17 of the HTTP spec; here's the link: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 -Mark J Malcolm wrote: I'm writing an app to create user id/pw's in a db for use by realms. I've read the realm HOW-TO page. But I have two implementation questions: 1) the page says: To use either of the above techniques, the $CATALINA_HOME/server/lib/catalina.jar file will need to be on your class path to make the RealmBase class available. I'm doing this in a servlet. The way I typically make jar files avail to servlets is to put them in the WEB-INF/lib dir or in the Tomcat common lib. I don't think I should be making a copy of this jar or moving it around. How do I force a jar into a webapp's classpath? Is there a tag I can put in web.xml to set classpath or add jars? 2) There are three parameters on the Digest() method. The third parm is 'encoding'. What encoding should I be using? I assume it needs to match whatever encoding the realm code is going to use when it compares the digested password. What string do I use for this parm? Thanks. Jerry - 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: Tomcat not running
Hello, i have already tested these things which you are telling.When i put some html or jsp files directly ubder my_apps folder i see the list of these files when i type http://localhost:8080/my_apps but my problem is that sometimes i am not able to see this also.it says /my_apps is not available.coming back to your point ya a client can't see the WEB-INF directory.It's kept secret from the client by the server itself.That's why when we run our servlets which we put inside classes folder under WEB-INF we generally call it through a url-pattern which we declare in the web.xml file. Ayaskant Mark Leone [EMAIL PROTECTED] wrote: Try putting an html or jsp file in your my_apps folder. I'm not sure what Tomcat does when you navigate to the web app with nothing other than WEB-INF in the web app's folder. When I navigate to one of my web apps the way you're trying, I get a directory listing of the files and folders I have there, but I notice that that WEB-INF is not included in that listing, even though it is present. So a better test of your web app would be to try to hit an html or jsp page. As someone else pointed out, the log files should give you a good clue as to why Tomcat isn't starting up sometimes. -Mark ayaskant swain wrote: Dear Sir/Madam, I have been using tomcat 4.x/5.0.x version for web developmen (JSP/Servlets)but i am finding difficulties in starting the server itself many times.I have set the JAVA_HOME environmental variable to the directory where i have installed the j2sdk1.4.2. e.g. E:\j2sdk1.4.2. and under that folder all other subfolders like bin, jre are there.When i am trying to start the tomcat server by double clicking on the startup.bat inside bin folder the tomcat console comes only for 3-4 seconds and then disappears.I also tried to solve it by changing the port no 8080 which is inside server.xml file to any other port (e.g. 9020,8090 etc.),but still it's not working. Also sometimes even though the server starts and runs fine and i am able to see the index.html page(featuring the cat) i get a 404 error of resource not found while trying to access my own webapplication which i create inside the webapps folder.though it is there already.For an example i create a folder named my_apps/WEB-INF/classes inside webapps but i get a 404 error (resource not found) when i type http://localhost:8080/my_apps These two problems are really making me annoyed.I am fade of these problems.Please tell me the solution to these problems. Ayaskant - Do you Yahoo!? Yahoo! Small Business - Try our new resources site! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more.
Re: Authentication for streaming file (OT)
Yes, that's exactly my problem. It only fails with HTTPS connections on IE. It works with Firefox (using the built-in download manager or Flashgot) as well as Safari on a Mac. Nice to see, according to a posting in the BZ link you provided, that M$ has decided to label it a feature rather than a bug. I applied the workaround you described in BZ #27122, and it now works properly with all resources of the web app protected by a security-constraint/. Thanks for pointing me to the solution. -Mark Bill Barker wrote: Have you tried other browsers than MSIE? If it works for FireFox, then you've probably hit http://issues.apache.org/bugzilla/show_bug.cgi?id=28750. - 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]