GVKun编程网logo

SSM配置文件常用配置(ssm的配置文件)

3

如果您对SSM配置文件常用配置感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于SSM配置文件常用配置的详细内容,我们还将为您解答ssm的配置文件的相关问题,并且为您提供关于.

如果您对SSM配置文件常用配置感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于SSM配置文件常用配置的详细内容,我们还将为您解答ssm的配置文件的相关问题,并且为您提供关于.jshintrc配置文件中的一些常用配置、/etc目录常用配置文件、c# – ASP.Net配置文件:设置和使用配置文件字段时遇到困难、C# 使用配置文件配置应用的有价值信息。

本文目录一览:

SSM配置文件常用配置(ssm的配置文件)

SSM配置文件常用配置(ssm的配置文件)

spring-applicationContext-bean.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:task="http://www.springframework.org/schema/task"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-4.0.xsd 
	http://www.springframework.org/schema/task
	http://www.springframework.org/schema/task/spring-task.xsd ">


    <!--<context:property-placeholder location="classpath:/config/properties/*.properties"/>-->
    <bean>
        <property name="locations">
            <list>
                <!--<value>classpath:config/properties/jdbc.properties</value>-->
                <!--<value>classpath:config/properties/system.properties</value>-->
                <value>classpath:config/properties/*.properties</value>
            </list>
        </property>
    </bean>

    <!--Spring线程池-->
    <!--<bean id="threadPoolTaskExecutor">-->
        <!--&lt;!&ndash; 线程池维护线程的最少数量 &ndash;&gt;-->
        <!--<property name="corePoolSize" value="5" />-->
        <!--&lt;!&ndash; 允许的空闲时间 &ndash;&gt;-->
        <!--<property name="keepAliveSeconds" value="3000" />-->
        <!--&lt;!&ndash; 线程池维护线程的最大数量 &ndash;&gt;-->
        <!--<property name="maxPoolSize" value="10" />-->
        <!--&lt;!&ndash; 缓存队列 &ndash;&gt;-->
        <!--<property name="queueCapacity" value="20" />-->
        <!--&lt;!&ndash; 对拒绝task的处理策略 &ndash;&gt;-->
        <!--<property name="rejectedExecutionHandler">-->
            <!--<bean/>-->
        <!--</property>-->
    <!--</bean>-->

    <!--
    @Resource(name = "threadPoolTaskExecutor")
    private ThreadPoolTaskExecutor taskExecutor;
    taskExecutor.execute(new Runnable(){
            public void run() {
                try {
                    LOG.info("执行线程任务开始前");
                    Thread.currentThread().sleep(10000);
                    if (LOG.isDebugEnabled()) {
                        LOG.info("执行线程任务结束");
                    }
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
    -->
    <task:executor id="executor" pool-size="5" />
    <task:scheduler id="scheduler" pool-size="5" />
    <task:annotation-driven executor="executor" scheduler="scheduler" />
</beans>

 

spring-applicationContext-database.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans.xsd
     http://www.springframework.org/schema/tx
     http://www.springframework.org/schema/tx/spring-tx.xsd">

    <description>数据源相关定义</description>

    <!-- 阿里 druid数据库连接池 -->
    <bean id="dataSource"init-method="init" destroy-method="close">
        <!-- 给数据源取个名字 -->
        <property name="name" value="${name}"/>
        <!-- 数据库基本信息配置 -->
        <property name="url" value="${url}"/>
        <property name="username" value="${username}"/>
        <property name="password" value="${password}"/>
        <property name="driverClassName" value="${driverClassName}"/>
        <!-- 最大并发连接数 -->
        <property name="maxActive" value="${maxActive}"/>
        <!-- 初始化连接数量 -->
        <property name="initialSize" value="${initialSize}"/>
        <!-- 配置获取连接等待超时的时间 -->
        <property name="maxWait" value="${maxWait}"/>
        <!-- 最小空闲连接数 -->
        <property name="minIdle" value="${minIdle}"/>
        <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
        <property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}"/>
        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
        <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}"/>
        <property name="validationQuery" value="${validationQuery}"/>
        <property name="testWhileIdle" value="${testWhileIdle}"/>
        <property name="testOnBorrow" value="${testOnBorrow}"/>
        <property name="testOnReturn" value="${testOnReturn}"/>
        <property name="maxOpenPreparedStatements" value="${maxOpenPreparedStatements}"/>
        <!-- 打开 removeAbandoned 功能 -->
        <property name="removeAbandoned" value="${removeAbandoned}"/>
        <!-- 1800 秒,也就是 30 分钟 -->
        <property name="removeAbandonedTimeout" value="${removeAbandonedTimeout}"/>
        <!-- 关闭 abanded 连接时输出错误日志 -->
        <property name="logAbandoned" value="${logAbandoned}"/>
        <!--属性类型是字符串,通过别名的方式配置扩展插件,
            常用的插件有:
            监控统计用的filter:stat
            日志用的filter:log4j
            防御sql注入的filter:wall-->
        <property name="filters" value="${filters}"/>
    </bean>

    <!-- MYBATIS 配置 -->
    <bean id="sqlSessionFactory">
        <property name="configLocation" value="classpath:config/xml/mybatis-config.xml" />
        <property name="dataSource" ref="dataSource"/>
        <!--<property name="mapperLocations" value="classpath*:sql-mappers/**/*.xml"/>-->
        <property name="mapperLocations">
            <list>
                <value>classpath*:sql-mappers/**/*.xml</value>
            </list>
        </property>
        <!-- 分页插件 -->
        <property name="plugins">
            <array>
                <bean>
                    <property name="properties">
                        <!--使用下面的方式配置参数,一行配置一个 -->
                        <value>
                            helperDialect=mysql
                            closeConn=false
                            pageSizeZero=true
                            reasonable=true
                        </value>
                    </property>
                </bean>
            </array>
        </property>
    </bean>

    <!--<bean id="userMapper">-->
        <!--<property name="mapperInterface" value="nightelf.dao.BaseDao"/>-->
        <!--<property name="sqlSessionFactory" ref="sqlSessionFactory"/>-->
    <!--</bean>-->

    <!-- 扫描数据访问层,组装数据访问接口实现类 -->
    <bean>
        <property name="basePackage" value="nightelf.dao"/>
    </bean>


    <!-- 配置SqlSessionTemplate -->
    <bean id="sqlSessionTemplate">
        <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"/>
    </bean>

    <!--事务配置-->
    <!--声明式事务 Start -->
    <bean id="transactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-/>
    <!--声明式事务 End -->


    <!-- 通用事务通知 -->
    <!--
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="query*" read-only="true"/>
            <tx:method name="save*" propagation="REQUIRED" rollback-for="Exception"/>
            <tx:method name="insert*" propagation="REQUIRED" rollback-for="Exception"/>
            <tx:method name="update*" propagation="REQUIRED" rollback-for="Exception"/>
            <tx:method name="delete*" propagation="REQUIRED" rollback-for="Exception"/>
        </tx:attributes>
    </tx:advice>

    <aop:config expose-proxy="true">
        <aop:pointcut id="txPointcut" expression="execution(* com.digitalchina.*.service.*(..))"/>
        <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice"/>
    </aop:config>
    -->

    <!-- hibernate -->
    <!--
        <bean id="sessionFactory">
            <property name="dataSource" ref="dataSource" />
            <property name="packagesToScan">
                <list>
                    &lt;!&ndash; 可以加多个包 &ndash;&gt;
                    &lt;!&ndash;<value>com.wq.entity</value>&ndash;&gt;
                </list>
            </property>
            <property name="hibernateProperties">
                &lt;!&ndash;
                <props>
                    <prop key="hibernate.hbm2ddl.auto">none</prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.format_sql">false</prop>
                    <prop key="hibernate.query.substitutions">true 1, false 0</prop>
                    <prop key="hibernate.default_batch_fetch_size">16</prop>
                    <prop key="hibernate.max_fetch_depth">2</prop>
                    <prop key="hibernate.generate_statistics">true</prop>
                    <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>
                    <prop key="hibernate.current_session_context_class">thread</prop>
                </props>
                 &ndash;&gt;
                <value>
                    hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
                    hibernate.hbm2ddl.auto=update
                    hibernate.show_sql=true
                    hibernate.format_sql=false
                    #开启二级缓存
                    hibernate.cache.use_second_level_cache=true
                    #开启二级查询缓存
                    hibernate.cache.use_query_cache=true
                    #设置二级缓存的提供者
                    hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
                </value>
            </property>
        </bean>
        -->
