Re: Servlet mapping - url pattern with *

2005-08-01 Thread Bill Barker

flower [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello,

 Let's consider situation like this:
 We have got some servlets responsible for genereting galery page. We want 
 group galery pages by use common part in uri (/galery/):
 http://x.com/galery/galery_id/firstpage.html
 http://x.com/galery/galery_id/secondpage.html

 firstpage.html is generated by servlet1 , secondpage.html by servlet2.

 So we must url-pattern like this: /galery/*/firstpage.html and 
 /galery/*/secondpage.html but this url-pattern doesn't work.
 question: why ? ( I use version 5.5.9 )

 Some people, with I was talking about this, said that patterns like this 
 was work with previously version and that version 5.5.9 is crazy ;]


I've got a vague recollection that some some such Tomcat-specific extension 
was proposed on the dev list.  Can't remember if it was ever implemented 
(and to which version), and I'm much to lazy to look it up :).  However, the 
5.5.9 behavior is in strict compilance with the Servlet spec (and, hence 
anything but crazy).

 Is any way to obtain behaviour like above with latest version ?


Simplest is with a Filter that does something like:
   RequestDispatcher rd = null;
   if(request.getRequestURI().endsWith(/firstpage.html) {
   rd = getServletContext().getNamedDispatcher(servlet1);
   } else if(request.getRequestURI().endsWith(/secondpage.html);
   rd = getServletContext().getNamedDispatcher(servlet2);
   }
   if(rd != null) {
  rd.forward(request, response);
   }



 Greatings
 flow 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Servlet mapping - url pattern with *

2005-08-01 Thread flower

Bill Barker wrote:

flower [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 


Hello,

Let's consider situation like this:
We have got some servlets responsible for genereting galery page. We want 
group galery pages by use common part in uri (/galery/):

http://x.com/galery/galery_id/firstpage.html
http://x.com/galery/galery_id/secondpage.html

firstpage.html is generated by servlet1 , secondpage.html by servlet2.

So we must url-pattern like this: /galery/*/firstpage.html and 
/galery/*/secondpage.html but this url-pattern doesn't work.

question: why ? ( I use version 5.5.9 )

Some people, with I was talking about this, said that patterns like this 
was work with previously version and that version 5.5.9 is crazy ;]


I've got a vague recollection that some some such Tomcat-specific extension 
was proposed on the dev list.  Can't remember if it was ever implemented 
(and to which version), and I'm much to lazy to look it up :).  However, the 
5.5.9 behavior is in strict compilance with the Servlet spec (and, hence 
anything but crazy).
 


mhm, when some time ago I was reading Servlet spec, I noticed that.


Is any way to obtain behaviour like above with latest version ?


Simplest is with a Filter that does something like:
  RequestDispatcher rd = null;
  if(request.getRequestURI().endsWith(/firstpage.html) {
  rd = getServletContext().getNamedDispatcher(servlet1);
  } else if(request.getRequestURI().endsWith(/secondpage.html);
  rd = getServletContext().getNamedDispatcher(servlet2);
  }
  if(rd != null) {
 rd.forward(request, response);
  }
 


thx for example :)
I was thinking about somethings like this ... but my lazy force me to 
looking buildin solution :)


thx and greetings
flow


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Servlet mapping - url pattern with *

2005-07-31 Thread flower

Hello,

Let's consider situation like this:
We have got some servlets responsible for genereting galery page. We 
want group galery pages by use common part in uri (/galery/):

http://x.com/galery/galery_id/firstpage.html
http://x.com/galery/galery_id/secondpage.html

firstpage.html is generated by servlet1 , secondpage.html by servlet2.

So we must url-pattern like this: /galery/*/firstpage.html and 
/galery/*/secondpage.html but this url-pattern doesn't work.

question: why ? ( I use version 5.5.9 )

Some people, with I was talking about this, said that patterns like this 
was work with previously version and that version 5.5.9 is crazy ;]


Is any way to obtain behaviour like above with latest version ?

Greatings
flow




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Servlet-Mapping/Url-Pattern not recognized - Please - help ....

2001-12-13 Thread Franciszek Michal Misa

Hi All,

