亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? Java Java??? ??? ?? Java ??? ??: Spring ????? ??

?? Java ??? ??: Spring ????? ??

Nov 09, 2019 pm 03:05 PM
java

?? Java ??? ??: Spring ????? ??

1. SpringMVC? ??? ??????

???? ??? ??? ??? springMVC ????? ???? DispatchServlet? ?? ??? ?????.

DispatcherServle? ?? URL? ?? ???? ?? ??? ???(URL)? ?? ?? ?? ???? HandlerMapping? ?????. ??? ???? HandlerExcutionChain? ???? URL???.

DispatchServlet? ??? Handler? ???? ??? ??? HandlerAdapter ???? ?????.

Handler? ??? ??? ??? ? ModelAndView ??? DisPatchServlet? ?????. DispatcherSevlet? ViewResolver? ?????. ??? ???? ??? ?? ?? ?? ????? ???.

DispatcherServle? ??? ?? ModelAndView()? ????? ?? ???? ????? ?? ?? ???? ?????.

?? Java ??? ??: Spring ????? ??

2. SpringMVC?? ????? ???? ??? ??????

@RequestMapping? URL ??? ???? ? ?????.

@RequestBody ??? http ??? json ???? ???? json ???? Java ??? ???? ??? ?????.

@ResponseBody ??? ???? ????? ??? ??? ??? ?? json ???? ???? ?? ?????.

3. ?? ???? ? ???? ????? ??? ??????

?? ??????? ????? springmvc.xml?? ?? ????? ???? ?? ???.

4. get ? post? ??? ??? ???? ??? ??????

??? ??? ??? ????? web.xml?? CharacterEncodingFilter ??? ??? ? ????. utf-8? ??????. get ??? ??? ??? ????? ? ?? ??? ????. get ??? ??? ??? ????? ?? ? ?? ???? ????.

Tomcat ?? ??? ???? ????? ???? ????? ???? ?????.

????? ?? ????? ? ?? ??? String userName = new String(request.getParameter("userName").getBytes("ISO8859-1"), "utf-8");

5???. Spring? ?? ? ?? ?????

Spring? ??????? ?????? ??? ????? ?? ???? ?? ?? ????????. Spring? ??? EJB?? ??? ? ??? ??? ???? ?? ??? JavaBeans? ???? ? ????. Spring? IOC ? AOP ???? ????????.

Spring ????? ?? ??? ??? ????.

?? ??(IOC) ?? Java ?? ????? ??? ??? ? new ?? getInstance? ???? ???? ?? ?? ????? ?????. ??. Spring ?? ????? Spring ????? ??? ??? ???? ?? Factory ??? ?????, ?? ??? ?? ??? ??? ????. ???.

??? ??(DI), Spring? JavaBean ??? set ??? ?? ????? ?? ???? ???? ?? ??? ??? ? ?? ??? ?? ??? ?? ???? ?? ????? ?? ???????.

AOP(?? ?? ?????)? ?? ?? ?????(oop) ?????? ??? ???? ??? ??? ?????. ?? ?? ???????? ? ??? ?? ??? ??? ???? ?? ???? ? ??? ?? ?? ??, ???? ??, ?? ?? ?? ? ?? ???? ??? ?????. ??? ?? ??? ???????. ?????. AOP? ??? ???? ?? ??????. ?????? JDK ?? ???? ???? ?? ???? CGLIB? ???? ?? ???? ???? ??

6.

?? ??? ?? - Spring? ? ?? ??? ??? ?? ??? ?? ?????? ???? ?? Spring? jdk? java.lang.reflect.Proxy ??? ???? ?????. ?? ??? ?????? ???? ??? Spring? CGLIB ?????? ???? ?? ???? ?? ???? ?????. ??? ?? - ??? ?? ???? Bean? ??? ??? ????? ?????.

??? ?? - ?? ?? ??? ???? ? ?????. ?: RestTemplate, JmsTemplate, JpaTemplate

??? ?? ???? ?? - ???? ??? ???? ?? ??? ?? ???? DispatherServlet? ?????.