</beans>

 

spring-mvc.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
	http://www.springframework.org/schema/mvc
	http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
	http://www.springframework.org/schema/aop
	http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <!-- 注解式 AOP @aspectJ -->
    <!-- 激活自动代理功能 -->
    <aop:aspectj-autoproxy proxy-target-/>

    <context:component-scan base-package="nightelf.**.mapping, nightelf.**.impl, nightelf.lib.service"/>

    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean>
                <property name="objectMapper">
                    <bean>
                        <property name="dateFormat">
                            <bean>
                                <constructor-arg type="java.lang.String" value="yyyy-MM-dd HH:mm:ss"/>
                            </bean>
                        </property>
                    </bean>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

    <!-- 让SpringMVC使用默认的Servlet来响应静态文件 -->
    <!-- 配置默认Servlet来处理静态资源访问 -->
    <!-- <mvc:default-servlet-handler default-servlet-name=""/> -->

    <!-- 配置根视图 -->
    <!--<mvc:view-controller path="/" view-name="index" />-->

    <!-- 文件上传必须定义此bean -->
    <bean id="multipartResolver">
        <property name="maxUploadSize" value="10485760"></property>
        <property name="defaultEncoding" value="utf-8"></property>
    </bean>

    <!-- 定义不被SpringMVC过滤的静态资源 -->
    <mvc:resources location="/resources/" mapping="/resources/**"/>
    <mvc:resources location="/html/" mapping="/html/**"/>

    <!-- SpringMVC 异常拦截 -->
    <!-- <controller> -->
    <!-- 表示当抛出NumberFormatException的时候就返回名叫number的视图 -->
    <!--
    <property name="exceptionMappings">
        <props>
            <prop key="java.lang.NullPointerException">WEB-INF/error/error</prop>
        </props>
    </property>
     -->

    <!-- 对转向页面的路径解析。prefix:前缀, suffix:后缀 -->
    <bean>
        <property name="prefix" value="/"/>
        <!--<property name="suffix" value=".jsp"/>-->
        <!-- 需要引入jstl包-->
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
        <property name="contentType" value="text/html;charset=UTF-8"/>
    </bean>

    <bean/>

    <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <!--<mvc:exclude-mapping path="/src/**" />-->
            <bean/>
        </mvc:interceptor>
    </mvc:interceptors>




