Re: Do URL query strings with semi-colons work with TC ?

2005-09-05 Thread Jon Wingfield
In a URL the semi-colon indicates the start of path parameters (as 
opposed to the normal query parameters) as defined in rfc2616 (HTTP1.1 
spec) et al.

Thus, you can't tell tomcat to use it as a query string delimiter.
JSESSIONID is a well known path parameter for Servlet 2.2+ Containers.

To use a semi-colon within a url you'll need to url encode it as %3B
To use it in the way you want you'll have to encode and parse the query 
string yourself.


HTH,

Jon

Darryl L. Miles wrote:


I swear I had application code working that was using semi-colons to 
delimit query string parameters.  I'm sure I've also seen TC append a 
;JSESSIONID= at the end of the URL.


But my own application code written like:

String val = request.getParameters(name);

Yeilds: val=value;name2=foobar;


Is there an additional option to allow semi-colon usage, instead of 
amp;  ?


Running TC 5.5.9

Thanks.





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



SSL problem

2005-09-05 Thread Peter Betz
Hi,

I am having a problem here. I am using Jakarta Tomcat V5.5 (part of
jboss-4.0.2) and j2sdk1.4.2_08 on a Redhat Linux server.
I having been trying to register a signed certificate but have thus far
being unsuccessful.
It always comes out as a self-signed certificate. What am I doing wrong?
Details are as follows:

Here is what I have been doing:

~~~
Logged in and performed commands as jboss user because the J2EE and Jakarta
Tomcat environment is run under jboss user.

1. Generate a private key with the following command:
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore
k-factor88.kdb

2. Generate the Certificate Signing Request (CSR)
$JAVA_HOME/bin/keytool -certreq -alias tomcat -keystore k-factor88.kdb -file
k-factor88.csr

3. Generate the Server Certificate
Submit k-factor88.csr to root certification authority and save returned
certificate into k-factor88.cer

4. Import the Server Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
root -file k-factor88.cer
Note: Keytool confirms that the certificate has been signed by a
certification authority. I choose to trust it.

5. Import the Trust Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
jboss -file UTN.cer
Note: UTN.cer is the certification authority certificate and needs to be
imported.

server.xml

~
 Connector port=8443 address=${jboss.bind.address}
   maxThreads=100 strategy=ms maxHttpHeaderSize=8192
   emptySessionPath=true
   scheme=https secure=true clientAuth=false
   keystoreFile=${jboss.home.dir}/bin/certs/k-factor88.kdb
   keystorePass=changeit sslProtocol = TLS /



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



Pre-compiled JSPs?

2005-09-05 Thread Richard Burman
Hi everyone,

I have a fairly elaborate problem but hope that some people out there
can help with it.

I am trying to take a large webapp and create pre-compiled JSPs. We
already compile the java into class files, then package in JARs, then
finally a WAR, but we would like to be able to package the JSPs into a
neat package, too.

The first hurdle was trying to circumvent the issue of when JSPs include
each other and a bean is used in both JSPs but can only be declared once
when the JSPs are combined. Thus, you have to leave out the bean
declaration in the second JSP but then it will not compile on it's own
because it has no knowledge of the bean. Fortunately, in the recent
Tomcat releases, it's possible to use the flag
'errorOnUseBeanInvalidClassAttribute' to ignore this problem.

Once the JSPs have been turned into Java classes by Jasper2, it's not
too hard to compile them into class files. But how do you deploy these
compiled classes so that Tomcat knows to use them? If the Whatever.jsp
file doesn't exist, how does Tomcat know where or how to find the
compiled JSP file? Should I put them in a JAR and deploy somewhere? Do I
need to change the web.xml or similar to inform Tomcat about this?

If anyone has any suggestions, advice or solutions to this, I would be
eternally grateful! :)

Thanks,
Richard.

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



RE: Pre-compiled JSPs?

2005-09-05 Thread Karasek-XID, Nicolas
Hi,

You need to insert in your web.xml the reference to the precompiled
servlets. Jasper can generate a web.xml fragment when turning JSP into
servlets. You can then insert the fragment into your web.xml
Something like this with ant:

