(Struts2学习篇) Struts2配置文件之 struts-default.xml

Struts2的常见配置,配置XML的提示,Struts2的配置文件 例如struts-default包配置了abstract="true"的 包 所以才能被其他继承四、< Action> 的配置在这个部分总结了2019年到目前为止Java常见面试问题,取其面试核心编写成这份文档笔记,从中分析面试官的心理,摸清面试官的“套路”,可以说搞定90%以上的Java中高级面试没一点难度。本节总结的内容涵盖了:消息队列、Redis缓存、分库分表、读写分离、设计高并发系统、分布式系统、高可用系统、SpringCloud微服务架构等一系列互联网主流高级技术的知识点。 阅读详情

对struts-default.xml的一些注释

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
	<!-- 
		package:是struts2框架底层提供出来的
			* name:用于让其他包来继承的
			* abstract:设置为抽象包,下面不能定义action标签
	 -->
    <package name="struts-default" abstract="true">
        <!-- 
        	result-types:声明结果类型
        		* name:结果类型的名称
        		* class:结果类型对应类的完整路径
        		* default:设置其为默认,true是默认
         -->
        <result-types>
            <!-- 转发到action -->
            <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
            <!-- 转发到jsp -->
            <result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
            <result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
            <result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
            <!-- 重定向到jsp -->
            <result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
            <!-- 重定向到action -->											  
            <result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
            <!-- 用于下载 -->
            <result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
            <result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
            <result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
            <result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
        </result-types>

		<!-- 
			interceptors
				* interceptor:声明拦截器
					* name:拦截器的名称
					* class:对应拦截器类的完整路径
		 -->
        <interceptors>
            <interceptor name="alias" class="com.opensymphony.xwork2.interceptor.AliasInterceptor"/>
            <interceptor name="autowiring" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"/>
            <interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
            <interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
            <interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
            <interceptor name="clearSession" class="org.apache.struts2.interceptor.ClearSessionInterceptor" />
            <interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
            <interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
            <interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
            <interceptor name="exception" class="com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor"/>
            <interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
            <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
            <interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
            <interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
            <interceptor name="scopedModelDriven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
            <interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
            <interceptor name="actionMappingParams" class="org.apache.struts2.interceptor.ActionMappingParametersInteceptor"/>
            <interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
            <interceptor name="staticParams" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
            <interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
            <interceptor name="servletConfig" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
            <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
            <interceptor name="token" class="org.apache.struts2.interceptor.TokenInterceptor"/>
            <interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
            <interceptor name="validation" class="org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor"/>
            <interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
            <interceptor name="store" class="org.apache.struts2.interceptor.MessageStoreInterceptor" />
            <interceptor name="checkbox" class="org.apache.struts2.interceptor.CheckboxInterceptor" />
            <interceptor name="profiling" class="org.apache.struts2.interceptor.ProfilingActivationInterceptor" />
            <interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />
            <interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />
            <interceptor name="multiselect" class="org.apache.struts2.interceptor.MultiselectInterceptor" />

            <!-- Basic stack -->
            <interceptor-stack name="basicStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="servletConfig"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="multiselect"/>
                <interceptor-ref name="actionMappingParams"/>
                <interceptor-ref name="params">
                    <param name="excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*</param>
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
            </interceptor-stack>

            <!-- 
            	interceptor-stack:拦截器栈
            		* struts2框架通过使用拦截器栈,进而使用上面声明好的拦截器
            		* 在拦截器栈里面,存放了一些上面声明好的拦截器
            		* 拦截器栈相当于一个list集合,执行的时候是按照存放的先后顺序来执行
             -->
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servletConfig"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="scopedModelDriven"/>
                <interceptor-ref name="modelDriven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="multiselect"/>
                <interceptor-ref name="staticParams"/>
                <interceptor-ref name="actionMappingParams"/>
                <interceptor-ref name="params">
                    <param name="excludeParams">dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*</param>
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="debugging"/>
            </interceptor-stack>

       </interceptors>

		<!-- 配置在struts2框架运行时,默认要执行的是哪个拦截器栈,defaultStack -->
        <default-interceptor-ref name="defaultStack"/>

		<!-- 配置在struts2框架运行时,如果没有为action指定class的话,默认要执行的class的类名 -->
        <default-class-ref class="com.opensymphony.xwork2.ActionSupport" />
    </package>

</struts>


 

struts-default.xml 立即下载

相关推荐

struts2中的struts-default.xml

struts2中的struts-default.xml

struts-default.xml文件详解

struts-default.xml是Struts 2 框架的基础配置文件,为框架提供默认设置,这个文件包含在Struts2-core-2.0.11.jar中,由框架自动加载。 struts-default.xml文件会自动被包含在struts.xml文件中,以提供标准的配置设置而不需要复制其内容。我们在配置strut.xml文件时,给出了下面这句代码 struts-default.xml

Faith的博客 7623

四、SVN客户端tortoiseSVN的基本功能介绍

