You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ov...@apache.org on 2002/03/07 03:12:42 UTC
cvs commit: xml-cocoon2/src/scratchpad/schecoon/webapp example.scm
ovidiu 02/03/06 18:12:42
Modified: src/scratchpad/schecoon/webapp example.scm
Log:
Updated to use the new s2j module.
Revision Changes Path
1.3 +9 -15 xml-cocoon2/src/scratchpad/schecoon/webapp/example.scm
Index: example.scm
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/schecoon/webapp/example.scm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- example.scm 16 Feb 2002 01:46:55 -0000 1.2
+++ example.scm 7 Mar 2002 02:12:42 -0000 1.3
@@ -1,21 +1,15 @@
+(import s2j)
+
+(define HashMap (java-class "java.util.HashMap"))
+(define hash (make HashMap))
+
+(define-generic put)
+(put hash (->jstring "abc") (->jstring "123"))
+(put hash (->jstring "def") (->jstring "456"))
+
(function (my-function sitemap env a b)
(let ((arg (request:get-param env "arg")))
(printf "my-function2 a = ~s b = ~s~%" a b)
(printf "my-function arg = ~s~%" arg)
(send-page sitemap env "xsp" '(("source" . "xsp/example.xsp")) hash)
(printf "my-function: after send-page a = ~s, b = ~s, arg ~s~%" a b arg)))
-
-(java/import (java/class-for-name "java.util.HashMap") "hash:" #t)
-
-(define hash
- (java/instantiate (java/class-for-name "java.util.HashMap") #() #()))
-
-(define objectClass (java/class-for-name "java.lang.Object"))
-
-(java/call hash "put" (vector objectClass objectClass) (vector (scheme->java-object "abc") (scheme->java-object "123")))
-(java/call hash "put" (vector objectClass objectClass) (vector (scheme->java-object "def") (scheme->java-object "456")))
-
-;(hash:put hash "abc" "def")
-
-;(java->scheme-object (hash:toString hash))
-
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org