!-- turn jsp into servlets --
jasper2 verbose=0
package=your.package
validateXml=false
uriroot=${webapp.path}
webXmlFragment=generated-web.xml
outputDir=${webapp.path}/WEB-INF/src /

!-- Load the precompiled snippet into a property --
loadfile property=precompiled
srcFile= generated-web.xml
encoding=ISO-8859-1 /

!-- Now replace the web.xml with a predefined snippet --
!-- copy web.xml --
replace file=web.xml value=${precompiled}
replacetokenlt;!-- jsp-servlets will be inserted here - do not remove
this line --gt;/replacetoken
/replace



-Original Message-
From: Richard Burman [mailto:[EMAIL PROTECTED] 
Sent: lundi 5 septembre 2005 12:44
To: Tomcat Users List
Subject: Pre-compiled JSPs?

Hi everyone,

I have a fairly elaborate problem but hope that some people out there
can help with it.

I am trying to take a large webapp and create pre-compiled JSPs. We
already compile the java into class files, then package in JARs, then
finally a WAR, but we would like to be able to package the JSPs into a
neat package, too.

The first hurdle was trying to circumvent the issue of when JSPs include
each other and a bean is used in both JSPs but can only be declared once
when the JSPs are combined. Thus, you have to leave out the bean
declaration in the second JSP but then it will not compile on it's own
because it has no knowledge of the bean. Fortunately, in the recent
Tomcat releases, it's possible to use the flag
'errorOnUseBeanInvalidClassAttribute' to ignore this problem.

Once the JSPs have been turned into Java classes by Jasper2, it's not
too hard to compile them into class files. But how do you deploy these
compiled classes so that Tomcat knows to use them? If the Whatever.jsp
file doesn't exist, how does Tomcat know where or how to find the
compiled JSP file? Should I put them in a JAR and deploy somewhere? Do I
need to change the web.xml or similar to inform Tomcat about this?

If anyone has any suggestions, advice or solutions to this, I would be
eternally grateful! :)

Thanks,
Richard.

-
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: Do URL query strings with semi-colons work with TC ?

2005-09-05 Thread Darryl L. Miles


I'm not trying to encode semi-colon into QS.  I'm trying to use 
semi-colon as a replacement for  or rather amp; when correctly encoded 
into a HTML document.  On the basis that it makes the documents smaller 
and the code easier to write.  I have been left with the impression they 
are directly substitutable from various references around the internet.  
But your comments imply otherwise.



I'd be happy to lookup path params in the same way I do for query 
string params with a call:


value = request.getPathParameter(name);

Can I do this ?


Conceptually what is the difference between path params and query 
string params ?



I'd need to better understand when QS params should be used and path 
params can be used, with relation to cachability properties of the 
resulting resource, i.e. the external impact of resources using amp; 
verses ;



The reference you cite http://www.faqs.org/rfcs/rfc2616.html (el al) 
maybe you could also cite the section I should look at.  A simple search 
for param or semi yeilds no related results.  I have spent an hour 
looking into the issue over the weekend and found the specification that 
covers the URI scheme for http: from this angle it seems to leave the 
part after the ? to denote the start of a query string vague.  Which 
lead me to a presumption that it was HTTP server dependant on its 
interpretation, since for example the CGI.pm modules changed over from  
to ; as the standard param delimiter with generated URLs, providing the 
resulting URL talks back to itself (the CGI.pm module) all will be well 
in the world but if it links to a TC server then there would appear to 
be a problem.



Thanks for your response.


Jon Wingfield wrote:

In a URL the semi-colon indicates the start of path parameters (as 
opposed to the normal query parameters) as defined in rfc2616 (HTTP1.1 
spec) et al.

Thus, you can't tell tomcat to use it as a query string delimiter.
JSESSIONID is a well known path parameter for Servlet 2.2+ Containers.

To use a semi-colon within a url you'll need to url encode it as %3B
To use it in the way you want you'll have to encode and parse the 
query string yourself.


HTH,

Jon

Darryl L. Miles wrote:



I swear I had application code working that was using semi-colons to 
delimit query string parameters.  I'm sure I've also seen TC append a 
;JSESSIONID= at the end of the URL.


But my own application code written like:

String val = request.getParameters(name);

Yeilds: val=value;name2=foobar;


