Forums > MaxMSP

Some example code for jweb and JSPs

May 3, 2008 | 2:35 pm

I’ve just spent a couple of hours knocking up some example code using
my embedded Jetty web server package generating HTML pages for jweb,
leading to a level of integration where Max can control the rendering
of HTML pages, and the HTML can contain links which generate Max
messages… so if calculating "2 * 2" using the [*] box is too easy,
you can now inject the numbers into a JSP, use EL for the calculation
via a J2EE servlet engine, and get the result back in Max merely by
clicking an HTML link. Progress.

I’ve integrated the example into my web package, here:

http://www.loadbang.net/space/Software/net.loadbang.web

Nick Rothwell – nick@cassiel.comhttp://www.cassiel.com
— open-source goodies for MaxMSP: Python, Groovy, Nixie Tubes,
— rotatable text bricks, databases: all at http://www.loadbang.net


May 3, 2008 | 7:56 pm

Hi Nick
I’ve just tried this version but am unable to load anything with the max5
example. I get the error messages below. I’m using Mac OSX 10.4.11.

The form example works as expected in mxt.server, but errors again occur
with the jsp example using safari, which seems to suggest that the problem
lies somewhere with jsp. I had previously downloaded and successfully
tested the previous version, (prior to Max5).

pelado

2008-05-03 21:16:57.521::WARN: /jWebFun.jsp
org.apache.jasper.JasperException: /jWebFun.jsp(9,21) PWC6038: "${border}"
contains invalid expression(s): javax.el.ELException: Provider
com.sun.el.ExpressionFactoryImpl not found at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:62)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:357)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:169)
at org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:633)
at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:736)
at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:929) at
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257) at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2307) at
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2313) at
org.apache.jasper.compiler.Node$Root.accept(Node.java:481) at
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257) at
org.apache.jasper.compiler.Validator.validate(Validator.java:1837) at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195) at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:409) at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at
org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at
org.mortbay.jetty.Server.handle(Server.java:324) at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

On Sat, May 3, 2008 at 4:35 PM, Nick Rothwell wrote:

> I’ve just spent a couple of hours knocking up some example code using my
> embedded Jetty web server package generating HTML pages for jweb, leading to
> a level of integration where Max can control the rendering of HTML pages,
> and the HTML can contain links which generate Max messages… so if
> calculating "2 * 2" using the [*] box is too easy, you can now inject the
> numbers into a JSP, use EL for the calculation via a J2EE servlet engine,
> and get the result back in Max merely by clicking an HTML link. Progress.
>
> I’ve integrated the example into my web package, here:
>
> http://www.loadbang.net/space/Software/net.loadbang.web
>
>


May 4, 2008 | 9:49 am

On 3 May 2008, at 20:56, pelado wrote:

> 2008-05-03 21:16:57.521::WARN: /jWebFun.jsp
> org.apache.jasper.JasperException: /jWebFun.jsp(9,21) PWC6038: "$
> {border}" contains invalid expression(s): javax.el.ELException:
> Provider com.sun.el.ExpressionFactoryImpl not found at

Hmm … sounds as if there’s a JSP engine problem somewhere.

I’ll give it a test on a Mac from the actual package ZIP using 10.4.11
and see if there’s any difference…

– N.

Nick Rothwell / Cassiel.com Limited
http://www.cassiel.com
http://www.myspace.com/cassieldotcom
http://www.last.fm/music/cassiel
http://www.reverbnation.com/cassiel
http://www.linkedin.com/in/cassiel
http://www.loadbang.net


May 4, 2008 | 10:33 am

> The form example works as expected in mxt.server, but errors again
> occur with the jsp example using safari, which seems to suggest that
> the problem lies somewhere with jsp. I had previously downloaded
> and successfully tested the previous version, (prior to Max5).

Hmm – I just installed the package from scratch on a Mac running
10.4.11, tried it with the Max5 Runtime, and it worked fine.

What do you have in your Cycling ’74/java/lib directory? Are you
pulling in JARs from anywhere else? What version of Java do you have
installed? (10.4.11 should be running Java 1.5.x.)

– N.

Nick Rothwell – nick@cassiel.comhttp://www.cassiel.com
— open-source goodies for MaxMSP: Python, Groovy, Nixie Tubes,
— rotatable text bricks, databases: all at http://www.loadbang.net


May 4, 2008 | 3:13 pm

I’ve just gone through the install again and think that I must have made a
mistake with the max.java.config file. I didn’t check this before as it
appeared that max was locating the jar files correctly. I’ve now got it up
and working correctly now. Sorry for the inconvenience and thanks for the
example files.
pelado

On Sun, May 4, 2008 at 12:33 PM, Nick Rothwell wrote:

> The form example works as expected in mxt.server, but errors again occur
> > with the jsp example using safari, which seems to suggest that the problem
> > lies somewhere with jsp. I had previously downloaded and successfully
> > tested the previous version, (prior to Max5).
> >
>
> Hmm – I just installed the package from scratch on a Mac running 10.4.11,
> tried it with the Max5 Runtime, and it worked fine.
>
> What do you have in your Cycling ’74/java/lib directory? Are you pulling
> in JARs from anywhere else? What version of Java do you have installed?
> (10.4.11 should be running Java 1.5.x.)
>
> — N.
>
>
>
> Nick Rothwell – nick@cassiel.comhttp://www.cassiel.com
> — open-source goodies for MaxMSP: Python, Groovy, Nixie Tubes,
> — rotatable text bricks, databases: all at http://www.loadbang.net
>
>

http://www.pelado.co.uk


May 4, 2008 | 3:25 pm

On 4 May 2008, at 16:13, pelado wrote:

> I’ve just gone through the install again and think that I must have
> made a mistake with the max.java.config file. I didn’t check this
> before as it appeared that max was locating the jar files correctly.

OK – classpath conflicts can be snarky sometimes. Glad you’re up and
running – do shout if you come up with anything interesting, since
having built this stuff I don’t have any immediate ideas what to do
with it…

– N.

Nick Rothwell – nick@cassiel.comhttp://www.cassiel.com
— open-source goodies for MaxMSP: Python, Groovy, Nixie Tubes,
— rotatable text bricks, databases: all at http://www.loadbang.net


April 13, 2011 | 10:39 am

net.loadbang.web is really cool, but i want to hack it a bit. I want to incorporate a json library so that i can send name value pairs into the net.loadbang.web mxj and have it write json to an attribute. I am reading the json with jquery to get the values in client side javascript.

At the moment i am using the sprintf object to format the json string and i’m having to add a backslash before quotes etc. This is cumbersome and i’m a bit concerned doing it in symbols might flood the max symbol table- so thats why i want to hack the functionality into net.loadbang.web

I am not familiar with eclipse. I don’t seem to be able to open the project – can you give me a clue how to do that?

thanks,

oli


April 13, 2011 | 12:27 pm

Hi Oli,

I have your email from last week – will follow up there when I get a moment… It sounds as if I need to flesh out the documentation a bit, at least.


April 13, 2011 | 12:46 pm

actually re the email… i no longer need to run it on port 80… i set up my office mac to forward all incoming port 80 data to 8080, so that is fine.

now i am doing the json stuff via javascript and it’s kind of nice… it means i can have exactly the same data structure, representing the state of my patch inside max as I do on the client side.

still would like to be able to compile net.loadbang.web myself since i think i may have to make some mods to it for my needs


Viewing 9 posts - 1 through 9 (of 9 total)