关于ssh三大框架中web.xml的总结

CAN 通信测试工具 canutils 概述 CAN,Controller Area Network,控制器局域网,一种高可靠性的现场总线。广泛用于汽车电子、工业控制通信。 canutils 工具包内含 5 个独立的程序:canconfig、candump、canecho、cansend、cansequence。这几个程序的功能简述如下: canconfig:用于配置 CAN 总线接口的参数,主要是波特率和模式。 candump... 阅读详情

大家都知道,在常用的ssh框架开发中,web.xml是全局配置文件,那么在该xml文件中都需要配置什么?

1.配置actionservlet的初始化路径

<servlet>
           <servlet-name>action</servlet-name>
           <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
           <init-param>
                 <param-name>config</param-name>
                 <param-value>
                            
/WEB-INF/struts-config.xml,
                           /WEB-INF/struts-config.xml(可以配置多个文件,中间用,隔开)
                </param-value>
          </init-param>
          <init-param>
                   <param-name>debug</param-name>
                   <param-value>3</param-value>
          </init-param>
          <init-param>
                  <param-name>detail</param-name>
                  <param-value>3</param-value>
          </init-param>
          <load-on-startup>0</load-on-startup>
    </servlet>

相应的action的映射文件:
 <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
 </servlet-mapping>

相应的 <servlet-name>action</servlet-name>必须一致。
2.配置过滤器的初始化路径:
   <filter>
     <filter-name>encoding</filter-name>
     <filter-class>过滤文件的处理类</filter-class>
     <init-param>
      <param-name>encoding</param-name>
         <param-value>UTF-8</param-value>
      </init-param>
   </filter>
   <filter-mapping>
     <filter-name>encoding</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>
3.配置欢迎界面:
    <welcome-file-list>
        <welcome-file>welcome.jsp</welcome-file>
        <welcome-file>welcome.jsp</welcome-file>
   </welcome-file-list>
4.配置404错误界面:
 <error-page>
    <error-code>404</error-code>
    <location>/404.jsp</location>
 </error-page>
5.配置500错误界面:
   <error-page>
           <error-code>500</error-code>
           <location>/500.jsp</location>
  </error-page>


6.配置ServletException错误界面:
    <error-page>
            <exception-type>javax.servlet.ServletException</exception-type>
            <location>/systemError.jsp</location>
     </error-page>

7.设置session超时:

    <session-config>
        <!-- 以分钟为单位 -->
        <session-timeout>15</session-timeout>
    </session-config>

8.禁用scriptlet:

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <scripting-invalid>true</scripting-invalid>
        </jsp-property-group>
    </jsp-config>

9.Spring配置文件

 <context-param>
                 <param-name>contextConfigLocation</param-name>
                 <param-value> WEB-INF/classes/configs/applicationContext.xml</param-value>
          </context-param>

 <servlet>
               <servlet-name>SpringContextServlet</servlet-name>
               <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
              <load-on-startup>2</load-on-startup>
          </servlet>

10.登陆过滤

<filter>
                <filter-name>loginFilter</filter-name>
               <filter-class>com.filter.LoginFilter</filter-class>
              <init-param>
                    <param-name>sessionName</param-name>
                   <param-value>user</param-value>
              </init-param>
             <init-param>
                    <param-name>loginURL</param-name>
                    <param-value>/cdp/pages/login/login.jsp</param-value>
            </init-param>
      </filter>
      <filter-mapping>
               <filter-name>loginFilter</filter-name>
               <url-pattern>*.do</url
-pattern>
      </filter-mapping>
      <filter-mapping>
              <filter-name>loginFilter</filter-name>
             <url-pattern>*.jsp</url-pattern>
     </filter-mapping>

 

11.数据库连接池

<servlet>
                 <servlet-name>ServletConfigurator</servlet-name>
                 <servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
                <init-param>
                     <param-name>xmlFile</param-name>
                    <param-value>WEB-INF/classes/configs/proxool.xml</param-value>
               </init-param>
               <load-on-startup>1</load-on-startup>
         </servlet>

 

12.hibernate配置