档案浏览器(Repo-browser) 鼠标右键–>tortoiseSVN->版本库浏览器 输入版本库URL地址,进入如菜单界面 版本库浏览器支持SVN及http两种最常用的通信协议 SVN服务器访问方式 方法 模式 访问方法 File:// 直接版本库访问(本地磁盘) http:// 通过配置subversion的WEB服务器的WEBDAV协议 http...

也许是我送你哦 1014

struts2的默认配置文件struts-default.xml

一、struts2配置文件 (一)struts2的默认配置文件struts-default.xml在struts2-core-XX.jar包的最下面 (二)struts2配置文件中标签的含义 1、package定义一个包。 包作用,管理action。(通常,一个业务模板用一个包)   常见属性及其说明: (1)name 包的名字;以方便在其他处引用此包,此属性是必须的。 包名不能重复;...

qq30211478的博客 1742

PyTorch实战:3D U-Net医学图像分割从零搭建(附完整代码)

本文详细介绍了如何使用PyTorch从零搭建3D U-Net模型进行医学图像分割,涵盖三维卷积实现、模块化架构设计、医学图像专属优化策略及完整训练流程。通过实战代码演示,帮助开发者掌握UNet-3D在CT、MRI等三维医学图像分割中的应用,提升肝脏肿瘤分割、肺结节检测等任务的准确性。

weixin_29061997的博客 339

手把手教你用Wireshark国密版分析TLCP和IPSec协议(附下载地址)

本文详细介绍了Wireshark国密版在TLCP和IPSec协议分析中的实战应用,包括环境配置、协议解析、合规性检查及高级分析技巧。该工具针对商用密码算法(如SM2/SM3/SM4)进行了专项优化,支持GB/T 38636-2020 TLCP和GB/T 36968-2018 IPSec VPN等国家标准,帮助开发者与安全工程师高效完成密评分析任务。

weixin_29325955的博客 560

Struts2配置详解

总揽 Struts2的配置文件是以XML的形式出现的。不过它的XML的语义比较简单,下面是我抽取了位于struts2-core-2.0.14.jar内部的struts-default.xml的片段: Xml代码 &lt;struts&gt; &lt;beanclass="com.opensymphony.xwork2.ObjectFactory"name="xwork"...

javasogo 232

【Dify】36氪新闻热榜智能自动化采集与AI处理

本文介绍如何利用Dify等自动化工具实现36氪新闻热榜的智能采集与处理。通过HTTP请求节点获取数据,JSON解析节点结构化处理,AI处理节点生成智能摘要,最终格式化输出结果。工作流程包含数据获取、解析、AI摘要、文本整理和内容输出五个环节,支持批量化、定制化的新闻处理需求。该方案适用于行业监测、内容创作、舆情管理等场景,显著提升信息获取效率,实现"所需即得"的自动化新闻服务。系统采用OpenAI GPT和Dify API作为核心模型,无需复杂人工干预即可完成全流程处理。

Mr数据杨 608

Struts2中有关struts-default.xml,struts.xml,struts.pro

学习Struts2也有一段时间了,早就想写一些关于它的文章,可由于自己太懒了,不想动手去写,最近看到blogjava中一位叫max的大侠写的struts2专栏很不错,使我更不想写了(有点自卑啊,呵呵)。但这段时间自己实在也太无聊了,于是还是写写吧。 每学习一个框架,我们都免不了要学习一些关于的配置文件,struts2也不例外,下面我就讲一下struts2中几个主要的配置文件。 ...

flustar 208

代谢组数据分析(二十六):LC-MS/MS代谢组学和脂质组学数据的分析流程

本教程概述了LC-MS/MS在代谢组学和脂质组学数据分析中的应用流程。首先介绍了样本的采集、提取和LC-MS/MS分析,随后详细阐述了质谱数据的预处理、峰值识别、特征注释,以及数据标准化和统计分析的重要性。特别强调了使用XCMS和CAMERA进行数据对齐和加合物识别,以及利用MultiABLER和LipidFinder进行数据过滤、插补和标准化处理。此外,还介绍了如何应用EigenMS算法进行数据标准化,以及如何使用Limma包进行差异分析。整个流程旨在提高数据质量,确保分析结果的准确性和可靠性,为后续的生

专注生信领域 1983

配置 SAP Fiori 服务的 ICF 节点:从 SICF 激活到访问链路打通的完整实践

在SAP Fiori项目实施中,ICF节点配置是关键前置条件却常被忽视。ICF(Internet Communication Framework)作为HTTP请求入口,需要通过SICF事务码激活相关服务节点,否则即使应用开发完善,用户仍可能遇到页面无法访问等问题。典型问题表现为:磁贴可点击但页面空白、资源加载失败等。激活路径主要涉及三组节点:bsp分支下的管理入口、ui5_ui5分支下的应用资源,以及public/bc下的公共资源。项目实施中需特别注意同名服务在不同分支下的差异化作用,确保完整链路通畅。IC

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 290

Struts2中有关struts-default.xml,struts.xml,struts.properties文件详解

学习Struts2也有一段时间了,早就想写一些关于它的文章,可由于自己太懒了,不想动手去写,最近看到blogjava中一位叫max的大侠写的struts2专栏很不错,使我更不想写了(有点自卑啊,呵呵)。但这段时间自己实在也太无聊了,于是还是写写吧。        每学习一个框架,我们都免不了要学习一些关于的配置文件,struts2也不例外,下面我就讲一下struts2中几个主要的配置文件。 1...

winie 257

C# WPS操作PPT,全屏,缩率图,备注,跳转播放

本文介绍了一个使用C#开发的PPT操作工具,主要功能包括检测当前打开的PPT文件、获取选中PPT路径、指定播放PPT、获取PPT页面序号和缩略图、提取备注内容等。文章展示了操作界面效果图,并重点解决了用户手动退出PPT后重新获取路径时报错的问题。核心代码实现了通过WPS API进行PPT文件的打开、全屏播放、页面跳转、获取当前页位置等功能,同时支持生成PPT缩略图预览和备注信息提取。当用户未通过工具按钮打开PPT时,程序会自动初始化PPT信息确保功能正常使用。

遇见--专栏 319

Struts2配置文件、拦截器详解

 Struts2中有关struts-default.xml,struts.xml,struts.properties文件详解       每学习一个框架,我们都免不了要学习一些关于的配置文件,struts2也不例外,下面我就讲一下struts2中几个主要的配置文件。 1) struts-default.xml 这个文件是struts2框架默认加载的配置文件。它定义struts2一些核心的bean和

lilp_ndsc的专栏 2250

BMS控制板硬件设计核心要点与工程避坑指南

电池管理系统(BMS)硬件设计是保障锂电安全与寿命的关键环节,其本质是模拟前端精度、数字控制可靠性、电源完整性及电磁兼容性四大要素的系统协同。理解AFE芯片(如BQ76920)的物理层约束、MCU与专用监控IC的异构分工逻辑,是构建高鲁棒BMS的基础;而晶振布局、I²C总线匹配、MOSFET体二极管方向、开尔文采样等细节,直接决定量产良率与EMC合规性。在电动工具、储能系统、两轮电动车等中低功耗BMS应用中,成本敏感型方案常采用STM32F0+AFE架构,此时电源滤波电容选型、复位电路ESR控制、TVS/齐

weixin_30591519的博客 270

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Struts2配置文件、拦截器等详解

1》redirect:action处理完后重定向到一个视图资源(如:jsp页面),请求参数全部丢失,action处理结果也全部丢失。 2》redirect-action:action处理完后重定向到一个action,请求参数全部丢失,action处理结果也全部丢失。 3》chain:action处理完后转发到一个action,请求参数全部丢失,action处理结果不会丢失。 当使用type

一个角落 2913

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Struts2框架的学习3(Struts-2.5.x)

3.Struts2相关配置文件 在Struts2框架中有几个比较重要的配置文件,学习这个框架那是必须要了解的。 Struts2是一个非常灵活的web应用框架,其中配置文件包括如下: 文件名 文件说明 struts-default.xml 这个配置文件在核心包下 struts-plugin.xml 这个配置文件Struts2提供的各个插件包 struts.xml 这个配置文件...

kenewstar的博客 1031

深度学习工具包 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")

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Struts学习----struts2配置文件详解

struts2配置文件介绍 1. default.properties :用于配置struts 常量。例如:编码 2. struts-default.xml :struts提供的默认核心配置文件,struts大部分功能都在此配置文件中。 3.struts-plugin.xml : struts插件核心配置文件,struts整合其他框架或工具。 * 以上三个文件,用户自...

nonpricklycactus的博客 322

【学习笔记】Struts2之配置文件struts.xml

在默认情况下,Struts2只自动加载类加载路径下的struts.xml.default-struts.xml和struts-plugin.xml三类文件。但是随着应用规模的增大,系统中Action数量也大量增加,将导致struts.xml非常臃肿。为了避免这种这情况,我们可以将struts.xml配置文件分解成多个配置文件,然后在struts.xml文件中包含其他配置文件。被包含的配置...

dinggujiao8462的博客 144

struts2配置文件详解

  每学习一个框架,我们都免不了要学习一些关于的配置文件,struts2也不例外,下面我就讲一下struts2中几个主要的配置文件。   1) struts-default.xml   这个文件是struts2框架默认加载的配置文件。它定义struts2一些核心的bean和拦截器。      "-//Apache Software Foundation//DTD Struts Config

赵晓雷的专栏 8272

struts2中对配置文件struts-default.xml 的解释

每学习一个框架,我们都免不了要学习一些关于的配置文件,struts2也不例外,下面我就讲一下struts2中几个主要的配置文件。 1) struts-default.xml 这个文件是struts2框架默认加载的配置文件。它定义struts2一些核心的bean和拦截器。 <?xml version="1.0" encoding="UTF-8" ?> ...

程序员一代码搬运工 150
上一篇: (Struts2学习篇) Struts2数据校验之二
下一篇: (Struts2学习篇) Struts2文件处理之文件上传
在奋斗的大道
在奋斗的大道 领域专家: 后端开发技术领域 领域专家: 后端开发技术领域
博客等级 码龄15年 6103粉丝 2057原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值