原创 struts.xml配置,三種調用方法的配置

1.使用method屬性調用方法          <!-- 註冊請求 -->          <action name="register" class="com.house.action.UserAction" method="do

原创 動態結果配置:struts.xml中,屬性的type配置之redirectAction(請求重定向到指定的Action)

  實例:     struts.xml的配置     <!-- 開啓動態方法,value改爲true -->     <constant name="struts.enable.DynamicMethodInvocation" val

原创 windows環境下,tomcat部署、eclipse啓動實現war包讀取外部動態配置文件

 一、需求      爲了使項目配置不受生產、測試、開發環境的影響,且更加可視化可維護配置文件,web項目的配置文件需要根據不同環境配置動態變更,不能直接寫死在war中,就需要我們實現war包可以讀取外部的配置文件。  二、準備   wi

原创 導入Eclipse後,jsp中java代碼報錯

參考:https://blog.csdn.net/qq_42862882/article/details/86798890  

原创 Eclipse中新建package包但是顯示文件夾的解決辦法

右鍵工程,Build Path--Configure Build Path,設置Source下的Source folders下面的Include:(All) 和 Exinclude(None)就行了。  

原创 MyBatis generator生成的Example文件用法

參考博文:https://blog.csdn.net/m0_37795198/article/details/78848045 MyBatis generator用數據庫表生成數據代碼的時候,除了生成實體的POJO以外,會同時生成Exam

原创 Eclipse線上環境調試線下代碼

第一步:打開類,打上斷點第二步:ant----Dubug Configurations...第四步:雙擊Remote Java Application第五步:Apply------>Debug

原创 序列化與反序列化

1.序列化的概念:     序列化就是將對象的狀態存儲到特定的存儲介質中的過程,也就是將對象的狀態轉換爲可保持或傳輸格式的過程.在序列化的過程中,會將對象的公有成員/私有成員包括類名,轉換爲字節流,然後再

原创 spring中配置dubbo,出現:can be found for element 'dubbo:application'解決辦法

錯誤描述: The matching wildcard is strict, but no declaration can be found for element 'dubbo:application' 錯誤現象: 解決辦法: 1.在

原创 枚舉enum概念

枚舉是由一組固定常量組成的類型. 使用枚舉的好處:類型安全,易於輸入 枚舉可作爲switch()的形參 枚舉舉例: //定義枚舉 public enum Unit { U1,U2,U3    } /*************

原创 struts2在Action中接收參數的三種方式

struts2在Action中接收參數的三種方式:       1.屬性方式接收參數:            新建一個包com.***.action,新建一個類****Action.            在Action中定義屬性,並設

原创 雙色球的數組實現和集合實現

雙色球的數組實現: import java.util.Random; public class ShuangSeQiu { public static void main(String[] args) { Random ra

原创 對集合集合排序CompareTo(),sort()與查找

類要實現Comparable接口. //商品類 public class Goods implements Comparable{ private int id;//商品編號 private String name;//商品名字 p

原创 Struts2的配置

第一步:下載並部署jar包     (第一種方法:新建一個web project-->右鍵項目-->Build Path-->Add Libraries-->User Library-->User Libraries-->new-->填寫

原创 動態結果配置:struts.xml中,<result>屬性的type配置之redirectAction(請求重定向到指定的Action)

  實例:     struts.xml的配置     <!-- 開啓動態方法,value改爲true -->     <constant name="struts.enable.DynamicMethodInvocation" val