RE: Index files and CGI UNDER TOMCAT

2001-04-12 Thread Danny Angus


I think something like:

   

indexServlet


   app_nr*/



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  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  ?
>
> 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

2001-04-12 Thread Hunor Nam

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 :


 indexOfOneApp 
app.utils.tomcat.indexOfOneApp 



indexOfOneApp 
/OneApp/*




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:

   

indexServlet


   app_nr*/



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  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  ?
>
> 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

2001-04-12 Thread Danny Angus

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 :
>
> 
>indexOfOneApp 
>   app.utils.tomcat.indexOfOneApp 
> 
>
> 
> indexOfOneApp   
> /OneApp/*
> 
>
>
>
> 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:
>
>
> 
> indexServlet
> 
> 
>app_nr*/
> 
> 
>
> 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  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;

RE: Index files and CGI UNDER TOMCAT

2001-04-12 Thread Hunor Nam

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 :
>
> 
>indexOfOneApp 
>   app.utils.tomcat.indexOfOneApp 
> 
>
> 
> indexOfOneApp   
> /OneApp/*
> 
>
>
>
> 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:
>
>
> 
> indexServlet
> 
> 
>app_nr*/
> 
> 
>
> 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  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
> > +-

Re: Index files and CGI UNDER TOMCAT

2001-04-12 Thread Stéphane BAUDET

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 :
> >
> > 
> >indexOfOneApp 
> >   app.utils.tomcat.indexOfOneApp 
> > 
> >
> > 
> > indexOfOneApp   
> > /OneApp/*
> > 
> >
> >
> >
> > 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:
> >
> >
> > 
> > indexServlet
> > 
> > 
> >app_nr*/
> > 
> > 
> >
> > 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  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
> > &g

RE: Index files and CGI UNDER TOMCAT

2001-04-12 Thread Danny Angus

watch out, if this means that the http response code issued isn't 200 OK,
you can find browsers refusing to store your page in history, and bookmarks.

We used a similar scheme with perl CGI & apache, but its no substitute for
preparing a proper handler.


danny





RE: Index files and CGI UNDER TOMCAT

2001-04-12 Thread Hunor Nam

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 :

and rewrite it to :

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: Stéphane 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 :
> >
> > 
> >indexOfOneApp 
> >   app.utils.tomcat.indexOfOneApp 
> > 
> >
> > 
> > indexOfOneApp   
> > /OneApp/*
> > 
> >
> >
> >
> > 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:
> >
> >
> > 
> > indexServlet
> > 
> > 
> >app_nr*/
> > 
> > 
> >
> > 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