RE: pre-compilation of JSP
This is fragment from a message posted by Sopie several weeks ago that I've kept because it answers this very question: I am using the options: -uriroot /$TOMCAT_HOME/webapps/AppName -d /$TOMCAT_HOME/webapps/AppName/WEB-INF/classes to set the directory where the results of jspc should be placed -webxml/OWN_DIR/webAppName.xml -webapp/$TOMCAT_HOME/webapps/AppName to specify the directory that contains the jsp's I remove the jsp's after running jspc from /$TOMCAT_HOME/webapps/AppName. After running jspc, you should run javac to compile the generated java-files to class files. Looking at the differences, I would say that your webapp argument isn't correct. Randy -Original Message- From: Saritha Pula [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 3:37 PM To: [EMAIL PROTECTED] Subject: pre-compilation of JSP hi all, I am working on pre-compilation of JSP But problem for me is when I type the following command jspc -webxml c:\web.xml -uriroot c:\cosmo\jsp -webapp example.jsp the above command automatically generates web.xml but with no contents in it Java file is not generated for the specified JSP it would be greatful if I can get some inputs on this Pula -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: RE: using pre-compiled JSPs I like it for two reasons: 1. Performance 2. Don't need to distribute JavaC with the application The drawbacks as I see it: 1. Recompiling the JSPs generally works better than updating servlets for getting an update out while the server is running 2. There isn't currently any good way of merging the generated web.xml file with your web.xml file. (Making automated builds relies on inserting some special token to your web.xml file in order to do the merge, or requires building a process that reads your web.xml file, knows where the other xml file goes, and performs the merge for you). 3. It can be confusing for new developers who don't quite understand that file.jsp is really being handled by a servlet and that's why their changes to the file.jsp file are not seeming to take affect. Randy -Original Message- From: Eitan Ben-Noach [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 12:19 PM To: [EMAIL PROTECTED] Subject: using pre-compiled JSPs Hello, I would like to know whether pre-compiled JSPs is a conventional way for deploying JSPs at the customers sites? Are there any disadvantages with this approach? Thanks, Eitan Ben-Noach
RE: pre-compilation of JSP
hi Thanks for ur input .. Command should be the following jspc -webxml c:\web.xml -webapp %tomcat_home%\webapps\AppName test.jsp I shouls give file name following webapp directory ,should not include in path like -webapp %tomcat_home%\webapps\AppName\test.jsp Now I am able to compile my jsp and mapping is done in webxml appropriately ..,it's not necessary to delete jsp files as mapping is available in web.xml thanks for your reply Pula -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 3:54 AM To: [EMAIL PROTECTED] Subject: RE: pre-compilation of JSP This is fragment from a message posted by Sopie several weeks ago that I've kept because it answers this very question: I am using the options: -uriroot /$TOMCAT_HOME/webapps/AppName -d /$TOMCAT_HOME/webapps/AppName/WEB-INF/classes to set the directory where the results of jspc should be placed -webxml/OWN_DIR/webAppName.xml -webapp/$TOMCAT_HOME/webapps/AppName to specify the directory that contains the jsp's I remove the jsp's after running jspc from /$TOMCAT_HOME/webapps/AppName. After running jspc, you should run javac to compile the generated java-files to class files. Looking at the differences, I would say that your webapp argument isn't correct. Randy -Original Message- From: Saritha Pula [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 3:37 PM To: [EMAIL PROTECTED] Subject: pre-compilation of JSP hi all, I am working on pre-compilation of JSP But problem for me is when I type the following command jspc -webxml c:\web.xml -uriroot c:\cosmo\jsp -webapp example.jsp the above command automatically generates web.xml but with no contents in it Java file is not generated for the specified JSP it would be greatful if I can get some inputs on this Pula -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: RE: using pre-compiled JSPs I like it for two reasons: 1. Performance 2. Don't need to distribute JavaC with the application The drawbacks as I see it: 1. Recompiling the JSPs generally works better than updating servlets for getting an update out while the server is running 2. There isn't currently any good way of merging the generated web.xml file with your web.xml file. (Making automated builds relies on inserting some special token to your web.xml file in order to do the merge, or requires building a process that reads your web.xml file, knows where the other xml file goes, and performs the merge for you). 3. It can be confusing for new developers who don't quite understand that file.jsp is really being handled by a servlet and that's why their changes to the file.jsp file are not seeming to take affect. Randy -Original Message- From: Eitan Ben-Noach [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 12:19 PM To: [EMAIL PROTECTED] Subject: using pre-compiled JSPs Hello, I would like to know whether pre-compiled JSPs is a conventional way for deploying JSPs at the customers sites? Are there any disadvantages with this approach? Thanks, Eitan Ben-Noach
pre-compilation of JSP
hi all, I am working on pre-compilation of JSP But problem for me is when I type the following command jspc -webxml c:\web.xml -uriroot c:\cosmo\jsp -webapp example.jsp the above command automatically generates web.xml but with no contents in it Java file is not generated for the specified JSP it would be greatful if I can get some inputs on this Pula -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 9:50 AM To: [EMAIL PROTECTED] Subject: RE: using pre-compiled JSPs I like it for two reasons: 1. Performance 2. Don't need to distribute JavaC with the application The drawbacks as I see it: 1. Recompiling the JSPs generally works better than updating servlets for getting an update out while the server is running 2. There isn't currently any good way of merging the generated web.xml file with your web.xml file. (Making automated builds relies on inserting some special token to your web.xml file in order to do the merge, or requires building a process that reads your web.xml file, knows where the other xml file goes, and performs the merge for you). 3. It can be confusing for new developers who don't quite understand that file.jsp is really being handled by a servlet and that's why their changes to the file.jsp file are not seeming to take affect. Randy -Original Message- From: Eitan Ben-Noach [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 12:19 PM To: [EMAIL PROTECTED] Subject: using pre-compiled JSPs Hello, I would like to know whether pre-compiled JSPs is a conventional way for deploying JSPs at the customers sites? Are there any disadvantages with this approach? Thanks, Eitan Ben-Noach
Pre-compilation of JSP
Hi We had been provided with JSPC for pre-compilation of JSP in tomcat.. But problem is I am unable to generate web.xml file with new JSP file mapping like if I give this command jspc -webxml pweb.xml -uriroot c:\myapp *.jsp the above should actualy convert all JSP files in directory myapp to *.java files by giving appropriate mapping in pweb.xml file But genrate pweb.xml file is not generated with new JSP mappings Even though if I specify mapping explicitly ,when client hits JSP page it is again converting jsp to java file in work directory. It would be greatful if u can let me know the steps to do this . Regs --Pula -Original Message- From: Ryan Lubke [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: Re: How to configure a custom page for JSP 404 errors? Hi Pierce, From what I've been able to gather, you should be able to set the error page using the error-page directive within the deployment descriptor for a web app (web.xml). error-page error-code404/error-code location/error.jsp/location /error-page Looking through the bug database, there was an open issue regarding the use of static html pages within the location tag. I'm uncertain at this time what release it's actually fixed in, but if you try it and get a stacktrace, then I guess you know :) The bug report can be found here: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=291 I did find this information in the archives. Try looking at the results of the following search: http://mikal.org/interests/java/tomcat/archive/search?search=error+page+ custom+404 I'm sure those who are more experiences could expand/correct on this information. Hope this helps. -rl Courtney, Pierce wrote: Hello, This question probably has come up before, I just can't find it in the archives I am using Tomcat 3.2.2 standalone (not with Apache). How can I configure a particular page (servlet, static html, or jsp) to be the default page that comes up if the requested jsp is not found, instead of the 404 error. In other words, if a user requests: http://myTomcatSite.com/somePage.jsp I want to have somePage.jsp come up if it exists. But if somePage.jsp does not exist, I *don't* want the default 404 error to be displayed. Instead I want some custom page (a servlet actually) to be processed. I don't really care if this is achieved with a client-side redirect or a server-side include/forward. I have tried using the DefaultServlet, which doesn't seem to work. I have also set up my own servlet against url-pattern /* /url-pattern. This works for servlets only, not JSPs. It seems the basic problem is that any URI that matches *.jsp. gets processed by the JspServlet. So it is not determined if the .jsp file actually exists or not until the JspServlet is triggered. Can this custom error page functionality be configured somehow in Tomcat? Thanks for any help, Pierce Courtney [EMAIL PROTECTED]
Pre-compilation of JSP
Hi We had been provided with JSPC for pre-compilation of JSP in tomcat.. But problem is I am unable to generate web.xml file with new JSP file mapping like if I give this command jspc -webxml pweb.xml -uriroot c:\myapp *.jsp the above should actualy convert all JSP files in directory myapp to *.java files by giving appropriate mapping in pweb.xml file But genrate pweb.xml file is not generated with new JSP mappings Even though if I specify mapping explicitly ,when client hits JSP page it is again converting jsp to java file in work directory. It would be greatful if u can let me know the steps to do this . Regs --Pula -Original Message- From: Ryan Lubke [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: Re: How to configure a custom page for JSP 404 errors? Hi Pierce, From what I've been able to gather, you should be able to set the error page using the error-page directive within the deployment descriptor for a web app (web.xml). error-page error-code404/error-code location/error.jsp/location /error-page Looking through the bug database, there was an open issue regarding the use of static html pages within the location tag. I'm uncertain at this time what release it's actually fixed in, but if you try it and get a stacktrace, then I guess you know :) The bug report can be found here: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=291 I did find this information in the archives. Try looking at the results of the following search: http://mikal.org/interests/java/tomcat/archive/search?search=error+page+ custom+404 I'm sure those who are more experiences could expand/correct on this information. Hope this helps. -rl Courtney, Pierce wrote: Hello, This question probably has come up before, I just can't find it in the archives I am using Tomcat 3.2.2 standalone (not with Apache). How can I configure a particular page (servlet, static html, or jsp) to be the default page that comes up if the requested jsp is not found, instead of the 404 error. In other words, if a user requests: http://myTomcatSite.com/somePage.jsp I want to have somePage.jsp come up if it exists. But if somePage.jsp does not exist, I *don't* want the default 404 error to be displayed. Instead I want some custom page (a servlet actually) to be processed. I don't really care if this is achieved with a client-side redirect or a server-side include/forward. I have tried using the DefaultServlet, which doesn't seem to work. I have also set up my own servlet against url-pattern /* /url-pattern. This works for servlets only, not JSPs. It seems the basic problem is that any URI that matches *.jsp. gets processed by the JspServlet. So it is not determined if the .jsp file actually exists or not until the JspServlet is triggered. Can this custom error page functionality be configured somehow in Tomcat? Thanks for any help, Pierce Courtney [EMAIL PROTECTED]