On Mon, Feb 3, 2014 at 7:43 PM, <[email protected]> wrote:

> Hello,
>
> I am using the Pyramid framework and trying to get a simple applet to
> appear in the browser using a .mako template.
>
> The code I have is very straightforward:
>
> <applet CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
> </applet>
>
> But it always gives me a ClassNotFoundException even though I have tried
> putting the files everywhere and using all kinds of different path names.
>
> When I use this html document as a .html and just open using a browser the
> java applet works perfectly fine, its only when I am using the Pyramid
> framework that it fails.  Is there something special I need to do if anyone
> has tried this before and succeeded?
>
> Thanks!
>

You need to serve the applet as a static asset so the webserver you are
using knows where to find it:

http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/assets.html#serving-static-assets
http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/pylons/static.html


So this might looking something like:

<applet CODE="${request.static_url('myapp:static/HelloWorld.class')}"
WIDTH=150 HEIGHT=25></applet>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to