RE: Index files and CGI UNDER TOMCAT
I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... it would be nasty to put one in each of them and after that, if something changes to change all the files... I would like to have some kind of redirection set to some folder levels (so everything beneath them to call its own index...) Ok so it's not to clear...? Well... I'll try explaining it a little more detailed (with some examples) Lets say the folder structure looks like this: Main Folder +App nr.1 +-Folder Level1 +-Folder Level2 +App nr.2 +-Folder Level1 +-Folder Level2 +App nr.3 +-Folder Level1 +-Folder Level2 So I need one index file for the Main Folder, that's easy ... but everything beneath App nr.1 should go to indexapp nr.1 (and that means every Folder Level ...1, 2, 3 and so one) The same goes to App nr.2 everything beneath it should go to indexapp nr.2. OK I would manage handling 3,4 index files but not 20-30 (as how many folders we have...) I'm not sure if something like this is possible and/or how it's done but something like: "If folder starts whit /app nr.1 go to index nr.1; If folder starts whit /app nr.2 go to index nr.2; And so on" Problem nr. 2: How can I tell tomcat that I do not want some files (having the same extension) to be accessible for the end user, those files are actually .jsp flies used whit include file ? After all these problems I have an Easter egg for the Tomcat Users (if any one is interested), especially that Easter is close... :) We developed a module that supports cgi running under Tomcat. I say, "We developed it" because we have not found anything like it on the net... So if there would be any one interested in it we would appreciate some feedback so we would optimize and publish the module, at this time it was tested whit cgis from Crystal Reports. Thanks Hades Ps: sorry for my poor English...
RE: Index files and CGI UNDER TOMCAT
Hi again, Well, Danny thanks a lot. Your idea was god. Almost perfect for my needs. There is a big "bubu" anyhow... This is how things look now: Part of web.xml : servlet servlet-name indexOfOneApp /servlet-name servlet-classapp.utils.tomcat.indexOfOneApp /servlet-class /servlet servlet-mapping servlet-nameindexOfOneApp /servlet-name url-pattern/OneApp/*/url-pattern /servlet-mapping the indexOfOneApp servlet: public class indexOfOneApp extends HttpServlet { public void init(ServletConfig conf) throws ServletException { super.init(conf); } public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.sendRedirect("/app/oneapp/oneapp.jsp"); } } Well what happens now is that (I think) because the oneapp.jsp is itself under app/oneapp/ it gets traped in an infinit loop (I have tried putting a System.out.println ("something") in the doGet method... well, it was printing "something" all over again...) Pleas do assist me further (I really need some god ideas...) Thanks again ! Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... it would be nasty to put one in each of them and after that, if something changes to change all the files... I would like to have some kind of redirection set to some folder levels (so everything beneath them to call its own index...) Ok so it's not to clear...? Well... I'll try explaining it a little more detailed (with some examples) Lets say the folder structure looks like this: Main Folder +App nr.1 +-Folder Level1 +-Folder Level2 +App nr.2 +-Folder Level1 +-Folder Level2 +App nr.3 +-Folder Level1 +-Folder Level2 So I need one index file for the Main Folder, that's easy ... but everything beneath App nr.1 should go to indexapp nr.1 (and that means every Folder Level ...1, 2, 3 and so one) The same goes to App nr.2 everything beneath it should go to indexapp nr.2. OK I would manage handling 3,4 index files but not 20-30 (as how many folders we have...) I'm not sure if something like this is possible and/or how it's done but something like: "If folder starts whit /app nr.1 go to index nr.1; If folder starts whit /app nr.2 go to index nr.2; And so on" Problem nr. 2: How can I tell tomcat that I do not want some files (having the same extension) to be accessible for the end user, those files are actually .jsp flies used whit include file ? After all these problems I have an Easter egg for the Tomcat Users (if any one is interested), especially that Easter is close... :) We developed a module that supports cgi running under Tomcat. I say, "We developed it" because we have not found anything like it on the net... So if there would be any one interested in it we would appreciate some feedback so we would optimize and publish the module, at this time it was tested whit cgis from Crystal Reports. Thanks Hades Ps: sorry for my poor English...
RE: Index files and CGI UNDER TOMCAT
if you leave the * out of the URL pattern you'll only get directories, not files in them, does that help? or try /OneApp/*/ I don't know how hot pattern matching is in the config parser, but I'd expect that to match anything ending with / even things with / in them, which is therefore any directory but no file... /OneApp/*/ should match .. /OneApp/subdir/ and /OneApp/subdir/subsubdir/ not /OneApp/subdir/file.xyz It would be cool if you could use regex in URL pattern.. d -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:25 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT Hi again, Well, Danny thanks a lot. Your idea was god. Almost perfect for my needs. There is a big "bubu" anyhow... This is how things look now: Part of web.xml : servlet servlet-name indexOfOneApp /servlet-name servlet-classapp.utils.tomcat.indexOfOneApp /servlet-class /servlet servlet-mapping servlet-nameindexOfOneApp /servlet-name url-pattern/OneApp/*/url-pattern /servlet-mapping the indexOfOneApp servlet: public class indexOfOneApp extends HttpServlet { public void init(ServletConfig conf) throws ServletException { super.init(conf); } public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.sendRedirect("/app/oneapp/oneapp.jsp"); } } Well what happens now is that (I think) because the oneapp.jsp is itself under app/oneapp/ it gets traped in an infinit loop (I have tried putting a System.out.println ("something") in the doGet method... well, it was printing "something" all over again...) Pleas do assist me further (I really need some god ideas...) Thanks again ! Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... it would be nasty to put one in each of them and after that, if something changes to change all the files... I would like to have some kind of redirection set to some folder levels (so everything beneath them to call its own index...) Ok so it's not to clear...? Well... I'll try explaining it a little more detailed (with some examples) Lets say the folder structure looks like this: Main Folder +App nr.1 +-Folder Level1 +-Folder Level2 +App nr.2 +-Folder Level1 +-Folder Level2 +App nr.3 +-Folder Level1 +-Folder Level2 So I need one index file for the Main Folder, that's easy ... but everything beneath App nr.1 should go to indexapp nr.1 (and that means every Folder Level ...1, 2, 3 and so one) The same goes to App nr.2 everything beneath it should go to indexapp nr.2. OK I would manage handling 3,4 index files but not 20-30 (as how many folders we have...) I'm not sure if something like this is possible and/or how it's done but something like: "If folder starts whit /app nr.1 go to index nr.1; If folder starts whit /app nr.2 go to index nr.2; And so on" Problem nr. 2: How can I tell tomcat that I do not want some files (having the same extension) to be accessible for the end user, those files are actually .jsp flies used whit include file ? After all these problems I have an Easter egg for the Tomcat Users (if any one is interested), especially that Easter is close... :) We developed a module that supports cgi running under Tomcat. I say, "We developed it" because we have not found anything like it on t
RE: Index files and CGI UNDER TOMCAT
Yep your right but anyhow I managed to solve the problem useing errorpages... if interested here is the solution...: I suppressed folder browseing and I made the error page to check the URI and if it has the needed patern (OneApp) I make a forward to oneappindex if it has the SecondApp patern I forward to secondappindex and so on... :-) Thanks a lot By the way I used your idea in a another problem (so dont thing you were not apricieted :-) ) Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT if you leave the * out of the URL pattern you'll only get directories, not files in them, does that help? or try /OneApp/*/ I don't know how hot pattern matching is in the config parser, but I'd expect that to match anything ending with / even things with / in them, which is therefore any directory but no file... /OneApp/*/ should match .. /OneApp/subdir/ and /OneApp/subdir/subsubdir/ not /OneApp/subdir/file.xyz It would be cool if you could use regex in URL pattern.. d -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:25 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT Hi again, Well, Danny thanks a lot. Your idea was god. Almost perfect for my needs. There is a big "bubu" anyhow... This is how things look now: Part of web.xml : servlet servlet-name indexOfOneApp /servlet-name servlet-classapp.utils.tomcat.indexOfOneApp /servlet-class /servlet servlet-mapping servlet-nameindexOfOneApp /servlet-name url-pattern/OneApp/*/url-pattern /servlet-mapping the indexOfOneApp servlet: public class indexOfOneApp extends HttpServlet { public void init(ServletConfig conf) throws ServletException { super.init(conf); } public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.sendRedirect("/app/oneapp/oneapp.jsp"); } } Well what happens now is that (I think) because the oneapp.jsp is itself under app/oneapp/ it gets traped in an infinit loop (I have tried putting a System.out.println ("something") in the doGet method... well, it was printing "something" all over again...) Pleas do assist me further (I really need some god ideas...) Thanks again ! Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... it would be nasty to put one in each of them and after that, if something changes to change all the files... I would like to have some kind of redirection set to some folder levels (so everything beneath them to call its own index...) Ok so it's not to clear...? Well... I'll try explaining it a little more detailed (with some examples) Lets say the folder structure looks like this: Main Folder +App nr.1 +-Folder Level1 +-Folder Level2 +App nr.2 +-Folder Level1 +-Folder Level2 +App nr.3 +-Folder Level1 +-Folder Level2 So I need one index file for the Main Folder, that's easy ... but everything beneath App nr.1 should go to indexapp nr.1 (and that means every Folder Level ...1, 2, 3 and so one) The same goes to App nr.2 everything beneath it should go to indexapp nr.2. OK I would manage handling 3,4 index files but not 20-30 (as how many folders we have...) I'm not sure if something like this is possible and/or how it's done but
Re: Index files and CGI UNDER TOMCAT
What do you mean by suppress folder browsing ? How to you do this ? Hunor Nam a crit : Yep your right but anyhow I managed to solve the problem useing errorpages... if interested here is the solution...: I suppressed folder browseing and I made the error page to check the URI and if it has the needed patern (OneApp) I make a forward to oneappindex if it has the SecondApp patern I forward to secondappindex and so on... :-) Thanks a lot By the way I used your idea in a another problem (so dont thing you were not apricieted :-) ) Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT if you leave the * out of the URL pattern you'll only get directories, not files in them, does that help? or try /OneApp/*/ I don't know how hot pattern matching is in the config parser, but I'd expect that to match anything ending with / even things with / in them, which is therefore any directory but no file... /OneApp/*/ should match .. /OneApp/subdir/ and /OneApp/subdir/subsubdir/ not /OneApp/subdir/file.xyz It would be cool if you could use regex in URL pattern.. d -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:25 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT Hi again, Well, Danny thanks a lot. Your idea was god. Almost perfect for my needs. There is a big "bubu" anyhow... This is how things look now: Part of web.xml : servlet servlet-name indexOfOneApp /servlet-name servlet-classapp.utils.tomcat.indexOfOneApp /servlet-class /servlet servlet-mapping servlet-nameindexOfOneApp /servlet-name url-pattern/OneApp/*/url-pattern /servlet-mapping the indexOfOneApp servlet: public class indexOfOneApp extends HttpServlet { public void init(ServletConfig conf) throws ServletException { super.init(conf); } public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.sendRedirect("/app/oneapp/oneapp.jsp"); } } Well what happens now is that (I think) because the oneapp.jsp is itself under app/oneapp/ it gets traped in an infinit loop (I have tried putting a System.out.println ("something") in the doGet method... well, it was printing "something" all over again...) Pleas do assist me further (I really need some god ideas...) Thanks again ! Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... it would be nasty to put one in each of them and after that, if something changes to change all the files... I would like to have some kind of redirection set to some folder levels (so everything beneath them to call its own index...) Ok so it's not to clear...? Well... I'll try explaining it a little more detailed (with some examples) Lets say the folder structure looks like this: Main Folder +App nr.1 +-Folder Level1 +-Folder Level2 +App nr.2 +-Folder Level1 +-Folder Level2 +App nr.3 +-Folder Level1 +-Folder Level2 So I need one index file for the Main Folder, that's easy ... but everything beneath App nr.1 should go to indexapp nr.1 (and that means every Folder Level ...1, 2,
RE: Index files and CGI UNDER TOMCAT
Wel, I made that in Tomcat Stand Alone, every web server has its own way (I think...) But here is what you have to do in Tomcat: In the server.xml : locate : RequestInterceptor className="org.apache.tomcat.request.StaticInterceptor" debug="0" suppress="false" / and rewrite it to : RequestInterceptor className="org.apache.tomcat.request.StaticInterceptor" debug="0" suppress="true" / This works for me... if its not workin' for you than try seting : suppress="true" in other request interceptors . God luck Hades -Original Message- From: Stphane BAUDET [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 4:37 PM To: [EMAIL PROTECTED] Subject: Re: Index files and CGI UNDER TOMCAT What do you mean by suppress folder browsing ? How to you do this ? Hunor Nam a crit : Yep your right but anyhow I managed to solve the problem useing errorpages... if interested here is the solution...: I suppressed folder browseing and I made the error page to check the URI and if it has the needed patern (OneApp) I make a forward to oneappindex if it has the SecondApp patern I forward to secondappindex and so on... :-) Thanks a lot By the way I used your idea in a another problem (so dont thing you were not apricieted :-) ) Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT if you leave the * out of the URL pattern you'll only get directories, not files in them, does that help? or try /OneApp/*/ I don't know how hot pattern matching is in the config parser, but I'd expect that to match anything ending with / even things with / in them, which is therefore any directory but no file... /OneApp/*/ should match .. /OneApp/subdir/ and /OneApp/subdir/subsubdir/ not /OneApp/subdir/file.xyz It would be cool if you could use regex in URL pattern.. d -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 12:25 PM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT Hi again, Well, Danny thanks a lot. Your idea was god. Almost perfect for my needs. There is a big "bubu" anyhow... This is how things look now: Part of web.xml : servlet servlet-name indexOfOneApp /servlet-name servlet-classapp.utils.tomcat.indexOfOneApp /servlet-class /servlet servlet-mapping servlet-nameindexOfOneApp /servlet-name url-pattern/OneApp/*/url-pattern /servlet-mapping the indexOfOneApp servlet: public class indexOfOneApp extends HttpServlet { public void init(ServletConfig conf) throws ServletException { super.init(conf); } public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException { res.sendRedirect("/app/oneapp/oneapp.jsp"); } } Well what happens now is that (I think) because the oneapp.jsp is itself under app/oneapp/ it gets traped in an infinit loop (I have tried putting a System.out.println ("something") in the doGet method... well, it was printing "something" all over again...) Pleas do assist me further (I really need some god ideas...) Thanks again ! Hades -Original Message- From: Danny Angus [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: RE: Index files and CGI UNDER TOMCAT I think something like: servlet-mapping servlet-name indexServlet /servlet-name url-pattern app_nr*/ /url-pattern /servlet-mapping should take all hits to that path, but not to specified files, to the indexServlet, which can parse the request URI to decide what to give you, depending on where you think you are.. because none of these folders will actually need to exist. Unless you really want to put files in them ;-) Its just a hunch, but should be worth a try as the real answer will probably look something like this. danny -Original Message- From: Hunor Nam [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 9:03 AM To: [EMAIL PROTECTED] Subject: Index files and CGI UNDER TOMCAT Hi. My problem is: I need to use the welcome-file attribute but in a different way... Our app. has many folders and I do not want to put an index file in each of them... Especially that it has more sub applications so I would need different index files for different folders... i