NetRexx BSF Question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NetRexx BSF Question

Kevin Baynes

I'm attempting to use NetRexx within the Bean Scripting Framework in a Web
Application.

To start, I have a 2 line script written in JavaScript that I'm trying to
translate into NetRexx. The JavaScript is:
addressBook = session.getAttribute("addressbook")
context.put("addresses", addressBook.getAddresses())


AddressBook, session and context are available Java objects. I cannot seem
to get this to work.

If I pass the script as is, I get the following Exception:

com.ibm.bsf.BSFException: There were NetRexx errors.
        at
com.ibm.bsf.engines.netrexx.NetRexxEngine.execEvalShared(NetRexxEngine.java:
327)
        at com.ibm.bsf.engines.netrexx.NetRexxEngine.exec(NetRexxEngine.java:170)
        at com.ibm.bsf.BSFManager.exec(BSFManager.java:479)
        at org.jpublish.action.ScriptAction.execute(Unknown Source)
        at org.jpublish.action.ActionWrapper.execute(Unknown Source)
        at org.jpublish.Page.executeActions(Unknown Source)
        at org.jpublish.servlet.JPublishServlet.doPost(Unknown Source)
        at org.jpublish.servlet.JPublishServlet.doGet(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
        at
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:9
6)
        at com.caucho.server.http.Invocation.service(Invocation.java:311)
        at
com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:342)
        at
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:272
)
        at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
        at java.lang.Thread.run(Thread.java:536)

I've been reading the NetRexx docs but cannot seem to find the correct
syntax. Any hints would be greatly appreciated.

Thanks!


-------------------------------
Kevin Baynes
Software Engineer
SEAGULL Software
kbaynes at seagullsw dot com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>


Reply | Threaded
Open this post in threaded view
|

RE: NetRexx BSF Question

Kevin Baynes
Thanks to Mike and Dion for replies. Dion indicated that the JavaScript I
sent may also be viewed as valid NetRexx; this is the confirmation or denial
I was seeking. Any disagreements?

The JavaScript is:

addressBook = session.getAttribute("addressbook")
context.put("addresses", addressBook.getAddresses())

The NetRexx documentation openly discusses the similarities to Java (with
which JavaScript displays many commonalities). For this reason, I sent the
JavaScript. Upon my perusal of the documentation, it seemed that this simple
example would translate directly.

----NetRexx QuickStart----

A character string is the fundamental datatype of NetRexx, and so, as you
might expect, NetRexx provides many useful routines for manipulating
strings. These are based on the functions of Rexx, but use a syntax that is
more like Java or other similar languages:
  phrase='Now is the time for a party'
  say phrase.word(7).pos('r')

----NetRexx QuickStart----

I will pursue this with the BSF group, unless any NetRexx'ers see any
obvious syntax errors to explain why the above JavaScript would not also be
valid NetRexx syntax.

Thanks again.


-------------------------------
Kevin Baynes
Software Engineer
SEAGULL Software
kbaynes at seagullsw dot com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>