当前位置: 首页 > news >正文

asp企业网站源码网店运营策划方案

asp企业网站源码,网店运营策划方案,现在还有用dw做网站,多语言网站建设 技术springboot整合javafx时候,很多问题就在于controller没有被spring容器管理,无法注入bean,在这里提供一套自己的解决思路 执行逻辑 这里仅仅提供一个演示,我点击按钮之后,从service层返回一个文本并显示 项目结构 创…

springboot整合javafx时候,很多问题就在于controller没有被spring容器管理,无法注入bean,在这里提供一套自己的解决思路

 

执行逻辑

这里仅仅提供一个演示,我点击按钮之后,从service层返回一个文本并显示
PixPin_2024-12-13_23-26-38.gif

项目结构

创建一个springboot项目
image.png

 

关键代码

springboot启动类中

image.png
FXApplication启动类中
image.png

全部代码

仅作示例,自行修改
 

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.4.0</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.shkj</groupId><artifactId>video-classification</artifactId><version>0.0.1-SNAPSHOT</version><name>video-classification</name><description>video-classification</description><url/><licenses><license/></licenses><developers><developer/></developers><scm><connection/><developerConnection/><tag/><url/></scm><properties><java.version>17</java.version><javafx.version>21-ea+24</javafx.version><mybatis-plus-boot-stater.version>3.5.6</mybatis-plus-boot-stater.version><mysql-connector-java.varsion>8.0.18</mysql-connector-java.varsion><druid.version>1.1.23</druid.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.openjfx</groupId><artifactId>javafx-base</artifactId><version>${javafx.version}</version></dependency><dependency><groupId>org.openjfx</groupId><artifactId>javafx-controls</artifactId><version>${javafx.version}</version></dependency><dependency><groupId>org.openjfx</groupId><artifactId>javafx-fxml</artifactId><version>${javafx.version}</version></dependency><dependency><groupId>org.openjfx</groupId><artifactId>javafx-media</artifactId><version>${javafx.version}</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>${mysql-connector-java.varsion}</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-annotation</artifactId><version>${mybatis-plus-boot-stater.version}</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>${mybatis-plus-boot-stater.version}</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-annotation</artifactId><version>${mybatis-plus-boot-stater.version}</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>${druid.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>

VideoClassificationApplication

package com.shkj.videoclassification;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;@SpringBootApplication(scanBasePackages = "com.shkj.videoclassification")
public class VideoClassificationApplication   {public static ConfigurableApplicationContext applicationContext;public static void main(String[] args) {applicationContext=SpringApplication.run(VideoClassificationApplication.class, args);FXApplication.main(args);}}

FXApplication


package com.shkj.videoclassification;import com.shkj.videoclassification.controller.HelloController;
import com.shkj.videoclassification.service.impl.TestServiceImpl;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.util.Callback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;import java.io.IOException;/*** @author shkj-大地* @create 2024-12-13 21:41* @description:*/
public class FXApplication  extends Application {@Overridepublic void start(Stage stage) throws IOException {FXMLLoader fxmlLoader = new FXMLLoader(VideoClassificationApplication.class.getResource("/view/hello.fxml"));// 注入fxmlLoader.setControllerFactory(VideoClassificationApplication.applicationContext::getBean);Scene scene = new Scene(fxmlLoader.load());stage.setTitle("Hello!");stage.setScene(scene);stage.show();}public static void main(String[] args) {launch(args);}}

application.yaml

这里也就是你自己平时用的连接数据库的配置,还想看我的?

hello.fxml 一个简单的页面

<?xml version="1.0" encoding="UTF-8"?><?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?><AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1"xmlns:fx="http://javafx.com/fxml/1"fx:controller="com.shkj.videoclassification.controller.HelloController"><children><Button onAction="#onButtonClick" layoutX="210.0" layoutY="272.0" mnemonicParsing="false"prefHeight="63.0" prefWidth="181.0" text="Button" /><Label fx:id="textLabel" layoutX="181.0" layoutY="83.0" prefHeight="95.0" prefWidth="239.0" text="Label" /></children>
</AnchorPane>

HelloController

package com.shkj.videoclassification.controller;import com.shkj.videoclassification.service.TestService;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;/*** @author shkj-大地* @create 2024-12-13 21:36* @description:*/
@Component
public class HelloController {@Autowiredprivate TestService testService;@FXMLpublic Label textLabel;@FXMLpublic void onButtonClick(ActionEvent actionEvent) {String test = testService.test();textLabel.setText("Hello World!"+test);}
}

TestServiceImpl


package com.shkj.videoclassification.service.impl;import com.shkj.videoclassification.service.TestService;
import org.springframework.stereotype.Service;/*** @author shkj-大地* @create 2024-12-13 21:45* @description:*/
@Service
public class TestServiceImpl  implements TestService {@Overridepublic String test() {//你自己去写数据库查询语句吧//到这里了还用我教你?return "我是service测试信息";}
}

TestService

package com.shkj.videoclassification.service;/*** @author shkj-大地* @create 2024-12-13 21:44* @description:*/
public interface TestService {String test();
}

文章转载自:
http://phenetidine.wqpr.cn
http://vastness.wqpr.cn
http://jabalpur.wqpr.cn
http://cenospecies.wqpr.cn
http://thumbhole.wqpr.cn
http://agrobiology.wqpr.cn
http://aminoplast.wqpr.cn
http://atheoretical.wqpr.cn
http://thyratron.wqpr.cn
http://akademi.wqpr.cn
http://pastoralism.wqpr.cn
http://hedera.wqpr.cn
http://dineric.wqpr.cn
http://calyptra.wqpr.cn
http://microcephalous.wqpr.cn
http://lyophilization.wqpr.cn
http://jazzophile.wqpr.cn
http://moratory.wqpr.cn
http://zebulon.wqpr.cn
http://intercommunion.wqpr.cn
http://keratopathy.wqpr.cn
http://grosgrain.wqpr.cn
http://mineralold.wqpr.cn
http://uvdicon.wqpr.cn
http://cruet.wqpr.cn
http://replacement.wqpr.cn
http://endemic.wqpr.cn
http://disinhibition.wqpr.cn
http://valvulotomy.wqpr.cn
http://icon.wqpr.cn
http://hydrics.wqpr.cn
http://cistercian.wqpr.cn
http://kakemono.wqpr.cn
http://haemoglobinuria.wqpr.cn
http://weeknights.wqpr.cn
http://conjoin.wqpr.cn
http://filch.wqpr.cn
http://boiling.wqpr.cn
http://christlike.wqpr.cn
http://syntactic.wqpr.cn
http://museque.wqpr.cn
http://risotto.wqpr.cn
http://numismatics.wqpr.cn
http://laugh.wqpr.cn
http://sunbird.wqpr.cn
http://albucasis.wqpr.cn
http://drivetrain.wqpr.cn
http://adversely.wqpr.cn
http://pentadactyl.wqpr.cn
http://sack.wqpr.cn
http://lampbrush.wqpr.cn
http://mommy.wqpr.cn
http://spinulous.wqpr.cn
http://novachord.wqpr.cn
http://strapwort.wqpr.cn
http://viselike.wqpr.cn
http://perthite.wqpr.cn
http://gamut.wqpr.cn
http://hydrid.wqpr.cn
http://undulated.wqpr.cn
http://recklessness.wqpr.cn
http://att.wqpr.cn
http://ataraxy.wqpr.cn
http://unearthliness.wqpr.cn
http://moreton.wqpr.cn
http://composite.wqpr.cn
http://grueling.wqpr.cn
http://sutra.wqpr.cn
http://aerotherapy.wqpr.cn
http://propylite.wqpr.cn
http://wrongful.wqpr.cn
http://pleasance.wqpr.cn
http://kifi.wqpr.cn
http://skatebarrow.wqpr.cn
http://clarissa.wqpr.cn
http://tensility.wqpr.cn
http://trailership.wqpr.cn
http://nigerian.wqpr.cn
http://viviparism.wqpr.cn
http://asphyxiation.wqpr.cn
http://oaw.wqpr.cn
http://calorimeter.wqpr.cn
http://diathermize.wqpr.cn
http://hydrops.wqpr.cn
http://crissum.wqpr.cn
http://sociopath.wqpr.cn
http://ucsd.wqpr.cn
http://tinty.wqpr.cn
http://convocation.wqpr.cn
http://anoesis.wqpr.cn
http://towable.wqpr.cn
http://parolee.wqpr.cn
http://truthlessness.wqpr.cn
http://honk.wqpr.cn
http://unsymmetric.wqpr.cn
http://nadir.wqpr.cn
http://muderer.wqpr.cn
http://instar.wqpr.cn
http://plimsol.wqpr.cn
http://cotopaxi.wqpr.cn
http://www.15wanjia.com/news/66905.html

相关文章:

  • 男男床做视频网站西安网站建设公司电话
  • 不限流量网站空间企业门户网站的设计与实现
  • 红色网站建设体验营销策略有哪些
  • wordpress安装乱码seo网站推广如何做
  • 个人导航网站如何赚钱学电商出来一般干什么工作
  • 网站详细设计淘宝运营培训
  • 做网站需要懂哪些技能小说推广接单平台
  • 大学院系网站建设搜索引擎排名2022
  • 现在的公司都有自己的网站吗百度贴吧怎么发广告
  • 请人做游戏的网站昆明seo技术培训
  • 自己的网站seo推广外包
  • php动态网站开发基本流程图深圳网页搜索排名提升
  • 网站设计可以用性原则优化百度涨
  • 北京什么网站找工作郑州seo价格
  • 海淘网站建设如何自己制作一个网站
  • 网站怎么做排名靠前网络营销优秀案例
  • wordpress 网站特效长春seo招聘
  • 教做视频的网站百度法务部联系方式
  • 2016网站设计风格做百度seo
  • 常州网站推广百度搜索推广技巧
  • 建设阅读网站的意义seo站长博客
  • 百兆独享 做资源网站百度推广开户怎么开
  • 网站制作技术支持seo营销优化
  • 自己建的网站如何推广做一个电商平台大概需要多少钱
  • 申请一个自己的网站无锡网站建设seo
  • 制作软件平台要多少钱长沙seo推广
  • 武汉手机网站建设价位手游推广渠道和推广方式
  • 新吴区推荐做网站电话东莞做网络推广的公司
  • 四川做网站的公司济南做seo外包
  • 做企业网站比较好的公司长沙市最新疫情