IntelliJ Idea Java 项目与 Flex,如何嵌入生成的 SWF

发布于 2024-12-02 03:18:47 字数 316 浏览 0 评论 0原文

抱歉这个可能很愚蠢的问题,我是 Java 新手。 我有一个简单的 IntelliJ Java 项目,支持 Flex。该项目包含index.jsp页面。构建项目后,.swf 被放置在 WEB-INF/classes 文件夹中。

生成的工件的目录结构是:

index.jsp
Web-inf
  web.xml
  classes
    main.swf

你能帮我一下,如何将main.swf 嵌入到index.jsp 中吗?如果简单地说 - 我如何访问位于 WEB-INF/classes 文件夹中的文件?

Sorry for the potentially stupid question, I'm newbie in Java.
I have a simple IntelliJ Java project with Flex support. The project contains index.jsp page. And after building of the project, the .swf is placed in the WEB-INF/classes folder.

The directory stucture of the generated artifact is:

index.jsp
Web-inf
  web.xml
  classes
    main.swf

Could you help me please, how to embed main.swf into the index.jsp? If simply - how could I access the file located in the WEB-INF/classes folder?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

下雨或天晴 2024-12-09 03:18:47

为了补充 Constantiner 的评论,无论使用哪种 IDE,您都可以将您的项目设置为使用此约定:

/web
    /flex - Where your Main.swf goes and anything it it needs (i.e. css, jpgs, mp3s, misc assets
    /META-INF - Where your context.xml goes, not accessible to clients
    /WEB-INF
        /classes - The directory where all your pre-compiled java .class files goes
        /flex - Where blazeDS xml config files go
        /lib - Where your java shared libraries go (i.e. jar's
        web.xml - Where you set up your container's listeners and servlet mappings
    index.jsp - Your .jsp will have access to /flex stuff... You could of course promote the contents of /flex to be directly under /web
    index.html - Hello World

To supplement Constantiner's comment, regardless of the IDE, you can set up your project to use this convention:

/web
    /flex - Where your Main.swf goes and anything it it needs (i.e. css, jpgs, mp3s, misc assets
    /META-INF - Where your context.xml goes, not accessible to clients
    /WEB-INF
        /classes - The directory where all your pre-compiled java .class files goes
        /flex - Where blazeDS xml config files go
        /lib - Where your java shared libraries go (i.e. jar's
        web.xml - Where you set up your container's listeners and servlet mappings
    index.jsp - Your .jsp will have access to /flex stuff... You could of course promote the contents of /flex to be directly under /web
    index.html - Hello World
指尖上的星空 2024-12-09 03:18:47

要将 SWF 文件嵌入任何网页(包括从 JSP 文件生成的网页),有以下几种选择:

1) 使用嵌入 HTML 标记,如下所示:

<embed src="classes/main.swf" quality="high" 
    width="500" height="250" name="Sample" align="middle"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>

YouTube 等网站使用这种方法来简化嵌入。

2) 使用 JavaScript 库,例如 SWFObject。 Flex 框架中的默认 HTML 模板使用此模板。基本上,这是一种确定正在显示哪个浏览器并选择嵌入 SWF 的最佳方式的奇特方法。

To embed a SWF file inside any web page--including one generated from a JSP file--there are a few options:

1) Use the embed HTML tag, something like this:

<embed src="classes/main.swf" quality="high" 
    width="500" height="250" name="Sample" align="middle"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
    pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>

Sites like YouTube use this approach to make embedding easy.

2) Use a JavaScript library like SWFObject. The default HTML Templates in the Flex Framework use this. It is, basically, a fancy way to figure out which browser is being displayed and choose the best way to embed the SWF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文