Heim  >  Fragen und Antworten  >  Hauptteil

Erstellen Sie eine Anmeldeseite mit MySQL, Java, HTML und CSS

<p>Ich habe eine Tabelle mit den Anmeldedaten erstellt und ein Programm in Java geschrieben, um die Informationen zu verarbeiten, weiß aber nicht, wie ich die HTML-Frontend-Datei mit der Java-Datei verknüpfen soll. </p>
P粉244730625P粉244730625413 Tage vor585

Antworte allen(1)Ich werde antworten

  • P粉593649715

    P粉5936497152023-09-02 12:05:27

    你使用Spring吗?Spring Boot?JavaEE? 我建议使用Spring Boot。

    Spring Boot会自动添加位于以下任何目录中的静态网页资源:

    /META-INF/resources/
    /resources/
    /static/
    /public/

    所以你可以在resources/目录下创建一个public/目录,并将静态内容放在那里。然后可以通过http://localhost:3000/koo.htm访问它们。(假设server.port是3000)

    你可以在application.properties中使用spring.resources.static-locations来自定义这些目录。

    你可以继续阅读:https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot

    Antwort
    0
  • StornierenAntwort