You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Sanders <sa...@totalsync.com> on 2001/04/02 10:21:45 UTC

[CATALINA]

Using the latest CVS of Catalina, I am having an issue with my web 
application.  When I build my webapp with Ant, I create many xml files 
under WEB-INF/classes/xml/oem/*.  Then when a request comes in, I use 
getClass().getResource() to return the URL to the xml file.

In Tomcat 3.x (3.0,3.1,3.2,3.2.1), the URL returned looks something like 
file:///opt/tomcat/webapps/app-name/WEB-INF/classes/xml/oem/file.xml

In Catalina, the URL returned is:
   /WEB-INF/classes/xml/oem/file.xml

The problem is when I use this URL as an InputSource to my XSLT 
processor (Saxon), which is contained in /WEB-INF/lib/saxon.jar, it says 
that it cannot find the file.  In Tomcat 3.x, it finds the file fine and 
continues processing.

Any suggestions?  Is this a bug?  Undefined behavior?  Is there a 
workaround?

Thanks,
Scott Sanders


RE: Sending HTTP request from a servlet to ASP.

Posted by shlomi sarfati <sh...@visualtop.com>.
the simplest way is to redirect the page to the asp page with parameters in
the query string in the form of :
page.asp?param=value&param1=value
as far as I know you can transfer as much as 1 k in this form
the other way is to use sockets and to post the data to an asp page
in this way you can transfer bigger amounts of data

shlomi

-----Original Message-----
From: Saurabh Shukla [mailto:saurabh@cysphere.com]
Sent: Tue, April 03, 2001 12:45 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Sending HTTP request from a servlet to ASP.


Do u also need a response from the servlet to which you are sending the data
?

-----Original Message-----
From: Hitesh Bagchi [mailto:Hitesh.Bagchi@ushacomm.co.in]
Sent: Saturday, January 01, 2000 3:46 PM
To: tomcat-user@jakarta.apache.org
Subject: Sending HTTP request from a servlet to ASP.


Dear All,
I am trying to send an HTTP request to an ASP page.
Actually, i am writing a servlet which runs on tomcat 3.2 and wants to call
an ASP page and send it some form data. This is a requirement of the third
party software we are using to validate credit card details. How can i call
an ASP page from a java servlet using HTTP?
Thanx in advance,
Hitesh




RE: Sending HTTP request from a servlet to ASP.

Posted by Saurabh Shukla <sa...@cysphere.com>.
Do u also need a response from the servlet to which you are sending the data
?

-----Original Message-----
From: Hitesh Bagchi [mailto:Hitesh.Bagchi@ushacomm.co.in]
Sent: Saturday, January 01, 2000 3:46 PM
To: tomcat-user@jakarta.apache.org
Subject: Sending HTTP request from a servlet to ASP.


Dear All,
I am trying to send an HTTP request to an ASP page.
Actually, i am writing a servlet which runs on tomcat 3.2 and wants to call
an ASP page and send it some form data. This is a requirement of the third
party software we are using to validate credit card details. How can i call
an ASP page from a java servlet using HTTP?
Thanx in advance,
Hitesh


Sending HTTP request from a servlet to ASP.

Posted by Hitesh Bagchi <Hi...@ushacomm.co.in>.
Dear All,
I am trying to send an HTTP request to an ASP page.
Actually, i am writing a servlet which runs on tomcat 3.2 and wants to call
an ASP page and send it some form data. This is a requirement of the third
party software we are using to validate credit card details. How can i call
an ASP page from a java servlet using HTTP?
Thanx in advance,
Hitesh


Re: [CATALINA]

Posted by Scott Sanders <sa...@totalsync.com>.
Craig R. McClanahan wrote:

> 
> On Mon, 2 Apr 2001, Scott Sanders wrote:
> 
> 
>> Using the latest CVS of Catalina, I am having an issue with my web 
>> application.  When I build my webapp with Ant, I create many xml files 
>> under WEB-INF/classes/xml/oem/*.  Then when a request comes in, I use 
>> getClass().getResource() to return the URL to the xml file.
>> 
>> In Tomcat 3.x (3.0,3.1,3.2,3.2.1), the URL returned looks something like 
>> file:///opt/tomcat/webapps/app-name/WEB-INF/classes/xml/oem/file.xml
>> 
>> In Catalina, the URL returned is:
>>    /WEB-INF/classes/xml/oem/file.xml
> 
> Doesn't the actual URL returned have jndi: on the front?
> 
> 
Apologies, Craig the URL is:  jndi:/WEB-INF/classes/xml/oem/file.xml

the jndi: is on the front, that's what I get for looking at it in the 
debugger.  JBuilder is handy, but I just did not look deep enough. ;-)


>> The problem is when I use this URL as an InputSource to my XSLT 
>> processor (Saxon), which is contained in /WEB-INF/lib/saxon.jar, it says 
>> that it cannot find the file.  In Tomcat 3.x, it finds the file fine and 
>> continues processing.
> 
> Could you provide a code snippet of exactly what you are trying?  I have
> used resources from /WEB-INF/classes and JAR files under /WEB-INF/lib with
> great success in Catalina, so it's probably something specific about what
> you are doing.
> 
> 

It looks as though a test using getClass.getResourceAsStream() works 
just fine.  I think that it is possible that Saxon is trying to do its 
own URL-processing and does not recognize the URL syntax starting with 
'jndi:'.  I will convert my code to use getResourceAsStream() instead.

Craig, thanks for the push in the right direction.  I probably should 
have thought about it more, as another service in the same webapp uses 
it without problems... ;-)

Scott Sanders


Re: [CATALINA]

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 2 Apr 2001, Scott Sanders wrote:

> Using the latest CVS of Catalina, I am having an issue with my web 
> application.  When I build my webapp with Ant, I create many xml files 
> under WEB-INF/classes/xml/oem/*.  Then when a request comes in, I use 
> getClass().getResource() to return the URL to the xml file.
> 
> In Tomcat 3.x (3.0,3.1,3.2,3.2.1), the URL returned looks something like 
> file:///opt/tomcat/webapps/app-name/WEB-INF/classes/xml/oem/file.xml
> 
> In Catalina, the URL returned is:
>    /WEB-INF/classes/xml/oem/file.xml
> 

Doesn't the actual URL returned have jndi: on the front?

> The problem is when I use this URL as an InputSource to my XSLT 
> processor (Saxon), which is contained in /WEB-INF/lib/saxon.jar, it says 
> that it cannot find the file.  In Tomcat 3.x, it finds the file fine and 
> continues processing.
> 

Could you provide a code snippet of exactly what you are trying?  I have
used resources from /WEB-INF/classes and JAR files under /WEB-INF/lib with
great success in Catalina, so it's probably something specific about what
you are doing.

> Any suggestions?  Is this a bug?  Undefined behavior?  Is there a 
> workaround?
> 
> Thanks,
> Scott Sanders
> 
> 

Craig