Is there an additional option to allow semi-colon usage, instead of 
amp;  ?


Running TC 5.5.9

Thanks.





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

.




--
Darryl L. Miles



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



Another JSP precompile question

2005-09-05 Thread Sonja Löhr
Hi!
I just read about your Jasper2 precompiling...
Do you do it via ant?
I tried tomcat's JspC task (tomcat 5.5.9), but jasper generates rubbish
wherever a character reference like #160; is encountered. Compile
errors follow.
A bug, isn't it?
Is there a solution/upgrade/fix available?

How comes that this problem is only with that precompile (and only as
ant task??) - I would have guessed that the same procedures take place
as when tomcat compiles at runtime?

Thank you!

sonja




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



JK-1.2.14 for Apache WebServer 2.0.x

2005-09-05 Thread MERVYN . SANDS
On the download page for latest JK 1.2 connector:

http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/solaris/jk-1.2.14
/

I don't see a JK connector for Apache 2.0 only for 1.3.x. In addition I'm
unable to locate previous versions 1.2.13, 1.2.12 etc. The download page
has 1.2.6 alongside 1.2.14.  Anyone have an update on this?

Thanks.


Mervyn Sands





Global Technology Infrastructure - Application Server Engineering :
http://emis.chase.com/groups/appServer/

JPMorganChase  Co., 1 Chaseside
Solent Building, Mail Point 511B,
Bournemouth, BH7 7DA