<filter>
                     <filter-name>hibernateFilter</filter-name>
                     <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
                    <init-param>
                             <param-name>singleSession</param-name>
                            <param-value>true</param-value>
                    </init-param>
                   <init-param>
                             <param-name>flushMode</param-name>
                             <param-value>AUTO</param-value>
                   </init-param>
      </filter>
     <filter-mapping>
                  <filter-name>hibernateFilter</filter-name>
                  <url-pattern>*.mmg</url-pattern>
     </filter-mapping>
     <filter-mapping>
                 <filter-name>hibernateFilter</filter-name>
                <url-pattern>/*</url-pattern>
     </filter-mapping>

 

暂时就配置这么些,如果还有什么其他配置,欢迎各位留言。将及时添加!!!

Python实现多元线性回归(Multiple Linear Regression) 多元线性回归是一种用于建立多个自变量与因变量之间关系的统计学方法。在多元线性回归中,我们可以通过多个自变量来预测一个因变量的值。每个自变量对因变量的影响可以用回归系数来表示。 阅读详情

相关推荐

Matlab_Marr小波尺度变换图

多尺度的连续小波变换分解后时间尺度图 墨西哥Marr小波函数: %delta 小波变换尺度 %N     小波函数的长度 %s     原始信号 %g     原始信号某个尺度下的小波变化系数 function g=Singularity_Detection(delta,N,s); %保持信号长度 n=length(s); % 构造墨西哥小帽小波函数 for index_x=1

桔色小西瓜 6601

SSH框架web.xml配置详解

Spring的初始化:org.springframework.web.context.ContextLoaderListener在web.xml中配置&lt;listener&gt;    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;&lt;/li...

Zuo__Z的博客 1887

手把手教你用EGM96模型校正DEM数据(含在线工具推荐)

本文详细介绍了如何使用EGM96地球重力场模型校正DEM数据中的高程偏差。通过对比WGS84椭球面与大地水准面的差异,解释了校正原理,并提供了从在线工具快速验证到Python脚本批量处理的全流程实战指南,帮助GIS开发者和数据分析师确保高程数据基准一致,提升空间分析精度。

ttt77的博客 1007

关于SSH框架整合中web.xml文件的配置详解

关于SSH框架整合中web.xml文件的配置详解 首先先贴出web.xml的配置文件源码 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLo

qq_34639724的博客 1508

从零搭建A股量化交易系统:开源框架选型与实战部署指南

本文详细介绍了从零搭建A股量化交易系统的完整流程,重点分析了开源框架VNPY和QMT的选型与实战部署。内容涵盖系统架构设计、策略开发、性能优化及实盘过渡方案,为开发者提供了一套完整的A股实盘量化交易解决方案,助力高效构建稳定可靠的量化交易系统。

sugar的博客 1271

大白映射 宝马Esys编程设码映射、USB设备映射

大白映射,宝马Esys设码编程、USB设备映射

denson0394的博客 4800

SSH对于web.xml的配置

1、针对Struts2的配置<filter> <filter-name>SSH_1</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter><filter-mapping> <filter-name>SSH_1</

勤奋写代码的人 3015

超融合架构实战:如何用3节点搭建企业级分布式存储系统?

本文详细介绍了如何利用3节点搭建企业级分布式存储系统的超融合架构实战指南。从硬件选型、网络配置到存储策略调优,提供了全面的实操建议和性能优化技巧,帮助企业实现高效、弹性的IT基础设施。特别适合需要简化运维、提升存储性能的中型企业参考。

weixin_29200485的博客 325

SSH框架中的配置文件值web.xml

Web.xml     &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schema...

天生我材必有用,千金散尽还复来。 833

Cadence PCB仿真 使用Allegro PCB SI为BRD文件创建通用型IBIS模型的方法图文教程

本文简单介绍使用Allegro PCB SI软件为BRD PCB设计文件中的元器件创建IBIS模型的方法。

fydar的博客 2169

面试真题集(十六):TensorRT基础

TensorRT面试真题解析:从模型优化到推理部署 本文精选了14道TensorRT面试题,涵盖选择题、简答题和场景题,深度考察推理工程师对TensorRT核心技术的理解。内容聚焦三个关键维度: 基础概念 FP16推理中Softmax层为何需保持FP32(数值稳定性) INT8校准原理(EntropyCalibrator2的鲁棒性优势) Plugin V3接口的构建/运行分离设计 性能优化 Conv-BN-ReLU融合减少40-60%延迟的关键机制(访存优化) 动态Shape配置策略(min/opt/max

PeterPan的博客 71

SSH框架web.xml的基本操作

前言 作为小白,最近在学ssh框架,当看到web.xml编写时脑袋就有点懵,花了点时间看了看别人的代码,对此做一个总结。 web.xml的作用 在一个web中,web.xml是非必须的。而web.xml是用来干什么的呢??它是用来配置欢迎页、servlet、filter、struts配置文件等的。当你的web工程用不上他们,就不需要配置web.xml文件。 第一步编写web-app 每一个web....

fresh_uncle的博客 411

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

SSH(spring、struts2、hibernate)三大框架整合

SSH(spring、struts2、hibernate)三大框架整合前言:使用SSH三大框架也很久了,框架的配置方法很多,使用最多的两种方法莫过于注解版( annotation )以及配置版(xml),其中我认为比较麻烦的当属配置版,其中需要配置的内容很多,而且有些细节部分需要格外注意,所以今天就和大家来分享一下。 声明:本文只是个人见解,所以有不对之处,希望大家指正。下面就开始来配置吧! 首

wxw1997a的博客 2646

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

SSH三大框架整合问题--Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

最近在做三大框架的整合的项目时,发现一个比较“神奇”的问题,会报一下错误。 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; ...

凌夜知惜 1844

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

手动配置三大框架整合,Spring+Struts2+Hibernate

运用三大框架,使用MyEclipse帮我们导入jar包会发现有些包冲突了或者有些包是多余的,让我们来手动配置三大框架吧! 1、下载三大框架的必备的jar包,下载地址:http://download.csdn.net/detail/harderxin/4420066 2、新建一个web工程SSHTest,将jar包导入到工程中,注意导入进去后在WEB-INFO目录的lib文件夹中要有相应的jar...

web开发自学 90

【spring之SSH框架整合】

目录前言SSH整合思路配置pom.xml,web.xmlpom.xmlweb.xml配置spring与hibernate的相关配置spring-context.xml (中间配置)spring-hibernate.xml (数据库相关配置)spring-book.xml (book模块的spring控制注入)struts框架的配置文件struts-base.xmlstruts-sy.xmlstru...

旺旺的博客 437

三大框架SSH(struts2+spring+hibernate)整合时相关配置文件的模板

最近在学SSH三大框架的整合,在此对他们整合时相关配置文件做一简单的模板总结,方便以后复用! 首先是web.xml配置文件,这里面就配置一些简单的监听器、过滤器,包括spring核心配置文件applicationContext.xml的路径: web.xml [html]view plaincopy <spanstyle="font-si...

weixin_30682415的博客 66

SSH框架搭建

一。加入struts21.在pom.xml中加入struts2的依赖  <dependency>     <groupId>org.apache.struts</groupId>     <artifactId>struts2-core</artifactId>     <version>2.5.13</version&...

weixin_30378311的博客 85

eclipse搭建SSH全面了解

struts Spring Hibernate 的jar包官网下载地址 Struts 1/2 : http://people.apache.org/builds/struts--可以下载Struts 1/2 版本   spring 可在下载你需要的版本: http://www.springsource.org/download hibernate : http://sourcefo

mike_caoyong的专栏 1945

ssh框架整合流程

<br />   ssh框架配置流程---------<br />第一步:在web.xml文件中加入配置,为了加载applicationContext.xml文件,这里是默认加载的 <br /><listener><br /><listener-class><br />          org.springframework.web.context.ContextLoaderListener<br /></listener-class><br /></listener><br /><br />第2步:在s

wangjq_123456的专栏 1024

SSH整合

思路 今天我们讲的是将ssh 也就是 struts spring hibernate 进行一个整合 web+spring+struts+hibernate+杂鱼 1、导入所需要的pom依赖 2、几大框架的配置文件(web.xml/struts.xml、hibernate的配置、spring的配置) 3、spring与hibernate整合桥接的配置文件替换掉了hibernate.cfg.xml s...

weixin_45092983的博客 209

linux ssh环境,linux中SSH环境搭建详解

SSH环境搭建虽然不简单但是只要一步步来操作配置也是可以快速完成了,我们来看一篇关于linux中SSH环境搭建详解吧,具体如下。Struts部分web.xml中配置:struts2org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterclasspath:struts.xml配置Spring部分web.xml中配置W...

weixin_39583013的博客 230

spring,hibernate,struts2三大框架的整合秘籍

ssh三大框架的整合: 1.web.xml文件: 使用上下文参数指定spring配置文件的位置 contextConfigLocation classpath:applicationContext*.xml 配置spring框架的监听器 org.springframework.web.context.ContextLoaderListener 配置过滤器,sp

yzl127的博客 278
上一篇: 关于hibernate反响映射文件的总结
下一篇: hibernate中的几种映射方式
ff55c
博客等级 码龄18年 13粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值