? ??? - Spring? ??? ??? ?? ???? ? ??? ?? ??? JSP ??? ???? ???? ?????.

??? ?? - BeanFactory/AplacationContext ?????? ?? ???? ?? ?????.

??? ?? - ??? ????? ?? ?? ? ?? ??? ?????? ???? ??, ??? ?????? ???? ?? ??? ??? ?????. BeanFactory? Spring?? ??? ????? ???? ? ?????.

7.Spring?? ?? ???? ????

Spring? ?? 2.5 ?? ??? ??? ???? ?? ??? ???? ??????. ??? XML? Bean ??? ???? ? ??? ? ????. ?? ??? XML ?? ?? ????? ?? ????? ??? ??? ??? ?? ??? ?? ??? ?????.

??? ?? ????? ????? ?? ????. ??? ?? ?? ???? ??? ????? ??? ?? ?? ???? ?? ???? ???. ?? ??? ??? ????.

????? ???? ??:

@??: ? ??? ? ?? ??? ?????.

@Autowired: ? ??? ?? ?? setter ???, non-setter ???, ??? ? ??? ?????.

@Qualifier: ? ??? @Autowired? ?? ???? ?? Bean? ?? ?? ???? ?????.

8.??? ??? ??????? ??? ??????

? ?? : ?????? ????? ????.

Bean ???: ????? ???? ? ??? ????. ?? ??? init-method ??? ???? ?????. org.springframework.beans.factory.InitializingBean ?????? ?????.

Bean ??: Bean ????? ??? ???? ? ?? ??? ????.

Bean ??: ???? ???? ? ??? ????. ?? ??? ??? destroy-method ??? ?????. org.springframework.bean.factory.DisposeableBean? ?????.

9. Spring ?? ?????? ???????

?? ????: Core, Beans, Context ? EL ??? ?????. ?? ??: ??? ???, ?? ?? ? ?? ???? ?? ???? ???? ????? ???? ?? ?? ?? ??? ??????.

Beans ??: ?? ?? ? ??? ??? ???? ?????? ?? ??? ?????. ?? BeanFactory? ????? ?????. ?? ????? "?? ??? ??"? ???? "?? ??? ??? ??"? ???? ?? ?????? ???? ????. ?? ???? ????? ??? ?????? ?? ??? ?????. ?? ?? ?????? ?? ?? ?????; ?? ?????? ??? ?? ?? ??? ???? ???? ?? ???? ?? ?? ???? ??? ???? ?????? ?? ?????. ??? ?? ???? BeanFactory? ?? ?????.

???? ??: Core ? Beans? ???? Beans ?? ??? ???? ??? ???, ??? ??, ???, JavaEE ??, ???? ?? ??, ??? ?? ?? ?????. ?? ?????? ApplicationContext???.

EL ??: ??? ?? ?? ??? ????, ?? ?, ??? ??? ?? ??? ? ??? ????, ??, ???? ? ???, ??? ??? ?? ??? ? ??? ????, ?? ? ?? ??? ????, Spring ?????? Bean ????? ?????. ?? ??, ??, ?? ?? ?? ?? ?????.

AOP, Aspect ??: AOP ??: Spring AOP ??? AOPAlliance ??? ???? Aspect ?? ????? ??? ???? ??, ?? ??, ?? ??, ???? ?? ?? ?? ?? ?? ??? ???? ??? ??? ??? ???? ??? ??? ???? ???? ? ??? ?? ??? ???? ???? ??? ?? ?? ?? ??? ????.

Aspects ??: SpringASP?? ? ??? ??? ???? AspectJ ??? ?????. ??? ???/?? ??: ? ???? JDBC, ORM, OXM, JMS ? ???? ??? ?????.

???? ??: ? ??? Spring ?? ????? ?????. Spring ?? ????? ??? ?? ? ????. ???? ????? ??? ??? ??? ????? ? ??? ???? ??? ?????. .

JDBC ??: JBDC ?? ???? ?????. ??? ???? ???? ??? ? JDBC ??? ??? ???? ??? ??? ? ??? Spring ???? ??? ??? ?? ? ????.