( desk: 44-(0)1202 342426 GDP 731 2426
( mob: 44-(0)77 141 00764
* email: [EMAIL PROTECTED]




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



RE: Building Mod_jk for HP-UX fails

2005-09-05 Thread Ivo Van Den Maagdenberg
amber# /home/amaris/ivdmaagden/gmake/bin/make --version

GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for hppa2.0w-hp-hpux11.11
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to bug-make@gnu.org.

And for gcc

 amber# /usr/local/bin/gcc --version
gcc (GCC) 3.3.3
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


 -Oorspronkelijk bericht-
 Van: David Rees [mailto:[EMAIL PROTECTED] 
 Verzonden: donderdag 1 september 2005 22:40
 Aan: Tomcat Users List
 Onderwerp: Re: Building Mod_jk for HP-UX fails
 
 On 8/30/05, Ivo Van Den Maagdenberg
 [EMAIL PROTECTED] 
  After the jk/native/common directory is built, make does seems not 
  pass through the jk/native/apache-1.3 directory properly. I would 
  appreciate some help in getting make this to work.
 
 snip
  
  Make output below:
  
  Making all in apache-1.3
  Make: line 23: syntax error.  Stop.
  *** Error exit code 1
 
 What version of make are you using?  Are you using GNU make?  
 If not, try that.
 
 -Dave
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

___

Deze e-mail en alle gekoppelde bestanden zijn officiele documenten van het 
Gemeentelijk Havenbedrijf Antwerpen en kunnen vertrouwelijke of persoonlijke 
informatie bevatten. Gelieve de afzender onmiddellijk via e-mail of telefonisch 
te verwittigen als u deze e-mail per vergissing heeft ontvangen en verwijder 
vervolgens de e-mail zonder deze te lezen, te reproduceren, te verspreiden of 
te ontsluiten naar derden. Het Gemeentelijk Havenbedrijf Antwerpen is op geen 
enkele manier verantwoordelijk voor fouten of onnauwkeurigheden in de inhoud 
van deze e-mail. Het Gemeentelijk Havenbedrijf Antwerpen kan niet aansprakelijk 
gesteld worden voor directe of indirecte schade, verlies of ongemak veroorzaakt 
als gevolg van een onnauwkeurigheid of fout in deze e-mail. --- English 
Translation: This e-mail and all attached files are official documents of 
Antwerp Port Authority and may contain confidential or personal information. If 
you have received this e-mail in error, you are asked to inform the sender by 
e-mail or telephone immediately, and to remove it from your system without 
reading or reproducing it or passing it on to other parties. Antwerp Port 
Authority is in no way responsible for any errors or inaccuracies in the 
contents of this e-mail, nor can it be held liable for any direct or indirect 
loss, damage or inconvenience arising from any such errors or inaccuracies. 
[GHA#Disclaimer]

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



Re: switching

2005-09-05 Thread JhnVend
Thanks. I put in the setup.jsp 

String sDriver = ; 
...

and it worked. Should have checked java syntax... thought it was from 
jsp/tomcat.

Jhn



Frank W. Zammetti [EMAIL PROTECTED] wrote:

Hi,

sDriver, as well as all your other variables, are declared locally 
within the if block.  Once out of that block, they no longer exist.  So, 
when the code in conn_products.jsp executes, which would of course 
happen after that if block, those variables do not exist.

Add this right before the if block begins:

String sDriver;
String sUser;
String sPass;
String sDSN;

...and of course remove the String type declaration before each variable 
in the if block, and you should be good to go.

Frank

[EMAIL PROTECTED] wrote:
 Could someone point out what's wrong with this setup? 
 
 I have a laptop, sometimes going offline and don't want to
 change strings each time I'm online or offline. (And don't want to run any
 db server on the laptop if I can avoid it.)
 
 Error is here:
 
 org.apache.jasper.JasperException: Unable to compile class for JSP
 
 An error occurred at line: 1 in the jsp file: conn_products.jsp
 Generated servlet error:
 sDriver cannot be resolved
 
 
 
 
 In setup.jsp,
 
 %
 if(request.getServerName().equals(server.com)) {
   String sDriver = com.mysql.jdbc.Driver;
   String sUser = user;
   String sPass = password;
   String sDSN = jdbc:mysql://localhost:3306/products;
 } else if (request.getServerName().equals(localhost)) {
   String sDriver = sun.jdbc.odbc.JdbcOdbcDriver;
   String sUser = ;
   String sPass = ;
   String sDSN = jdbc:odbc:products;
 }
 %
 
 In conn_products.jsp,
 
 %
 String MM_products_DRIVER = sDriver ;
 String MM_products_USERNAME = sUser ;
 String MM_products_PASSWORD = sPass ;
 String MM_products_STRING = sDSN ;
 %
   
 And in list.jsp,
   
 %include file=setup.jsp%
 %include file=conn_products.jsp%
   
 Jhn
 
 __
 Switch to Netscape Internet Service.
 As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
 
 Netscape. Just the Net You Need.
 
 New! Netscape Toolbar for Internet Explorer
 Search from anywhere on the Web and block those annoying pop-ups.
 Download now at http://channels.netscape.com/ns/search/install.jsp
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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



__
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp

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



putting files with webdav

2005-09-05 Thread Hugo Osorio
Hello everybody

looking for help, i need to use webdav component in Tomcat 5.0, i am using 
FreeBSD 4.11 stable
I have connected Dreamweaver, and DAV Explorer to the 
http://192.X.X.X:8080/webdav 
it do retrieves content, and i can get files, But.. I cannot put files on 
it.. it says the access is denied.. 

What do i have to do in order to change this so it permit me to transfer 
files?

thank you


RE: putting files with webdav

2005-09-05 Thread Michael Oliver
Look in the /webapps/webdav/WEB-INF/web.xml

You should see where you need to uncomment things to enable writing. 


Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)643-7425
Fax:(702)974-0341
*Note new email changed from [EMAIL PROTECTED]

-Original Message-
From: Hugo Osorio [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 05, 2005 8:35 AM
To: tomcat-user@jakarta.apache.org
Subject: putting files with webdav

Hello everybody

looking for help, i need to use webdav component in Tomcat 5.0, i am using
FreeBSD 4.11 stable I have connected Dreamweaver, and DAV Explorer to the
http://192.X.X.X:8080/webdav it do retrieves content, and i can get files,
But.. I cannot put files on it.. it says the access is denied.. 

What do i have to do in order to change this so it permit me to transfer
files?

thank you


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



Re: putting files with webdav

2005-09-05 Thread Hugo Osorio
Thank you, it worked


2005/9/5, Michael Oliver [EMAIL PROTECTED]:
 
 Look in the /webapps/webdav/WEB-INF/web.xml
 
 You should see where you need to uncomment things to enable writing.
 
 
 Michael Oliver
 CTO
 Alarius Systems LLC
 6800 E. Lake Mead Blvd, #1096
 Las Vegas, NV 89156
 Phone:(702)643-7425
 Fax:(702)974-0341
 *Note new email changed from [EMAIL PROTECTED]
 
 -Original Message-
 From: Hugo Osorio [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 05, 2005 8:35 AM
 To: tomcat-user@jakarta.apache.org
 Subject: putting files with webdav
 
 Hello everybody
 
 looking for help, i need to use webdav component in Tomcat 5.0, i am using
 FreeBSD 4.11 stable I have connected Dreamweaver, and DAV Explorer to the
 http://192.X.X.X:8080/webdav it do retrieves content, and i can get files,
 But.. I cannot put files on it.. it says the access is denied..
 
 What do i have to do in order to change this so it permit me to transfer
 files?
 
 thank you
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: HTTP status code 404

2005-09-05 Thread Paul Singleton

Please help a little more; I am not sure what you mean.

The error-page directive as documented in SRV.9.9.2 of
the 2.4 servlet spec mentions that we can nominate a custom
error page, otherwise I understand we get Tomcat's default
one.

But we want *no* error page, just a 404 status returned to
the browser, which will then presumably present this failure
to the user in its own way.  Or have I musunderstood 404s?

Exactly what error-page element will achieve this, and
where should we call ...setStatus(...NOT_FOUND)?

Paul Singleton

Mirek Stohr wrote:

You should use the following procedure

HttpServletResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);

in cooperation with the mentioned error-page directive in web.xml.

  Mirek


L. Mohan Arun wrote:


Tomcat 4.1
 
How can I configure Tomcat 4 to return HTTP status code 404 for a 404 Page 
Not Found error? Currently it displays a HTML page with Error type etc. 
with status code 200.


The docs say error-page element in web.xml can be configured to serve 
another page in response to a 404 error but this is not what I want (because 
it will return a 200 OK status). I want the actual error code 404 to be 
returned to the client and HTTP status code 404 (Page not found).


Mohan Arun




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






--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/89 - Release Date: 2/Sep/2005


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



Re: HTTP status code 404

2005-09-05 Thread QM
On Mon, Sep 05, 2005 at 06:28:05PM +0100, Paul Singleton wrote:
: But we want *no* error page, just a 404 status returned to
: the browser, which will then presumably present this failure
: to the user in its own way.  Or have I musunderstood 404s?

Yes and no.  Browsers are free to interpret 404s (and any other error
code) as they see fit.  For example, IE's friendly error messages will
interpret the status code and show the user its own not found page
instead of the data returned by the server.


: Exactly what error-page element will achieve this, and
: where should we call ...setStatus(...NOT_FOUND)?

If you *really* want to leave this up to the browser, map the
error-page to a JSP that simply sets a 404 response and returns no
data.  (I forget the exact API call for this, but it's in the
HttpServlet or HttpServletRequest JavaDoc.)

Another alternative would be to have the error-page redirect people to
the site's landing page.  (The idea is, if you've hit an invalid URL,
go back to the beginning.)  I've done this before for certain sites.

The real question is, do you really want to do this?

Unless you're writing a highly specialized app, it's not nice to fool
the end-user on error conditions.  The JSP that just sends a 404 may
yield document contains no data errors from the browser; and
redirecting people to the landing page may hide broken links (read:
developer error) and/or frustrate the user.

-QM

-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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



Re: SSL problem

2005-09-05 Thread Mark Thomas

For 5, import the CA cert to $JAVA_HOME/jre/lib/security/cacerts

Do 4 after 5.

If you do it right, you shouldn't see the prompt to trust the CA as it 
is already in your list of trusted certs.


Also, check the server cert you get back is indeed what you expect.

Mark

Peter Betz wrote:

Hi,

I am having a problem here. I am using Jakarta Tomcat V5.5 (part of
jboss-4.0.2) and j2sdk1.4.2_08 on a Redhat Linux server.
I having been trying to register a signed certificate but have thus far
being unsuccessful.
It always comes out as a self-signed certificate. What am I doing wrong?
Details are as follows:

Here is what I have been doing:

~~~
Logged in and performed commands as jboss user because the J2EE and Jakarta
Tomcat environment is run under jboss user.

1. Generate a private key with the following command:
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore
k-factor88.kdb

2. Generate the Certificate Signing Request (CSR)
$JAVA_HOME/bin/keytool -certreq -alias tomcat -keystore k-factor88.kdb -file
k-factor88.csr

3. Generate the Server Certificate
Submit k-factor88.csr to root certification authority and save returned
certificate into k-factor88.cer

4. Import the Server Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
root -file k-factor88.cer
Note: Keytool confirms that the certificate has been signed by a
certification authority. I choose to trust it.

5. Import the Trust Certificate
$JAVA_HOME/bin/keytool -import -trustcacerts -keystore k-factor88.kdb -alias
jboss -file UTN.cer
Note: UTN.cer is the certification authority certificate and needs to be
imported.

server.xml

~
 Connector port=8443 address=${jboss.bind.address}
   maxThreads=100 strategy=ms maxHttpHeaderSize=8192
   emptySessionPath=true
   scheme=https secure=true clientAuth=false
   keystoreFile=${jboss.home.dir}/bin/certs/k-factor88.kdb
   keystorePass=changeit sslProtocol = TLS /



-
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: HTTP status code 404

2005-09-05 Thread Paul Singleton

QM wrote:

On Mon, Sep 05, 2005 at 06:28:05PM +0100, Paul Singleton wrote:
: But we want *no* error page, just a 404 status returned to
: the browser, which will then presumably present this failure
: to the user in its own way.  Or have I musunderstood 404s?



Yes and no.  Browsers are free to interpret 404s (and any other error
code) as they see fit.  For example, IE's friendly error messages will
interpret the status code and show the user its own not found page
instead of the data returned by the server.



: Exactly what error-page element will achieve this, and
: where should we call ...setStatus(...NOT_FOUND)?



If you *really* want to leave this up to the browser, map the
error-page to a JSP that simply sets a 404 response and returns no
data.  (I forget the exact API call for this, but it's in the
HttpServlet or HttpServletRequest JavaDoc.)


It's in javax.servlet.http.HttpServletResponse (from 2.1), hence

% 
response.sendError(javax.servlet.http.HttpServletResponse.SC_NOT_FOUND); 
%



...

 The real question is, do you really want to do this?

I *really* want to return a page which gives a hacker no indication
which web app server we're using (because our client thinks this is
good security practice) without going to the trouble of writing my
own :-)

