You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Heinz R., ITS P E320, TR" <R....@deutschepost.de> on 2001/04/10 10:37:01 UTC

Problems with Apache+JServ

Hi all.

In my xsp I'm using some own objects which do local (server) File I/O.

With Tomcat 3.1 (standalone for development) everything works fine, but with Apache 1.3.x + JServ 1.1.2
I can not delete or overwrite files.
Does anybody know the reason?

Thanks,
Roman

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Odd java XSP problem with hashtables and javax.servlet.http.HttpUtils

Posted by Matthew Cordes <mc...@maine.edu>.
Hi, 

Althought another poster answered your question, I'd like to point 
out that the line
> 		  Hashtable qs = new Hashtable();

is not needed as 
> 		  	qs = HttpUtils.parseQueryString(request.getQueryString());

creates a new hashtable and replaces the one you created above (e.g.
qs is a pointer to a hashtable, then the pointer is moved to a new hashtable).

-matt


On Tue, Apr 10, 2001 at 11:40:18AM -0700, Jay Wright wrote:
> 
> I'm having an odd problem.
> 
> I'm parsing a query string with javax.servlet.http.HttpUtils which throws it
> into a hashtable.  This works fine when I access this variable through
> <xsp:expr> and it simply places that object in an element.  It wont work if
> I try casting that object to String (all hashtable values are of type
> java.lang.Object)or if I try to access it through <xsp:attribute> first,
> calling <xsp:expr> within it (which imposes a cast on it within the cocoon
> generated java code).
> 
> Works Fine:
> 	<xsp:logic>
> 	<![CDATA[
> 		if ((request.getMethod()).equals("GET")) {
> 		  String queryString = request.getQueryString();
> 		  Hashtable qs = new Hashtable();
> 		  if (queryString != null) {
> 		  	qs = HttpUtils.parseQueryString(request.getQueryString());
> 	]]>
> 	</xsp:logic>
> 	<contactID>
> 		<xsp:expr>qs.get("contactID")</xsp:expr>
> 	</contactID>
> 
> Wont work:
> 	1. Casting with (String)qs.get("contactID")
> 	2. String.valueOf(qs.get("contactID"))
> 	3. (qs.get("contactID").toString()
> 
> 	I must be missing something because I can't see why I cannot cast the
> Ojbect (qs.get returns type Object) to a String and use the value.  Instead
> I get a [Ljava.lang.String;@2da3d cast exception thrown at me.
> 
> Any ideas.
> 
> I know this might be more of a java problem than xsp problem, but I posted
> here hoping that someone had a clever way around this (and getting at the
> query string parameters in xsp).
> 
> Jay
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Odd java XSP problem with hashtables and javax.servlet.http.HttpUtils

Posted by Jay Wright <bl...@teleport.com>.
I'm having an odd problem.

I'm parsing a query string with javax.servlet.http.HttpUtils which throws it
into a hashtable.  This works fine when I access this variable through
<xsp:expr> and it simply places that object in an element.  It wont work if
I try casting that object to String (all hashtable values are of type
java.lang.Object)or if I try to access it through <xsp:attribute> first,
calling <xsp:expr> within it (which imposes a cast on it within the cocoon
generated java code).

Works Fine:
	<xsp:logic>
	<![CDATA[
		if ((request.getMethod()).equals("GET")) {
		  String queryString = request.getQueryString();
		  Hashtable qs = new Hashtable();
		  if (queryString != null) {
		  	qs = HttpUtils.parseQueryString(request.getQueryString());
	]]>
	</xsp:logic>
	<contactID>
		<xsp:expr>qs.get("contactID")</xsp:expr>
	</contactID>

Wont work:
	1. Casting with (String)qs.get("contactID")
	2. String.valueOf(qs.get("contactID"))
	3. (qs.get("contactID").toString()

	I must be missing something because I can't see why I cannot cast the
Ojbect (qs.get returns type Object) to a String and use the value.  Instead
I get a [Ljava.lang.String;@2da3d cast exception thrown at me.

Any ideas.

I know this might be more of a java problem than xsp problem, but I posted
here hoping that someone had a clever way around this (and getting at the
query string parameters in xsp).

Jay


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>