简体   繁体   English

jsp页面中的Applet(Eclipse)

[英]Applet in jsp page (Eclipse)

I'm trying to embed an applet into a very simple project in Eclipse, with Spring and Hibernate. 我正在尝试使用Spring和Hibernate将小程序嵌入Eclipse中的一个非常简单的项目中。 After nearly 5 hours of reading and trying I have to ask a stupid question, because I just don't understand: where am I supposed to place .class file and the .jsp? 经过近5个小时的阅读和尝试,我不得不问一个愚蠢的问题,因为我只是不明白:我应该将.class文件和.jsp放在哪里?

I'm getting the java.lang.ClassNotFoundException error all the time, no matter what is written in the code="" and where I place .class files. 无论在code=""写什么以及放置.class文件的位置如何,我一直都在收到java.lang.ClassNotFoundException错误。

    <APPLET 
        code="Soms.class"
        codebase="../../app-som"
        width=400 
        height=520>

        <PARAM name="sizex" value="RGB">
        <PARAM name="sizey" value="BW">
    </APPLET>

I've read that WEB-INF can't be accessed by the applet, and that I have to create a folder somewhere else. 我已经阅读到小程序无法访问WEB-INF,并且必须在其他地方创建一个文件夹。 Also, having in mind this (at the bottom of the page) I've tried to create a folder in /src and putting there the .jsp and .class (in subfolders). 另外,考虑到这一点 (在页面底部),我试图在/ src中创建一个文件夹,并将.jsp和.class放置在子文件夹中。 Did not help either. 也没有帮助。

This is my project structure now: 现在这是我的项目结构:

Eclipse项目结构

The applet will be in HistDetails.jsp 小程序将在HistDetails.jsp中

Thanks in advance. 提前致谢。

You need to separate the two. 您需要将两者分开。 Your server-side JSP simply creates the client-side html, which then displays the applet. 您的服务器端JSP只需创建客户端html,然后显示该applet。

I would maybe start by creating a static html (not jsp) file that displays your applet. 我可能首先创建一个显示您的applet的静态html(不是jsp)文件。 When you get that working, then you can work on creating the html via jsp. 当您开始工作时,便可以通过jsp创建html。

I think your META-INF folder should not be in the WebContent folder, but directly under MedCase. 我认为您的META-INF文件夹不应位于WebContent文件夹中,而应直接位于MedCase下。 I'm not 100% sure, but I just looked at my own project, and that's the first difference I noticed 我不确定100%,但是我只是看了自己的项目,这是我注意到的第一个区别

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM