简体   繁体   中英

Applet in jsp page (Eclipse)

I'm trying to embed an applet into a very simple project in Eclipse, with Spring and Hibernate. 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?

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.

    <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. 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). Did not help either.

This is my project structure now:

Eclipse项目结构

The applet will be in 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.

I would maybe start by creating a static html (not jsp) file that displays your applet. When you get that working, then you can work on creating the html via jsp.

I think your META-INF folder should not be in the WebContent folder, but directly under MedCase. I'm not 100% sure, but I just looked at my own project, and that's the first difference I noticed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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