</beans>

 

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<!-- 配个日志 -->
<configuration>
    <settings>
        <setting name="lazyLoadingEnabled" value="false"/>
        <setting name="cacheEnabled" value="false"/>
        <setting name="logImpl" value="STDOUT_LOGGING"/>
    </settings>
    <!--<typeAliases>-->
    <!--<package name="com.entityVo.common.log"/>-->
    <!--</typeAliases>-->
</configuration>

 

log4j.properties

# Set log levels
log4j.rootLogger = ${log4j.log.level},LogFile,Console

# Output the log info to the Java Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p [%c] %m%n

# Save the log info to the log file one day.
log4j.appender.LogFile = org.apache.log4j.DailyRollingFileAppender
log4j.appender.LogFile.File = ${log4j.logfile.path}
log4j.appender.LogFile.Append = true
log4j.appender.LogFile.ImmediateFlush = true
log4j.appender.LogFile.Threshold = ${log4j.log.level}
log4j.appender.LogFile.Encoding = UTF-8
log4j.appender.LogFile.layout = org.apache.log4j.PatternLayout
log4j.appender.LogFile.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %p [%c] %m%n
log4j.appender.LogFile.DatePattern =''.''yyyy-MM-dd-HH


#ibatis logger config
log4j.logger.com.ibatis=${log4j.log.level}
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=${log4j.log.level}
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=${log4j.log.level}
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=${log4j.log.level}