I've tried your dataless 404 suggestion, and it indeed prompts IE
to show that familiar

  The page cannot be found

effort, but unfortunately Firefox shows a blank page, so just in case
there are ever any broken links in our web apps, I'd better not leave
it up to the browser, but write a (suitably anonymous) one of our own.

Many thanks for your help

Paul Singleton


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/89 - Release Date: 2/Sep/2005


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



getRealPath() returns real path plus context path

2005-09-05 Thread Franz-Josef Herpers

Hi,

I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9.

My web application resides under the name tool in the webapps 
directory. When I call 
servletContext.getRealPath(request.getContextPath() I get the real path 
but always with the context path added at the end. That means a path 
like C:\path\to\tomcat\webapps\tool\tool.


Is there any explanation for this behaviour? Or am I doing something wrong?

Thanks for any hints in advance

Regards
Franz

--
Franz-Josef Herpers
Puschkinallee 9A
12435 Berlin
030/53 21 33 02
0173/54 23 666
[EMAIL PROTECTED]



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



RE: Multiple IP addresses

2005-09-05 Thread Barnett, Brian W.
Thanks Peter. I did what you suggested, and I think it is *almost* working.

I have one NIC in my server and I added a second IP address on it. I tested
it out, and I was able by ping both IP addresses.

I then modified the server.xml file to have two service elements here they
are:

Service name=WSSService 
Connector port=80 
maxThreads=150 minSpareThreads=25 maxSpareThreads=75 
enableLookups=false redirectPort=443 acceptCount=100 
debug=0 connectionTimeout=2 
disableUploadTimeout=true 
address=166.70.163.138 / 
Connector port=443 
maxThreads=150 minSpareThreads=25 maxSpareThreads=75 
enableLookups=false disableUploadTimeout=true 
acceptCount=100 debug=0 scheme=https secure=true 
clientAuth=false sslProtocol=TLS 
address=166.70.163.138 / 
Connector port=8009 
enableLookups=false redirectPort=443 debug=0 
protocol=AJP/1.3 
address=166.70.163.138 / 
!-- Put context.xml files in ../conf/[enginename]/[hostname]
../conf/Catalina/wss -- 
Engine name=Catalina defaultHost=wss debug=0 
Logger className=org.apache.catalina.logger.FileLogger 
prefix=catalina_log. suffix=.txt 
timestamp=true/ 
Realm
className=org.apache.catalina.realm.UserDatabaseRealm 
debug=0 resourceName=UserDatabase/ 
Host name=wss debug=0 appBase=wss-webapps 
unpackWARs=true autoDeploy=true 
xmlValidation=false xmlNamespaceAware=false 
Logger
className=org.apache.catalina.logger.FileLogger 
directory=logs prefix=wss_log.
suffix=.txt 
timestamp=true/ 
/Host 
/Engine 
/Service 

Service name=ScrumService 
Connector port=80 
maxThreads=150 minSpareThreads=25 maxSpareThreads=75 
enableLookups=false redirectPort=443 acceptCount=100 
debug=0 connectionTimeout=2 
disableUploadTimeout=true 
address=166.70.163.140 / 
Connector port=443 
maxThreads=150 minSpareThreads=25 maxSpareThreads=75 
enableLookups=false disableUploadTimeout=true 
acceptCount=100 debug=0 scheme=https secure=true 
clientAuth=false sslProtocol=TLS 
address=166.70.163.140 / 
Connector port=8009 
enableLookups=false redirectPort=443 debug=0 
protocol=AJP/1.3 
address=166.70.163.140 / 
!-- Put context.xml files in ../conf/[enginename]/[hostname]
../conf/Catalina/scrum -- 
Engine name=Catalina defaultHost=scrum debug=0 
Logger className=org.apache.catalina.logger.FileLogger 
prefix=catalina_log. suffix=.txt 
timestamp=true/ 
Realm
className=org.apache.catalina.realm.UserDatabaseRealm 
debug=0 resourceName=UserDatabase/ 
Host name=scrum debug=0 appBase=scrum-webapps 
unpackWARs=true autoDeploy=true 
xmlValidation=false xmlNamespaceAware=false 
Logger
className=org.apache.catalina.logger.FileLogger 
directory=logs prefix=scrum_log.
suffix=.txt 
timestamp=true/ 
/Host 
/Engine 
/Service 

I can successfully hit all the web apps on 166.70.163.138, the first
service listed, but I'm not getting anything on the second one. I've
commented out the first one and restarted Tomcat, but still can't get
anything on 166.70.163.140.

I put the Tomcat manager web app in both web app folders but only can hit it
in one. Anybody have any suggestions on how to troubleshoot this?

TIA,
Brian Barnett

-Original Message-
From: Peter Crowther
To: Tomcat Users List
Sent: 9/2/2005 4:27 AM
Subject: RE: Multiple IP addresses

 From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] 
 I seem to remember when I was working with IIS some years 
 ago, I could map
 multiple IP addresses to one instance of IIS, i.e., IIS could service
 multiple web sites for me, each web site having it's own, 
 unique IP address.
 Is there a way to do this with Tomcat stand alone or is 
 Apache Web Server or
 IIS required?

Works fine with Tomcat.  Modify your server.xml to have multiple
Services, each with its own set of innards like Connectors and Hosts,
and each with its own appbase.  Then use

address=numeric.ip.address.required

in each of the connector attributes to force a bind to just that IP
address for that connector.


[jasper] compiling jsp in an osgi context

2005-09-05 Thread Gilles Dodinet

hi-

resending a mail i inadvertently sent to commons-user..

i'm trying to execute jsp in an osgi context with no luck as of today. 
i've embedded jetty as an osgi bundle and registered a BundleListener 
which registers installed bundles as webapp if they contain a web 
descriptor file. so far so good. it plays nice with simple html files. 
however i'm encountering troubles when it comes to jsp. generated 
servlets don't compile anything because javax.servlet.* classes are not 
found (please note that the transformation process is successfull).


in the manifest i declare javax.servlet as Import-Package (most prolly 
this seems to cause the issue) and jetty, jasper and related 
dependencies as bundled libs. Also as jasper seems to require an 
urlclassloader i've come up with a (pretty simple) custom urlclassloader 
which delegates all calls to either the target bundle (i.e. the 
installed bundle which wraps the webapp) or the current bundle.  jasper 
classes are succesfully loaded, but not the javax.servlet.* classes. 
googling about this using various criteria gives me in only three 
relevant results :


1/ embedded pagebox whose earlier version (2001) targets the same 
problematic as me. since it is released under lgpl i've tried to use it 
to match my specific needs, however it pretty quick became total hackery 
- 2000 lines src files not maintained since 2001 or so and they 
duplicate lot of services already provided by containers.

2/ a thread on oscar user list with no anwer
3/ a wiki page (entitled 'Tomcat as osgi bundles' and hosted on safehaus 
- with just a listing of bundles i'm unable to find) so i thought i 
could ask here if someone came to a solution to this problem. Has it 
already be done yet ?


below are the relevant manifest entries and webapp registration code. 
the target bundle as no Import-Package and no classes (just the simplest 
hello world). webapp registration [1] assigns the currentThead 
contextClassLoader to the simple delegating classloader discussed above 
- needed to start the webapp, and [2] sets the WebApplicationContext 
ClassLoader to the exact same ClassLoader - which i thought would have 
provided javax.servlet.* classes.


this may not be the best list for this question (should i rather ask on 
jetty or [EMAIL PROTECTED] user lists ?), anyway thanks for any input.



Import-Package: org.osgi.service.http,javax.servlet,
javax.servlet.http,org.osgi.framework,net.joss.utils
Bundle-Classpath: .,
org.mortbay.jetty-5.1.4.jar,
commons-logging-1.0.4.jar,
servlet-api-2.4.jar,
xerces-2.4.0.jar,
xmlParserAPIs-2.6.2.jar,
xml-apis-2.0.2.jar,
jsp-api-2.0.jar,
jasper-compiler-5.5.9.jar,
jasper-runtime-5.5.9.jar,
commons-el-1.0.jar,
ant-1.6.2.jar

class JettyWrapper
{
   public void createApplication(final String appName, final File app, 
final Bundle fromBundle)

   {
  Thread thread = new Thread()
  {
  public void run()
 {
  try
  {
  ClassLoader loader = new DelegatingClassLoader(
  fromBundle,
  this.getClass().getClassLoader());

  
Thread.currentThread().setContextClassLoader(loader);[1]


  String location = app.getAbsolutePath();

  WebApplicationContext context =
  jetty.addWebApplication(/ + appName, 
location);

context.setClassLoader(loader);[2]

  ...
  context.start();
  }
  catch (Exception e)
  {
  LOG.error(Unable to start ' + appName + ' 
context, e);

  }
  }
  };
thread.start();
}
}

-- gd


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



how tomcat not run .EXE as CGI

2005-09-05 Thread gjl
Thanks very much to read my question.
I have tomcat5.0 for Win32 installed locally on
 Windows 2k, SP4. I'm trying to run a namazu.cgi.exe (a Full-Text Search
Engine. that's not Perl scripts ,but a binary file) .
the file is in Tomcat 5.0\webapps\XXX\WEB-INF\cgi ,and I set the web.xml
file as followservlet
servlet-namecgi/servlet-name

servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class
init-param
  param-nameclientInputTimeout/param-name
  param-value100/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value6/param-value
/init-param
init-param
  param-namecgiPathPrefix/param-name
  param-valueWEB-INF/cgi/param-value
/init-param
 load-on-startup5/load-on-startup
/servlet
servlet-mapping
servlet-namecgi/servlet-name
url-pattern/cgi-bin/*/url-pattern
/servlet-mapping

 However, any reference to one of the .EXE in the
http://localhost:8080/jsp-examples/cgi-bin/namazu.cgi.exe directory results
in the browser trying to download the EXE. and I got the message 2005-09-06
10:07:25 StandardContext[/jsp-examples]cgi: runCGI (stderr):Unrecognized
character \x90 at \Tomcat
5.0\webapps\jsp-examples\WEB-INF\cgi\namazu.cgi.exe line 1. in logs.
how can I set the tomcat to run the .exe?