ORM ??: Hibernate, JPA, MyBatis ?? ???? ?? ???? "?? ???" ?? ??????? ??? ??? ?????. ??? ???? ???? ?? ?? Spring ???? ??? ??? ? ????.

OXM ??: Java ??? XML ???? ????? XML ???? Java ??? ???? ??/XML ?? ??? ?????. ??/XML ?? ???? JAXB, Castor, XMLBeans ? XStream? ?????.

JMS ??: JMS(Java Messaging Service)? ???? JMS? ?? ?? ????? ? ??? "??? ???, ??? ???" ??? ??? ?????. JMS? ? ?????? ?? ?? ??? ?? ???? ??? ??? ?? ???? ????. ?/?? ??: ?/?? ???? ?, ? ???, ? ???? ? ? ??? ??? ?????.

? ??: ?? ? ??? ?????. ?? ??, ?? ?? ???, ?? IoC ????, ?? ???? ???(RMI, Hessian, Burlap) ? WebService ??, RestTemplate ???? ???? ??? Restfulservices ???? ?????.

Web-Servlet ??: SpringMVCWeb ????? ??? ?????. SpringMVC ?????? ?? ?? ?? ??? ??, ? ??? ??? ???, ??? ?? ?? ????, ?? Spring ??? ???? ???? ???? ???? ?? ?? JSP ?? ??? ?????.

Web-Struts ??: Struts1.x ? Struts2.x ?? ??? ???? ??? ??? ?????. Spring? Junit ? TestNG ??? ?????? ???? ? ????? ???? ?? ? ?? ?? Spring ?? ??? ??? ?????. HTTP ??? ??? ????????.

?? Java ??? ??: Spring ????? ??

10. ?? ???? ?? ??? ? ? ?????

Spring? ?? ??? ???? ?? ?? ???? ???? ???? ? ??? ? ? ????.

Spring? ?? ??? ???? ?? ?? ???? ???? ????? ?? ???.

Spring ?? ?? ?????? ???? ?? ?? ??, ?? ?? ? ?? ??? ??? ? ????.

Spring ?? ?? ?????? ????? ??? ?? ?? ???? ? ?? ??? ??? ? ??? ?? ??? ?? ??? ??? ??? ????. ?? ??? ???? ??? ??? ???.

Spring? ???? ?????? ????? ?? ?? ??? ? ????.

Spring? ???? ??? ?? SQL? ????? ?? ??, ?? ??? ??? Spring?? ?????.

Spring? ?? ?? ?????? ??? ?????(?: Hibernate, JPA)? ???? ??? ? ??? ?????? ???? ???? ?? JDBC ??? ??? ??? ?????.

Spring? ?? ?(?: Struts, JSF) ??????? ???? ??? ? ??? ? ?? ??? ???? ?? ?? SpringMVC ????? ??? ?????.

Spring? JavaEE(?: JavaMail, ?? ??) ? ?? ??(?: ?? ?????)? ?? ??? ? ????.

11. ?? ?? ??? ???.

??? ???? ?? ??: ?? ?? ???? ?? Spring ?? ???? ??? ???? ??? ?????. ??? ??? ???? ??? ??? ????? ???? ???? ????. ?? ???? ?? ??? ????? ?? ???? ??? ??? ???? ????. ???? ??? ????? ?????. ????? ?? ??? ???? ???? ?? ??? ????? ?? ?? ????? ????? ?? ?? ?? ??? ?? ?????.

TransactionInterceptor? ???? ? ??? ???? ??: ? ?? ?? ??: ???? ???? ???? ?? ???? ?? ??? ???? ? ???? transactionManager, ?? ??? Properties ??? transactionAttributes ?????. ? ??? ?? ??? ??? ????, ??? ??? ?????? ??? ? ???, ?? ?? ????? ???? ???? ??? ?????.

<beans>
    ......
    <bean id="transactionInterceptor"
          class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transactionAttributes">
            <props>
                <prop key="transfer">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>
    <bean id="bankServiceTarget"
          class="footmark.spring.core.tx.declare.origin.BankServiceImpl">
        <property name="bankDao" ref="bankDao"/>
    </bean>
    <bean id="bankService"
          class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="target" ref="bankServiceTarget"/>
        <property name="interceptorNames">
            <list>
                <idref bean="transactionInterceptor"/>
            </list>
        </property>
    </bean>
</beans>

TransactionProxyFactoryBean? ???? ? ??? ???? ??: ?? ?? ??? ???? ?? ???????. ??? ??? ??? ?? ?? ?? ??? Spring? ???? ??? ???? ???? ????.

<beans>
    ......
    <bean id="bankServiceTarget"
          class="footmark.spring.core.tx.declare.classic.BankServiceImpl">
        <property name="bankDao" ref="bankDao"/>
    </bean>
    <bean id="bankService"
          class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="target" ref="bankServiceTarget"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transactionAttributes">
            <props>
                <prop key="transfer">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>
</beans>

?????? ??? ??? ???? ??: ?? ? ?? ??? Spring 2? ???? ???.

<beans>
    ......
    <bean id="bankService"
          class="footmark.spring.core.tx.declare.namespace.BankServiceImpl">
        <property name="bankDao" ref="bankDao"/>
    </bean>
    <tx:advice id="bankAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="transfer" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>
    <aop:config>
        <aop:pointcut id="bankPointcut" expression="execution(* *.transfer(..))"/>
        <aop:advisor advice-ref="bankAdvice" pointcut-ref="bankPointcut"/>
    </aop:config>
    ......
</beans>

@Transactional? ???? ? ??? ???? ??: Spring 2.x?? @Transactional ??? ?? ???? Annotation ?? ?? ??? ???????. @Transactional? ?????, ????? ???, ??? ? ??? ???? ??? ? ????. ??? ???? ???? ???? ?? ?? ???? ?? ??? ???? ??? ?? ???.

@Transactional(propagation = Propagation.REQUIRED)
public boolean transfer(Long fromId, Long toId, double amount) {
    return bankDao.transfer(fromId, toId, amount);
}

????? ???? ??? ??: ???? beginTransaction(), commit(), Rollback() ? ?? ???? ?? ?? ???? ????? ???? ?? ????? ???? ?????. Spring? ????? ??? ?? ???? ?? API? ???? ? ????? ?? ??? TransactionTemplate? ???? ? ????? ??? ???? ???? ? ?? ??? ????.

?? API? ???? ? ????? ?? ??: Credentials PlatformTransactionManager, TransactionDefinition ? TransactionStatus ? ?? ?? ?????? ?? ????? ?? ???? ??? ?????.

public class BankServiceImpl implements BankService {
    private BanckDao bankDao;
    private TransactionDefinition txDefinition;
    private PlatformTransactionManager txManager;

    public boolean transfer(Long fromId, Long toId, double amount) {
        TransactionStatus txStatus = txManager.getTransaction(txDefinition);
        boolean result = false;
        try {
            result = bankDao.transfer(fromId, toId, amount);
            txManager.commit(txStatus);
        } catch (Exception e) {
            result = false;
            txManager.rollback(txStatus);
            System.out.println("Transfer Error!");
        }
        return result;
    }
}

TransactionTemplate? ???? ? ????? ??? ???? ??: ??? ?? ??? ????? ?? ?? ???? ??, ?? ? ??? ?? ??? ??? ??? ???? ??? ??? ?? Spring? transactionTemplate ???? ?????. ????? ??? ???? ??? ?????.

public class BankServiceImpl implements BankService {
    private BankDao bankDao;
    private TransactionTemplate transactionTemplate;

    public boolean transfer(final Long fromId, final Long toId, final double amount) {
        return (Boolean) transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                Object result;
                try {
                    result = bankDao.transfer(fromId, toId, amount);
                } catch (Exception e) {
                    status.setRollbackOnly();
                    result = false;
                    System.out.println("Transfer Error!");
                }
                return result;
            }
        });
    }
}

????? ????? ??? ????? ???:

????? ????? ???? ?? ???? ?? ??? ?? ???? ????.

??? ????? ?? ??? ???? ????? ??????? ?????.