log4j.logger.java.sql.Connection=${log4j.log.level}
log4j.logger.java.sql.Statement=${log4j.log.level}
log4j.logger.java.sql.PreparedStatement=${log4j.log.level}
log4j.logger.java.sql.ResultSet =${log4j.log.level}

log4j.logger.druid.sql.Statement=debug,Console

 

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
		  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">
    <display-name>interface</display-name>

    <welcome-file-list>
        <welcome-file>/html/index.html</welcome-file>
    </welcome-file-list>


    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- 解决java.beans.Introspector导致的内存泄漏的问题 -->
    <listener>
        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
    </listener>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:config/xml/spring-applicationContext-bean.xml</param-value>
    </context-param>

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <!--<dispatcher>INCLUDE</dispatcher>-->
    </filter-mapping>


    <!-- 可以继承一下 processHandlerException -->
    <servlet>
        <servlet-name>springMvc</servlet-name>
        <!--<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>-->
        <servlet-class>nightelf.lib.servlet.NightelfDispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:config/xml/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springMvc</servlet-name>
        <url-pattern>/</url-pattern>
        <!--<url-pattern>*.do</url-pattern>-->
    </servlet-mapping>

    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>

    <!-- 这个是阿里连接池的查看工具,前提要在dataSource里面配置好 -->

    <servlet>
        <servlet-name>DruidStatView</servlet-name>
        <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>DruidStatView</servlet-name>
        <url-pattern>/druid/*</url-pattern>
    </servlet-mapping>

    <!-- spring 代理 filter-->
<!--
    <filter>
        <filter-name>SSOSessionFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetBeanName</param-name>
            <param-value>ssoSessionFilter</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>SSOSessionFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
-->

<!--
    <servlet>
        <servlet-name>ErrorServlet</servlet-name>
        <servlet-class>nightelf.lib.servlet.ErrorServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ErrorServlet</servlet-name>
        <url-pattern>/nightelf_error</url-pattern>
    </servlet-mapping>-->

<!--
    <filter>
        <filter-name>NightElfFilter</filter-name>
        <filter-class>nightelf.lib.filter.NightElfFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>NightElfFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
-->

<!--

  <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/nightelf_error</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/nightelf_error</location>
    </error-page>
    <error-page>
        <error-code>400</error-code>
        <location>/nightelf_error</location>
    </error-page>
    <error-page>
        <error-code>405</error-code>
        <location>/nightelf_error</location>
    </error-page>
-->


    <!--<error-page>-->
    <!--<error-code>500</error-code>-->
    <!--<location>/nightelf_error</location>-->
    <!--</error-page>-->


    <!-- 这个配置就是指定log4j 配置文件路径 -->
    <!--<listener>-->
    <!--<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>-->
    <!--</listener>-->
    <!--<context-param>-->
    <!--<param-name>log4jConfigLocation</param-name>-->
    <!--<param-value>classpath*:log4j.properties</param-value>-->
    <!--</context-param>-->
    <!--log4jRefreshInterval为60000表示 开一条watchdog线程每60秒扫描一下配置文件的变化;这样便于日志存放位置的改变-->
    <!--<context-param>-->
    <!--<param-name>log4jRefreshInterval</param-name>-->
    <!--<param-value>60000</param-value>-->
    <!--</context-param>-->
</web-app>

 

.jshintrc配置文件中的一些常用配置

.jshintrc配置文件中的一些常用配置

{

"es5": true,    
"node": true,

/**
* 是否阻止位运算符的使用
*
* 有时候为了快速取整或判断,会使用一些位运算符,所以此项设置为 false
*/
"bitwise": false,

/**
* 是否要求变量都使用驼峰命名
*
* 默认开启
*/
"camelcase": false,

/**
* 是否要求 for/while/if 带花括号
*
* 我们建议多行的时候使用花括号,单行强制写在一行。
* 因为这个选项不管单行多行,所以默认关闭
*/
"curly": false,

/**
* 是否强制使用严格等号
*
* 有时候工程师需要判断 null,所以默认不严格要求
*/
"eqeqeq": false,

/**
* for-in 语句是否要求过滤原型链上的对象
*
* 默认打开
*/
"forin": true,

/**
* 是要求否以 strict 模式检查
*
* 该选项要求文件有 "use strict;" 字符串,而且很多限制有点残酷。不全局要求,需要的模块自行开启
*/
"strict": false,

/**
* 是否阻止修改或拓展基本对象(Array、Date 等)的原型链
*
* 原型链污染比较危险,默认打开
*/
"freeze": true,

/**
* 是否要求自执行的方法使用括号括起
*
* 默认打开
*/
"immed": true,

/**
* 指定缩进大小为 4 个空格
*/
"indent": 4,

/**
* 要求变量在使用前声明
*/
"latedef": true,

/**
* 要求构造函数大写
*/
"newcap": true,

/**
* 不允许使用 arguments.callee 和 arguments.caller
*/
"noarg": true,

/**
* 不允许空的代码快,默认关闭
*/
"noempty": false,

/**
* 不允许使用 "non-breaking whitespace"。
*
* 这些字符在非 UTF8 页面会导致代码失效
*/
"nonbsp": true,

/**
* 阻止直接使用 new 调用构造函数的语句(不赋值对象)
*
* // OK
* var a = new Animal();
*
* // Warn
* new Animal();
*/
"nonew": true,

/**
* 不允许使用 ++ 和 -- 运算符
*
* 默认关闭
*/
"plusplus": false,

/**
* 字符串引号
*
* 默认要求使用单引号
*/
//"quotmark": "single",

/**
* 提示未定义的变量
*
* 未定义的变量会容易造成全局变量,该项开启
*/
"undef": true,

/**
* 字符串不允许以空格加斜杠的形式来换行
*
* // OK
* var str = ''Hello '' +
*     ''world'';
*
* // No Way
* var str = ''Hello \
*     world'';
*/
"trailing": true,

/**
* 对代码中使用的 debugger 语句默认给出警告
*/
"debug": false,

/**
* 变量只能在函数域上定义,在代码块上定义的变量给出警告
*
* // OK
* function test() {
 *    var x;
 *
 *    if (true) {
 *        x = 0;
 *    }
 *
 *    x += 1;
 * }
*
* // No Way
* function test() {
 *
 *    if (true) {
 *        var x = 0;
 *    }
 *
 *    x += 1;
 * }
*/
"funcscope": true,

/**
* 写字面量时,逗号放前面给出警告,例如:
*
* var obj = {
 *     name: ''Anton''
 *   , handle: ''valueOf''
 *   , role: ''SW Engineer''
 * }
*/
"laxcomma": false,

/**
* 允许在循环语句中产生函数
*/
"loopfunc": true,

/**
* 每个函数只允许使用一个 var 定义变量
*
* 默认关闭
*/
"onevar": false,

/**
* 提示未使用的变量
*
* 默认开启
*/
"unused": true

}

/etc目录常用配置文件

/etc目录常用配置文件

 

/etc/resolv.conf     DNS客户端配置文件,逐渐被网卡配置文件所替代

/etc/hosts       本机DNS解析文件,优先级高于DNS服务器

/etc/hostname     CentOS 7 主机名配置文件

/etc/fstab       开机自动挂载设备的配置文件,配置文件中第一个0表示不需要备份,第二个0表示磁盘开机不自检