I'm trying to:
   - configure the older Tomcat3.3Final   (installed from Binary
RPM)
   - on a linux (RedHatv7.1) system
   - running apache-1.3.22-1.7.1

Both Tomcat and apache are up and running - seem to be working - at
least I can execute all the sample JSP pages and Servlets .
However, my attempts at configuring my own web application are not
completely successful ??
I've poured over all the documentation  the key pieces of
information seem to be spread out !!

I've installed my application into: (All permissions are open - world
execute)
/var/tomcat/webapps/myApp/ index.html
 WEB-INF/web.xml

classes/MyHelloWorld.class

I've configured all environment variables, and agent (mod_jk) property
files etc.

BUT I can only execute my servlet using the following URLs:
http://myhost:8080/myApp/servlet/MyHelloWorld
OK
http://www.myhost.com/myApp/servlet/MyHelloWorld   OK

The following URLs do not work ???
http://myhost:8080/myApp/doHello
FAIL:Not Found (404)
http://www.myhost.com/myApp/doHello
FAIL:Not Found (404)

I think I'm a little confused with what can be configured in httpd.conf
vs. web.xml and uriworkermap.properties  vs. what's picked-up by
DEFAULT
?

Some configuration recipes would be GREATLY appreciated .

Please help

Thanks

I've configured my web server and tomcat in the following way ...





 APACHE

 httpd.conf:

 LoadModule jk_module modules/mod_jk.so
 AddModule mod_jk.c
 
 
 IfModule mod_jk.c
  JkWorkersFile
 /etc/tomcat/conf/jk/workers.properties
  JkLogFile /var/log/httpd/mod_jk.log
  JkLogLevel info
 /IfModule

 NameVirtualHost www.host.com

 # VirtualHost example:
 # Almost any Apache directive may go into a
 VirtualHost container.
 #
 VirtualHost  www.host.com
 ServerAdmin xxx@xxx
 DocumentRoot
 /var/www/html/virtual/www.host.com
 ServerName  www.host.com
 ErrorLog logs/www.host.com-error_log
 CustomLog logs/www.host.com-access_log
 common

IfModule mod_jk.c
 Alias /myApp
 /var/tomcat/webapps/myApp
 Directory /var/tomcat/webapps/myApp

Options Indexes FollowSymLinks
 /Directory
 JkMount /myApp/* ajp12
 JkMount /myApp/*.jsp ajp12
 # Location /myApp/WEB-INF/
 #   AllowOverride None
 #   deny from all
 #/Location
   /IfModule

 /VirtualHost


AGENT mod_jk.so

* I don't see WHY this should be required - but out of desperation -
I've also added the following line to the mod_jk:
 uriworkermap.properties

# Mount the examples context to the ajp12 worker
 /myApp/*=ajp12



TOMCAT

* Configured tomcat.conf java home classpath etc.
etc. etc.

* I figure I don't need an  apps-myApp.xml  under
my tomcat/conf directory  - should be picked up by
DEFAULT context path ?

web.xml  - Application deployment descriptor 
?xml version=1.0 encoding=ISO-8859-1?
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
My display name
/display-name
description
Some description here
/description

servlet
servlet-namemyHelloWorld/servlet-name
servlet-classMyHelloWorld/servlet-class
/servlet

servlet-mapping
servlet-namemyHelloWorld/servlet-name
 url-pattern/doHello/url-pattern
 /servlet-mapping
/web-app



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Servlet-Mapping/Url-Pattern not recognized - Please - help ....

2001-12-13 Thread Andy Soedibjo

Have you put the MyHelloWorld.class in the myapp\WEB-INF\classes\ directory?

Rgds,
Andy.

At 05:22 13/12/2001 -0500, you wrote:
Hi All,

I'm trying to:
- configure the older Tomcat3.3Final   (installed from Binary
RPM)
- on a linux (RedHatv7.1) system
- running apache-1.3.22-1.7.1

Both Tomcat and apache are up and running - seem to be working - at
least I can execute all the sample JSP pages and Servlets .
However, my attempts at configuring my own web application are not
completely successful ??
I've poured over all the documentation  the key pieces of
information seem to be spread out !!

I've installed my application into: (All permissions are open - world
execute)
/var/tomcat/webapps/myApp/ index.html
  WEB-INF/web.xml

classes/MyHelloWorld.class

I've configured all environment variables, and agent (mod_jk) property
files etc.

BUT I can only execute my servlet using the following URLs:
http://myhost:8080/myApp/servlet/MyHelloWorld
OK
http://www.myhost.com/myApp/servlet/MyHelloWorld   OK

The following URLs do not work ???
http://myhost:8080/myApp/doHello
FAIL:Not Found (404)
http://www.myhost.com/myApp/doHello
FAIL:Not Found (404)

I think I'm a little confused with what can be configured in httpd.conf
vs. web.xml and uriworkermap.properties  vs. what's picked-up by
DEFAULT
?

Some configuration recipes would be GREATLY appreciated .

Please help

Thanks

I've configured my web server and tomcat in the following way ...





  APACHE

  httpd.conf:

  LoadModule jk_module modules/mod_jk.so
  AddModule mod_jk.c
  
  
  IfModule mod_jk.c
   JkWorkersFile
  /etc/tomcat/conf/jk/workers.properties
   JkLogFile /var/log/httpd/mod_jk.log
   JkLogLevel info
  /IfModule

  NameVirtualHost www.host.com

  # VirtualHost example:
  # Almost any Apache directive may go into a
  VirtualHost container.
  #
  VirtualHost  www.host.com
  ServerAdmin xxx@xxx
  DocumentRoot
  /var/www/html/virtual/www.host.com
  ServerName  www.host.com
  ErrorLog logs/www.host.com-error_log
  CustomLog logs/www.host.com-access_log
  common

 IfModule mod_jk.c
  Alias /myApp
  /var/tomcat/webapps/myApp
  Directory /var/tomcat/webapps/myApp

 Options Indexes FollowSymLinks
  /Directory
  JkMount /myApp/* ajp12
  JkMount /myApp/*.jsp ajp12
  # Location /myApp/WEB-INF/
  #   AllowOverride None
  #   deny from all
  #/Location
/IfModule

  /VirtualHost


AGENT mod_jk.so

* I don't see WHY this should be required - but out of desperation -
I've also added the following line to the mod_jk:
  uriworkermap.properties

# Mount the examples context to the ajp12 worker
  /myApp/*=ajp12



TOMCAT

* Configured tomcat.conf java home classpath etc.
etc. etc.

* I figure I don't need an  apps-myApp.xml  under
my tomcat/conf directory  - should be picked up by
DEFAULT context path ?

web.xml  - Application deployment descriptor 
?xml version=1.0 encoding=ISO-8859-1?
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
 My display name
 /display-name
 description
 Some description here
 /description

 servlet
 servlet-namemyHelloWorld/servlet-name
 servlet-classMyHelloWorld/servlet-class
 /servlet

 servlet-mapping
 servlet-namemyHelloWorld/servlet-name
  url-pattern/doHello/url-pattern
  /servlet-mapping
/web-app



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Servlet-Mapping/Url-Pattern not recognized - Please - help ....

2001-12-13 Thread Larry Isaacs

I would focus first on getting http://myhost:8080/myApp/doHello
to work.  If it doesn't, http://www.myhost.com/myApp/doHello
isn't going to work either.

At this point it is usually good to check the log's to see
if there are any clues as to why the URL failed.  There is
usually more there than what you can get from the response
returned to the browser.  If necessary, add or increase the
debug=level setting on various modules in the server.xml
to get more log output.  To see if the servlet mapping is
or isn't matching the URL, add debug=1 to SimpleMapper1 /.

Cheers,
Larry

 -Original Message-
 From: Franciszek Michal Misa [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 13, 2001 5:22 AM
 To: [EMAIL PROTECTED]
 Subject: Servlet-Mapping/Url-Pattern not recognized - Please 
 - help 
 
 
 Hi All,
 
 I'm trying to:
- configure the older Tomcat3.3Final   (installed from Binary
 RPM)
- on a linux (RedHatv7.1) system
- running apache-1.3.22-1.7.1
 
 Both Tomcat and apache are up and running - seem to be working - at
 least I can execute all the sample JSP pages and Servlets .
 However, my attempts at configuring my own web application are not
 completely successful ??
 I've poured over all the documentation  the key pieces of
 information seem to be spread out !!
 
 I've installed my application into: (All permissions are open - world
 execute)
 /var/tomcat/webapps/myApp/ index.html
  WEB-INF/web.xml
 
 classes/MyHelloWorld.class
 
 I've configured all environment variables, and agent (mod_jk) property
 files etc.
 
 BUT I can only execute my servlet using the following URLs:
 http://myhost:8080/myApp/servlet/MyHelloWorld
 OK
 http://www.myhost.com/myApp/servlet/MyHelloWorld   OK
 
 The following URLs do not work ???
 http://myhost:8080/myApp/doHello
 FAIL:Not Found (404)
 http://www.myhost.com/myApp/doHello
 FAIL:Not Found (404)
 
 I think I'm a little confused with what can be configured in 
 httpd.conf
 vs. web.xml and uriworkermap.properties  vs. what's 
 picked-up by
 DEFAULT
 ?
 
 Some configuration recipes would be GREATLY appreciated .
 
 Please help
 
 Thanks
 
 I've configured my web server and tomcat in the following way ...
 
 
 
 
 
  APACHE
 
  httpd.conf:
 
  LoadModule jk_module modules/mod_jk.so
  AddModule mod_jk.c
  
  
  IfModule mod_jk.c
   JkWorkersFile
  /etc/tomcat/conf/jk/workers.properties
   JkLogFile /var/log/httpd/mod_jk.log
   JkLogLevel info
  /IfModule
 
  NameVirtualHost www.host.com
 
  # VirtualHost example:
  # Almost any Apache directive may go into a
  VirtualHost container.
  #
  VirtualHost  www.host.com
  ServerAdmin xxx@xxx
  DocumentRoot
  /var/www/html/virtual/www.host.com
  ServerName  www.host.com
  ErrorLog logs/www.host.com-error_log
  CustomLog logs/www.host.com-access_log
  common
 
 IfModule mod_jk.c
  Alias /myApp
  /var/tomcat/webapps/myApp
  Directory /var/tomcat/webapps/myApp
 
 Options Indexes FollowSymLinks
  /Directory
  JkMount /myApp/* ajp12
  JkMount /myApp/*.jsp ajp12
  # Location /myApp/WEB-INF/
  #   AllowOverride None
  #   deny from all
  #/Location
/IfModule
 
  /VirtualHost
 
 
 AGENT mod_jk.so
 
 * I don't see WHY this should be required - but out of desperation -
 I've also added the following line to the mod_jk:
  uriworkermap.properties
 
 # Mount the examples context to the ajp12 worker
  /myApp/*=ajp12
 
 
 
 TOMCAT
 
 * Configured tomcat.conf java home classpath etc.
 etc. etc.
 
 * I figure I don't need an  apps-myApp.xml  under
 my tomcat/conf directory  - should be picked up by
 DEFAULT context path ?
 
 web.xml  - Application deployment descriptor 
 ?xml version=1.0 encoding=ISO-8859-1?
 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
 My display name
 /display-name
 description
 Some description here
 /description
 
 servlet
 servlet-namemyHelloWorld/servlet-name
 servlet-classMyHelloWorld/servlet-class
 /servlet
 
 servlet-mapping
 servlet-namemyHelloWorld/servlet-name
  url-pattern/doHello/url-pattern
  /servlet-mapping
 /web-app
 
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Servlet-Mapping/Url-Pattern not recognized - Please - help ....

2001-12-13 Thread Franciszek Michal Misa

Thanks Larry -
I never learn my lesson - the log files 

An examination of the log files revealed the following error while trying
to parse my Deployment Descriptor:

 2001-12-13 11:52:04 - Ctx(/franksTestApp) : Validating web.xml
 2001-12-13 11:52:04 - Ctx(/franksTestApp) : web.xml: Error 
org.xml.sax.SAXParseException: Element servlet does not allow servlet-mapping
 here.


A close look at my web.xml revealed my DOCTYPE tag was slightly off:
I changed:
 DOCTYPE web-app
to:
!DOCTYPE web-app

Restarted the server - and now both URLs WORK :)) - no parsing error 
http://myhost:8080/myApp/doHello  OK
http://www.myhost.com/myApp/doHello   OK

Thanks Larry ...
Also . Thanks Andy for replying too .

Cheers

Frank


I really appreciate the help 

Larry Isaacs wrote:

 I would focus first on getting http://myhost:8080/myApp/doHello
 to work.  If it doesn't, http://www.myhost.com/myApp/doHello
 isn't going to work either.

 At this point it is usually good to check the log's to see
 if there are any clues as to why the URL failed.  There is
 usually more there than what you can get from the response
 returned to the browser.  If necessary, add or increase the
 debug=level setting on various modules in the server.xml
 to get more log output.  To see if the servlet mapping is
 or isn't matching the URL, add debug=1 to SimpleMapper1 /.

 Cheers,
 Larry

  -Original Message-
  From: Franciszek Michal Misa [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, December 13, 2001 5:22 AM
  To: [EMAIL PROTECTED]
  Subject: Servlet-Mapping/Url-Pattern not recognized - Please
  - help 
 
 
  Hi All,
 
  I'm trying to:
 - configure the older Tomcat3.3Final   (installed from Binary
  RPM)
 - on a linux (RedHatv7.1) system
 - running apache-1.3.22-1.7.1
 
  Both Tomcat and apache are up and running - seem to be working - at
  least I can execute all the sample JSP pages and Servlets .
  However, my attempts at configuring my own web application are not
  completely successful ??
  I've poured over all the documentation  the key pieces of
  information seem to be spread out !!
 
  I've installed my application into: (All permissions are open - world
  execute)
  /var/tomcat/webapps/myApp/ index.html
   WEB-INF/web.xml
 
  classes/MyHelloWorld.class
 
  I've configured all environment variables, and agent (mod_jk) property
  files etc.
 
  BUT I can only execute my servlet using the following URLs:
  http://myhost:8080/myApp/servlet/MyHelloWorld
  OK
  http://www.myhost.com/myApp/servlet/MyHelloWorld   OK
 
  The following URLs do not work ???
  http://myhost:8080/myApp/doHello
  FAIL:Not Found (404)
  http://www.myhost.com/myApp/doHello
  FAIL:Not Found (404)
 
  I think I'm a little confused with what can be configured in
  httpd.conf
  vs. web.xml and uriworkermap.properties  vs. what's
  picked-up by
  DEFAULT
  ?
 
  Some configuration recipes would be GREATLY appreciated .
 
  Please help
 
  Thanks
 
  I've configured my web server and tomcat in the following way ...
 
 
 
 
 
   APACHE
 
   httpd.conf:
 
   LoadModule jk_module modules/mod_jk.so
   AddModule mod_jk.c
   
   
   IfModule mod_jk.c
JkWorkersFile
   /etc/tomcat/conf/jk/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
   /IfModule
 
   NameVirtualHost www.host.com
 
   # VirtualHost example:
   # Almost any Apache directive may go into a
   VirtualHost container.
   #
   VirtualHost  www.host.com
   ServerAdmin xxx@xxx
   DocumentRoot
   /var/www/html/virtual/www.host.com
   ServerName  www.host.com
   ErrorLog logs/www.host.com-error_log
   CustomLog logs/www.host.com-access_log
   common
 
  IfModule mod_jk.c
   Alias /myApp
   /var/tomcat/webapps/myApp
   Directory /var/tomcat/webapps/myApp
 
  Options Indexes FollowSymLinks
   /Directory
   JkMount /myApp/* ajp12
   JkMount /myApp/*.jsp ajp12
   # Location /myApp/WEB-INF/
   #   AllowOverride None
   #   deny from all
   #/Location
 /IfModule
 
   /VirtualHost
 
 
  AGENT mod_jk.so
 
  * I don't see WHY this should be required - but out of desperation -
  I've also added the following line to the mod_jk:
   uriworkermap.properties
 
  # Mount the examples context to the ajp12 worker
   /myApp/*=ajp12
 
 
 
  TOMCAT
 
  * Configured tomcat.conf java home classpath etc.
  etc. etc.
 
  * I figure I don't need an  apps-myApp.xml  under
  my tomcat/conf directory  - should be picked up by
  DEFAULT context path ?
 
  web.xml  - Application deployment descriptor 
  ?xml version=1.0 encoding=ISO-8859-1?
  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