? ??? ?? Java ??? ??: Spring ????? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
???
vscode settings.json ?? vscode settings.json ?? Aug 01, 2025 am 06:12 AM

settings.json ??? ??? ?? ?? ?? ?? ?? ??? ??? VSCODE ??? ??? ???? ? ?????. 1. ??? ?? ?? : Windows? C : \ Users \\ AppData \ Roaming \ Code \ User \ Settings.json, MacOS IS /users//library/applicationsupport/code/user/settings.json, linux? /home//.config/code/user/settings.json; 2. Workspace ?? ?? : .vscode/settings project root ????

JDBC? Java? ??? ???? ??? ?????? JDBC? Java? ??? ???? ??? ?????? Aug 02, 2025 pm 12:29 PM

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

???? ??? ?? Java? ??? ?? ??? ? ???? ??? ?? Java? ??? ?? ??? ? Aug 01, 2025 am 05:53 AM

??? (DI) ISADESIGNPATTORNWHEREWHEDROUDIVESTESTESTETESTERGROWCONSTRUCTOR, 2.SPRINGFRAMEWWERTHUSENONTATIONS? ??@autowiredWithjava ?? CONCUTTATIONS LIKERWITHCONSTRUCTOR, ORFIELDINGESS.2.SPRINGFRAMEWWERTHUSENNOTATIONS

Python itertools ?? ?? Python itertools ?? ?? Jul 31, 2025 am 09:53 AM

itertools.combinations? ?? ??? ???? ??? ?? ??? ???? ?? ? ?? ?? (?? ???)? ???? ? ?????. ???? ??? ????. 1. ?? ??? ??? ?? ( 'a', 'b'), ( 'a', 'c') ? ???? 2 ?? ?? ??? ?????. 2. ?? ??? ??? "ABC"? "ABD"? ?? ???? 3 ? ??? ???; 3. ? ??? ?? 1 5 = 6? ?? ?? ?? ??? ??? ?????. ?? ?? ??? ???????. ??? ??? ??? ??? ???? ??????, ??? AB? BA? ???? ???? ??, ??? ?? ??? ????.

???? Java 'OutofMemoryError'???? ?? ?? ???? Java 'OutofMemoryError'???? ?? ?? Jul 31, 2025 am 09:07 AM

java.lang.outofMemoryError : javaheapspace? ? ???? ???? ? ??, ??? ?? ? ? ??? ??? ???? ? ?? ?? ??? ?? ??? ??? ????????. 2. Metaspace ??? ??? ??? ?? ???? ?? ?? ??? ?? ?? ? ???? ????? MaxMetaspacesize? ???? ?????? ????????. 3. UnableTocreatenewnativeThread ?? ??? ??? ???? ?? ??? ?? ???? ??? ?? ???? ?? ??? ???????. 4. GCOVERHEADLIMITEXEDED? GC? ????? ???? ??? GC ??? ???? ????? ?? ?????.

Python Pytest Fixture ?? Python Pytest Fixture ?? Jul 31, 2025 am 09:35 AM

???? ?? ?? ?? ?? ???? ?? ???? ???? ? ???? ?????. 1. @pytest.fixture ?????? ???? ???? ??????. 2. ??? ???? ???? ??? ???? ??; 3. ?? ?? ??? ?? ? ?? ??; 4. ??, ?? ?? ?? ?? ?? ??? ?? ?? ??; 5. ?? ???? Conftest.py? ???? ??? ?? ??? ???? ???? ?? ?? ? ??? ?? ??????.

JVM (Java Virtual Machine) ?? ?? JVM (Java Virtual Machine) ?? ?? Aug 01, 2025 am 06:31 AM

thejvmenablesjava? "WriteOnce, Runynywhere"??? ?? excodecodethroughfourmaincomponents : 1. theclassloadersubsystemloads, ??, ? intinitializes.classfilesusingbootsprap, extension, andapplicationclassloaders, ensuringsecureandlazyclasloa

Java? ??? ?? ??? ?????? Java? ??? ?? ??? ?????? Aug 02, 2025 am 02:38 AM

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

See all articles