如何加载从Django模板Java小程序 [英] How to load java applet from django template
问题描述
我的小程序运行文件时,我把它从静态applet.html文件,如:
My applet runs file when I call it from a static applet.html file, like this:
<applet archive="applet.jar" code="com.xxx.yyy.PApplet"
width="100" height="20"></applet>
但我怎么把一个Django模板在同一行?我应该在哪里把.jar和.java文件?我也注意到,其附加的.class到PApplet,同时寻找文件,并送我一个404错误。
But how do I put the same line in a django template? And where should I put the .jar and .java files? I also noticed that it appends .class to the PApplet while looking for the file and sends me a 404 error.
我试着谷歌上搜索,看着文档,但无法找到这个问题之前的任何地方解决。感谢你的帮助。
I tried googling and looked into documentation, but couldn't find this issue addressed anywhere before. Thanks for your help.
推荐答案
您应该用你的jar文件像通过图像OU CSS文件的 MEDIA_URL
You should use your jar file as a static media file like an image ou CSS file via MEDIA_URL.
在媒体目录将applet.jar,然后用
Put applet.jar in the media directory, then use
<applet archive="{{ MEDIA_URL }}applet.jar" code="com.xxx.yyy.PApplet"
width="100" height="20"></applet>
这篇关于如何加载从Django模板Java小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!