下拉框 枚举问题

先要在你的枚举配置文件中新建你所用的枚举值,配置文件为enums_zh_CN.properties

#defect管理
ITSMDEFECT.PROJECT=001:v3,002:t3,003:d3
ITSMDEFECT.MODULE=001:缺陷管理,002:监控中心,003:工作审批
ITSMDEFECT.URGENCY=0:低,1:中,2:高,3:重大

 之后需要修改配置文件,在.xml中写入前拦截器和枚举值的配置

<!-- 前拦截器 -->
	<bean id="itsmDefectDataBeforeIntercept" class="org.loushang.waf.interceptor.CollectionInterceptor">
		<property name="collections">
			<map>
				<entry key="COLLECTION_ITSMDEFECT.PROJECT" value-ref="COLLECTION_ITSMDEFECT.PROJECT"></entry>
				<entry key="COLLECTION_ITSMDEFECT.MODULE" value-ref="COLLECTION_ITSMDEFECT.MODULE"></entry>
				<entry key="COLLECTION_ITSMDEFECT.URGENCY" value-ref="COLLECTION_ITSMDEFECT.URGENCY"></entry>
				
			</map>
		</property>
	</bean>

 

<!-- 枚举值 -->
	<bean id="COLLECTION_ITSMDEFECT.PROJECT" class="org.loushang.waf.data.EnumCollection">
	    <property name="enumName" value="ITSMDEFECT.PROJECT"/>
	    <property name="enumService" ref="enumService"/>
	</bean>
	<bean id="COLLECTION_ITSMDEFECT.MODULE" class="org.loushang.waf.data.EnumCollection">
	    <property name="enumName" value="ITSMDEFECT.MODULE"/>
	    <property name="enumService" ref="enumService"/>
	</bean>
	<bean id="COLLECTION_ITSMDEFECT.URGENCY" class="org.loushang.waf.data.EnumCollection">
	    <property name="enumName" value="ITSMDEFECT.URGENCY"/>
	    <property name="enumService" ref="enumService"/>
	</bean>
</beans>

 

请注意在配置文件中写入跳转注入和预注入

<!--***********************cmd配置开始*********************************************-->
    <bean id="itsmdefectdata" class="com.lc.t3.itsm.defect.cmd.ItsmDefectDataCmd" singleton="false">
	    <property name="itsmDefectDataService"><ref bean="itsmDefectDataService"/></property>
	    <property name="view"><ref bean="itsmDefectDataView"/></property>
	    <property name="forwards">
	        <map>
	            <entry key="itsmdefectdataView"><ref bean="itsmdefectdataforward"/></entry>
	            <entry key="itsmdefectdataViewChain"><ref bean="itsmdefectdataforwardchain"/></entry>
	        </map>
		</property>
		<property name="beforIntercept">
	        <list>
	            <ref bean="itsmDefectDataBeforeIntercept"/>
	        </list>
     	</property>
    </bean>

<!--***********************cmd配置结束*********************************************-->

 

接下来修改jsp页面

<td class="defectTitle"><%=ResourcesFactory
											.getString("ITSM_DEFECT_DATA.DEFECT_PROJECT")%>:<font color="red">*</font></td>
				<td class="defectRight">
				<html:select name="defectProject" property="defectProject" style="width:184px">
					<html:options collection="COLLECTION_ITSMDEFECT.PROJECT" labelProperty="value" property="key"/>
				</html:select>

  下拉裂狂就做好了,前拦截器是公司框架里的东西,谁他妈知道是怎么写的,干嘛用的,唉,先做出来再说!

你可能感兴趣的:(下拉列框)