/etc/mtab         当前已挂载的文件系统列表,由scripts初始化,使用mount、umount 命令时会立即更新 mtab 文件,使用df 命令查看mtab文件信息

/etc/rc.local     存放开机自启动程序命令的文件,( chkconfig 只能管理 yum/rpm 安装软件包的启动服务)

/etc/inittab      设定系统启动时init进程将把系统设置成什么样的runlevel及加载相关的启动文件设置

/etc/init.d       存放系统或服务器以System V 模式启动的脚本

/etc/profile    配置系统的环境变量、别名等的文件,各种永久配置,生效需重新登录、或(source /etc/profile、./etc/bashrc)

/etc/bashrc    配置系统的环境变量、别名等的文件,各种永久配置,生效需重新登录、或(source /etc/profile、./etc/bashrc)

/etc/issue    系统启动后用户登录前,登录页面提示信息的配置文件

/etc/issue.net    系统启动后用户登录前,登录页面提示信息的配置文件

/etc/motd     账户登录后弹出的登录提示,可配置欢迎信息

/etc/sysctl.conf   Linux内核参数设置文件,用于内核的配置和优化

/etc/init.d      软件启动程序所在的目录(CentOS 7以前),目前已基本废弃

/etc/inittab      设置系统运行级别以及启动相应级别脚本的文件(CentOS 7 以前),目前已基本废弃

/etc/redhat-release   声明RedHat、CentOS版本,ubuntu 为/etc/lsb-release,oracle linux 为 /etc/oracle-release

/etc/group        设定用户的组名和相关信息

/etc/passwd       账号信息文件

/etc/shadow       密码信息文件

/etc/yum.repos.d/    存放yum源配置文件目录

/etc/default/useradd 新增账户的默认属性配置

/etc/login.defs 新增用户的属性信息

/etc/skel 提供用户环境变量配置文件,由此目录向新增用户家目录添加环境变量配置文件

c# – ASP.Net配置文件:设置和使用配置文件字段时遇到困难

c# – ASP.Net配置文件:设置和使用配置文件字段时遇到困难

我目前正在尝试使用ASP.Net配置文件来存储有关在我们网站上注册的用户的其他用户信息.

相关示例代码:

UserProfile.cs

public class UserProfile: System.Web.Profile.ProfileBase
{

    public static UserProfile GetUserProfile(string username)
    {
        return Create(username) as UserProfile;
    }

    public static UserProfile GetUserProfile()
    {
        return GetUserProfile(Membership.GetUser().UserName);
    }

    public string FacebookUid
    {
        get
        {
            return base["FacebookUid"] as string;
        }
        set
        {
            base["FacebookUid"] = value;
        }
    }
}

Web.config文件

<profile enabled="true" inherits="WIF.Web.STS.Classes.UserProfile" defaultProvider="XmlProfileProvider" >
      <properties>
          <add name="FacebookUid" />
      </properties>
      <providers>
          <add name="XmlProfileProvider" type="Artem.Web.Security.XmlProfileProvider,Artem.Web.Security.Xml" applicationName="/" fileName="Profiles.xml" folder="~/App_Data/"/>
      </providers>
  </profile>

Register.aspx.cs

profile = WIF.Web.STS.Classes.UserProfile.GetUserProfile(emailAddress);
    profile.FacebookUid = "";

当我离开web.config中定义的FacebookUid时;我从web.config得到这个错误:

Configuration Error: This profile property has already been defined.

我已经仔细检查了web.config;该属性条目仅在web.config中出现一次.

我想这是因为我在UserProfile类上设置了具有相同名称的属性.我从web.config中删除了属性/ add [name =’FacebookUid’]条目.一旦我做到了;当我尝试在Register.aspx.cs中设置FacebookUid的值时出现此错误:

The settings property 'FacebookUid' was not found
  Line 76:             profile["FacebookUid"] = "";

我再试一次,这次直接使用ProfileBase类:

修订了Register.aspx.cs

var profile = System.Web.Profile.ProfileBase.Create(emailAddress,true);
        profile["FacebookUid"] = "";

修改了web.config:

<profile enabled="true" defaultProvider="XmlProfileProvider" >
          <properties>
              <add name="FacebookUid" />
          </properties>
          <providers>
              <add name="XmlProfileProvider" type="Artem.Web.Security.XmlProfileProvider,Artem.Web.Security.Xml" applicationName="/" fileName="Profiles.xml" folder="~/App_Data/"/>
          </providers>
      </profile>

我尝试使用properties / add [name =’FacebookUid’]而没有;在相同的情况下得到与上述相同的错误.

我很难过,谷歌/ Binging让我无处可去.这里有没有人知道可能会发生什么和/或如何解决这个问题?非常感谢任何建设性的意见.

谢谢,
坦率

解决方法

在web.config中定义自定义属性以及从ProfileBase继承的类似乎有点矫枉过正:

Notes to Inheritors

You can create a custom profile implementation that inherits from the ProfileBase abstract class and defines properties for the user profile that are not specified in the profile configuration element.

http://msdn.microsoft.com/en-us/library/system.web.profile.profilebase.aspx

另外:你修改过XmlProfileProvider的代码吗?它似乎期待XmlProfile,没有别的.

http://www.java2s.com/Open-Source/ASP.NET/Asp.net-Samples/tinyproviders/Artem/Web/Security/XmlProfileProvider.cs.htm

C# 使用配置文件配置应用

C# 使用配置文件配置应用

使用配置文件配置应用

.NET Framework 通过配置文件为开发人员和管理员提供了对应应用程序运行方式的控制权和灵活性。配置文件可以按需要更改的XML文件。管理员能够控制应用程序可以访问哪些受保护的资源,应用程序将设置于配置文件中,从而没有必要中每次设置更改时重新编译应用程序。本节说明可以对什么进行配置以及为什么对应用程序进行配置会有用。

本主题描述配置文件对语法,并提供油管三种配置文件对信息:计算机配置文件、应用程序配置文件和安全配置文件。

配置文件格式

配置文件包含元素,它们是用来设置配置信息的逻辑数据结构。在配置文件内,使用标记元素的开头和结尾。例如,

<runtime>元素包括<runtime>子元素</runtime>。空元素将写为<runtime/>或<runtime></runtime>。

与所有XML文件一样,配置文件中的语法区分大小写。

使用预定义特性来制定配置设置,这些特性是元素开始标记内的名称/值对。下面的示例为<codeBase>元素指定两个特性(version和href),该元素指定运行时值何处可以找到程序集(有关详细信息,请参阅指定程序集的位置)

 

计算机配置文件

计算机配置文件Machine.config包含应用于整个计算机的设置。此文件位于%runtime install path%\Config目录中。Machine.config包含整个计算机范围内的程序集绑定、内置远程处理信道和ASP.NET的配置设置。

 

配置系统首先查看计算机配置文件,查找<appSettings>元素,然后查看开发人员可能定义的其他配置节。然后查看应用程序配置文件。为使计算机配置文件看管理,最好将这些设置放在应用程序配置文件中。为使计算机配置文件可管理,最好将这些配置放在应用程序配置文件中。但是,将这些设置放中计算机配置文件中可以使系统更易维护。例如,如果有第三方组件,且客户端和服务器应用程序同时使用该组件,那么僵该组件设置房子一个位置更方便。在这种情况下,计算配置文件使存放设置的合适位置,这样讲不会将相同的设置房子两个不同的文件中。

 

 

今天关于SSM配置文件常用配置ssm的配置文件的讲解已经结束,谢谢您的阅读,如果想了解更多关于.jshintrc配置文件中的一些常用配置、/etc目录常用配置文件、c# – ASP.Net配置文件:设置和使用配置文件字段时遇到困难、C# 使用配置文件配置应用的相关知识,请在本站搜索。

本文标签: