solr demo2

[b][color=blue]当然是web.xml[/color][/b]





contextConfigLocation
classpath*:/applicationContext.xml



struts2
org.apache.struts2.dispatcher.FilterDispatcher


encodingFilter
org.springframework.web.filter.CharacterEncodingFilter


encoding
UTF-8


forceEncoding
true



encodingFilter
/*


struts2
/*


org.springframework.web.context.ContextLoaderListener



org.springframework.web.util.IntrospectorCleanupListener



index.jsp



[b][color=blue]spring action配置文件 action交给spring管理[/color][/b]










[b][color=blue]applicaitonContext-dao.xml[/color][/b]


"http://www.springframework.org/dtd/spring-beans-2.0.dtd">




[b][color=blue]applicationContext-datasource.xml[/color][/b]


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd" default-autowire="byName">


${jdbc.driver}


${jdbc.username}


${jdbc.password}


${jdbc.url}










[b][color=blue]applicationContext-service.xml[/color][/b]


"http://www.springframework.org/dtd/spring-beans-2.0.dtd">








[b][color=blue]applicationContext.xml[/color][/b]


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">









[b][color=blue]datebase.properties[/color][/b]

#mysql version database setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/solr?useUnicode=true
jdbc.username=root
jdbc.password=root


[b][color=blue]good.xml[/color][/b]



"http://ibatis.apache.org/dtd/sql-map-2.dtd">





















insert into good(MERCHANT_ID,GOOD_ID,REGION_ID,GOOD_NAME,GOOD_NO,BARCODE,GOOD_DESC,PRICE,NUM,TYPE_ID,TYPE_NAME) values(#merchant_id#,#good_id#,#region_id#,#good_name#,#good_no#,#barcode#,#good_desc#,#price#,#num#,#typeId#,#typeName#)


delete from good where good_id=#value#



update good set good_name=#good_name#,good_desc=#good_desc# where good_id=#good_id#




[b][color=violet]solrconfig.xml[/color][/b]

这个是solr中的配置文件 这个文件太长就不贴了 只修改了一个地方
${solr.data.dir:D:\solr-tomcat\data}
索引存放位置

[b][color=blue]SqlMapConfig.xml[/color][/b]



"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">







[b][color=blue]struts-good.xml[/color][/b]


"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">




${target}
${target}
${target}





[b][color=blue]struts.xml[/color][/b]


"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">







你可能感兴趣的:(Solr,Spring,Struts,XML,iBATIS,solr)