A frame for MVC

高频电磁场仿真-主题064-伴随变量法与灵敏度分析 在电磁器件优化设计中,梯度信息对于指导优化方向至关重要。考虑一个典型的电磁优化问题: 其中 p=[p1,p2,...,pn]Tp = [p_1, p_2, ..., p_n]^Tp=[p1​,p2​,...,pn​]T 是设计参数向量(如几何尺寸、材料参数等)。传统有限差分法的困境:示例: 一个具有100个设计参数的天线优化问题伴随变量法(Adjoint Variable Method, AVM)通过引入伴随场,将梯度计算复杂度从 O(n)O(n)O(n) 降低到 O(1)O(1)O(1):伴随变量法在计算 阅读详情

    Last time, I tried to make a speech about how to design a MVC frame by oneself in our software club. However, Neo pointed out the
difference between MVC and MVP: in MVC, C will never know about the V and it will never modify the V.
Though I don't think we should care much about whether webwork&struts are MVC or MVP frames,but at east ,MVC isfunny. Is it right?
    And also, I have made my frame be more likely a MVC frame.
    We will need two jsp files, a java class as model, and a java class as control.

    Let's come to model first:
    The model is a simple javabean,in fact the base class Model have a field for view. But customer using it don't have to know that,
    they just need to define the fields which will be the data showing in the view.

     //configurate the interceptors
@InterceptorsRef(interceptors = {ExceptionInterceptor.class ,ModelInterceptor.class})
//point out control for the model;
@ControlRef(clazz =UserControl.class)
public class UserModel extends Model
{
    private User user = new User();//A javaBean User
    private String people = "";//people

    public String getPeople()
    {
        return people;
    }

    public void setPeople(String people)
    {
        this.people = people;
    }

 

    public User getUser()
    {
        return user;
    }

    public void setUser(User user)
    {
        this.user = user;
    }
}


    next is  the control class:


    public class UserControl extends Control
{
    private UserModel model;
    private Logger log = Logger.getLogger("debugLogger");

    public void setModel(Model model)  //you should set the data model into the control;
    {
        this.model = (UserModel) model;
    }


    public void process()
    {
        User user = model.getUser(); //get the User from the model
        Integer age = user.getUserAge();
        if (age != null)
        {
            age += 100;
            user.setUserAge(age);
        }
        user.setUserName(user.getUserName() + "+ processed");
        user.setUserTitle(user.getUserTitle() + "+ processed");//change the value of User
        model.setPeople(model.getPeople() + " processed");//change the value of people
        model.setResult(Result.jsp("result.jsp"));//change the result of the model
    }
}

    and then we will come to the view:
    
     the input view:

 <!--"UserModel" means the class name of the model, and "process" means which method  of the control will be invoked  -->
     <form action="UserModel-process.do" method="post">
    <table width="30%">
        <tr>
            <td>user name:<input type="text" name="user.userName"></td>
        </tr>
        <tr>
            <td>user age:<input type="text" name="user.userAge"></td>
        </tr>
        <tr>
            <td>user title:<input type="text" name="user.userTitle"></td>
        </tr>
        <tr>
            <td>people:<input type="text" name="people"></td>
        </tr>

        <tr>
            <td>
                <input type="submit" value="process">

            </td>
        </tr>
    </table>
</form>

      and then it will come to the result view:

        <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  <%@ taglib uri="/WEB-INF/simple-property.tld" prefix="simple" %>
  <html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>Simple jsp page</title></head>
      <table>
          <tr>
              <td>user name:<br><font color="green"><simple:property  property="user.userName"/></font></td>
          </tr>
          <tr>
              <td>user age:<br><font color="green"><simple:property  property="user.userAge"/></font></td>
          </tr>
          <tr>
              <td>user title:<br><font color="green"><simple:property  property="user.userTitle"/></font></td>
          </tr>
          <tr>
              <td>people:<br><font color="green"><simple:property  property="people"/></font></td>
          </tr>
      </table>
</html>


    I don't think this kind of frame is a real MVC frame: the control will never modify the data of the view. and the view will never know the
control.
    And at least, we can easily tell that which's the model,which's the view,and which's the control.
    After I developed the frame, and tried to use it for sereval times. I found that, in fact, about struts:the model is the ActionForm,the control
is the Action, and the jsp files is the View. The difference is that, the model was put in the control,and the View directly specifies it's control.
Its design make it more easily to be used,but less clearly to be understand.

 

 


   
   

【Codex】Codex安装+DeepSeek API接入;无需登录,手把手带你使用codex 好多人使用codex时都卡在验证码登录那一步,今天就来介绍一种方法,不需要登录ChatGPT的账号,自然也就不需要手机验证码了;接入DeepSeek的api,一样可以丝滑使用codex;记录从零开始安装使用codex以及DeepSeek API接入的整个过程。不需要登录openAI; 阅读详情

相关推荐

【CV论文精读】【协同感知综述】Collaborative Perception for Autonomous Driving :Current Status and Future Trend

感知是自动驾驶系统的关键模块之一,近年来取得了很大进展。然而,单个车辆的有限能力导致感知性能提高的瓶颈。为了突破个体感知的局限,协作感知被提出,它使车辆能够共享信息来感知视线和视野之外的环境。本文综述了有前途的协作感知技术的相关工作,包括介绍了基本概念,概括了协作模式,总结了协作感知的关键要素和应用。最后,我们讨论了这一研究领域面临的挑战和问题,并给出了一些潜在的进一步方向。

weixin_44184852的博客 4690

【Python】(pandas错误):ValueError: Cannot index with multidimensional key

问题出现情景: 读取DataFrame中某一行,并进行value_counts()。 print(df['Layout'].value_counts()) 打印出来的如下 2室1厅 9485 3室1厅 3999 3室2厅 2765 1室1厅 2681 2室2厅 1671 4室2厅 930 1室0厅 499 4室1...

YYIverson的博客 1万+

告别迷茫!用C#和Windows.Devices.Bluetooth搞定BLE设备连接与数据收发(附完整代码)

本文详细介绍了如何使用C#和Windows.Devices.Bluetooth命名空间实现BLE设备连接与数据收发。从开发环境配置到设备扫描、服务发现、数据通信及资源管理,提供完整代码示例和实战技巧,帮助开发者快速掌握低功耗蓝牙开发,解决连接稳定性和异常处理等常见问题。

weixin_29248653的博客 505

几个错误的解决关键

导读:   1、   org.springframework.orm.ObjectRetrievalFailureException: Object of class [com.xindeco.myregister.pojo.MyRegisterInfo] with identifier [14]: not found   MyRegisterInfo在数据库没有identifier [1

我的世界我的梦 3万+

基于Sentinel-2(哨兵2)遥感卫星的植被覆盖度提取

基于Sentinel-2(哨兵2)遥感卫星的植被覆盖度提取 一、Sentinel-2简单介绍 哨兵-2系列卫星的主要载荷多光谱成像仪拥有13个谱段,从可见光到近红外再到短波红外,空间分辨率从10m到60m,能实现全所未有的陆地海洋监测水平。其幅宽高达290KM,且A、B双星组合,覆盖能力比美国Landsat8卫星强很多。目前哨兵-2A和哨兵-2B已经实现了5天的重访时间,即使在之前仅有单颗卫星时,...

weixin_44143671的博客 2万+

VXLAN技术详解

VXLAN(虚拟可扩展局域网)是一种Overlay二层虚拟化技术,通过MAC-in-UDP封装在IP网络上构建大规模虚拟二层网络。核心组件包括VTEP(隧道端点)、24位VNI(支持1600万个虚拟网络)和VXLAN网关。相比VLAN,VXLAN具有超大规模扩展、跨三层互联、支持虚拟机无缝迁移等优势,适用于云数据中心多租户隔离、跨数据中心互联等场景。其基于IP路由的封装方式无需改造物理网络,为现代云网络提供了弹性、安全的虚拟化解决方案。

kjkdd的博客 595

php解析特定格式的文本

解析文本文件格式如下 id name 1,peter 2,leo 6,wang 实现目的可以修改任一行的值(逗号后面) 增加新值 删除 [code="php"] [/code]

iteye_5530的博客 258

基于线性光耦HCNR200的高压直流采样电路设计与精度优化

本文详细介绍了基于线性光耦HCNR200的高压直流采样电路设计与精度优化方法。针对直流高电压测量中的安全与干扰问题,提出采用HCNR200光耦隔离方案,实现高精度线性传输。文章深入解析电路设计关键细节,包括电阻网络、运放选型、滤波电容配置等,并提供精度优化实战技巧与常见问题排查指南,助力新能源电动汽车和高压储能系统的高压直流采样应用。

weixin_42713608的博客 580

php读取txt写入多维数组,如何在PHP中将这个简单的文本块解析为多维数组?

我有一个简单的文本块;而且,其内容是:txt_1(val_1,val_2,val_3).txt_1(val_4,val_5,val_6).txt_2(val_7,val_8,val_9).txt_3(val_10,val_11,val_12).txt_3(val_13,val_14,val_15).txt_4(val_16,val_17,val_18).并且,在PHP代码中已经存在一个简单的数组:...

weixin_36121198的博客 198

AI产品经理面试宝典第94天:RAG知识库构建与预处理策略面试指南

本文深入解析RAG知识库构建的核心挑战与预处理策略,涵盖文档格式转换、问答对生成及自动化测试全流程,为AI产品经理提供面试必备的实战方法论与避坑指南,助你精准应对技术深度类问题。

打造全国最全的AI Agent开发知识领域的博客 312

AutoSAR系列讲解(入门篇)1.2-AutoSAR概述

这里主要说明了AutoSAR是个什么,还有其工具链

雪云飞星的博客 5万+

txt转换php格式文件,php - 将格式不正确的txt转换为csv

我觉得爆炸不会在这里做。我建议使用regexp。举例来说,如果你读的.txt文件作为一个字符串(数据串用\ n分隔):$f = fopen($fname="file.txt", "rt");$str = fread($f, filesize($fname)));fclose($f);然后使用preg_match_all()这样的:$re = "/^(\\d+)\\s*(.*)(LODI)\\s*(...

weixin_35422230的博客 439

PowerShell 升级到 v7 并设置为默认版本(详细操作指南)

本文详细介绍了如何将PowerShell升级到v7并设为默认版本。PowerShell 7基于.NET Core构建,具有跨平台支持、性能优化和新语法特性等优势。文章提供了多种安装方法(MSI安装包、包管理器)和设置默认版本的方案(修改PATH、创建符号链接、配置编辑器等),同时涵盖企业批量部署解决方案和常见问题处理。通过升级到PowerShell 7,用户可以获得更强大的命令行体验,适用于开发、运维和自动化场景。

huluang的专栏 4297

PHP中时间详解

date_default_timezone_set('Asia/Shanghai'); //设置时区 一、格式化时间函数date ,返回string  @params  String date(string $param1,int $time) 1.date函数  (对比printf、sprintf 函数) date('时间格式'[,'时间戳']);     date('Y-m

hsd2012的专栏 1110

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

php表单生成txt文件,php提交过来的数据生成为txt文件

一共两个文件,具体链接数据库的部分给直接去除了,前台是提交的文字部分,一行一个,在提交后另一个程序文件进行处理,然后按照提交的文件名生成相应的txt 文件,并在txt 文件中加入数据,在使用之前需要先在根目录下新建 test 文件下。前台表单文件如下(保存为dcwz.php):error_reporting(0);//require_once("../config.php");//require_...

weixin_39914868的博客 244

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

PHP 读写文件操作实例

PHP 读写文件操作实例 博客分类: Thinking of PHP PHPFP      PHP 读文件内容,此文件为txt,路径$filePath为'list.txt', 即放在和php文件同一个目录,     注意:           本人的txt的内容样式如下:                   Email,FirstName,LastName...  

lynxzong的专栏 1618

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

php按行读取数据,php按行按长度读取txt数据并存储到mysql

58131 2012 041181603358--------------- 278 4------------------------------------------------------------------------------------------------------------------------------------------------------...

weixin_39795971的博客 161

php时间戳加一天格式怎么写,格式化时间戳,时间加一天

一,PHP时间戳函数获取指定日期的unix时间戳 strtotime(”2009-1-22″) 示例如下:echo strtotime(”2009-1-22″) 结果:1232553600说明:返回2009年1月22日0点0分0秒时间戳二,PHP时间戳函数获取英文文本日期时间 示例如下:便于比较,使用date将当时间戳与指定时间戳转换成系统时间(1)打印明天此时的时间戳strtotime(”+1 ...

weixin_35964207的博客 420

php 获取json keys,如何读取文本并获取字符串以转换JSON文件php

尝试使用像这样的正则表达式://helpfull functionfunction preg_grep_keys( $pattern, $input, $flags = 0 ){$keys = preg_grep( $pattern, array_keys( $input ), $flags );$vals = array();foreach ( $keys as $key ){$vals[$ke...

weixin_39613548的博客 299

php 从文件中读取匹配条件字符串

案例描述: 找出文本文件(input.txt)中所有符合下面条件的字符 1. 是一个小写字母,并且 2.两侧各有且只有三个大写字母(考虑换行符) 例如xAAAbAAAd中的b 首先在同级目录下创建input.txt 然后在文件中,敲一些英文字母(可以有规律,也可以无规律) 如:asadfsaxAAAbAAAdRYTaASD 再创建一个php文件 代码如下: <?php head

json_li的博客 3682

php 点阵 汉字,PHP 文字生成点阵图

七夕到了是不是该做点什么了~体验地址[2019-7-31 更新]做了个包~~composer require jc91715/lattice -vvvuse Jc91715\Lattice\Lattice;$str="helloworld";$lattice = new Lattice($str,5);echo $lattice->getResult();$font_width = 16; ...

weixin_39916511的博客 427

php正则表达式替换ubb,自定义ubb代码,preg_replace()函数的一些代码

自定义ubb代码,preg_replace()函数的一些代码更新时间:2007年03月20日 00:00:00 作者:functionubb($Text){$Text=htmlspecialchars($Text);$Text=ereg_replace("\r\n","",$Text);$Text=ereg_replace("\r","",$Text);$Text=nl2br($Text)...

weixin_36046702的博客 269

php使用正则函数使用详解

1. int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] ) <?php $title = "Replacement Canon BP-511 Camcorder Battery [Item ID:3-236...

weixin_30502157的博客 58

PCA9422+STM32L081CB超低功耗电源架构设计

超低功耗嵌入式电源管理核心在于硬件级通路隔离与纳安级待机协同。传统集成PMIC受限于寄生漏电与通用设计,难以稳定实现500nA级待机;而专用电源开关芯片(如PCA9422)通过纯硬件负载切断、可编程UVLO及零固件架构,将静态电流压至60nA;搭配具备Stop模式340nA、独立VREF+和SRAM2保留能力的超低功耗MCU(如STM32L081CB),可构建控制层(软件调度)与执行层(硬件断电)物理分离的双模电源体系。该方案广泛适用于电池供电的工业传感器节点、边缘AI终端及长寿命物联网设备,兼顾毫秒级唤醒

weixin_33861800的博客 201

PHP开发的UBB功能

//需要的朋友转载请保留以下信息//版权所有alpsboy@gmail.com  欢迎转载//首次发布在 http://blog.youkuaiyun.com/alpsboy//实现了大多UBB tag的功能,使用时将本代码包函到相关页面,直接调用$ubb->parse()即可 function statics($content){  $tags = array (    "b","i","u","s

tv214的专栏 748

php txt转sql, mysql命令行查出来的结果转化为sql语句 navicat copy rows as Insert SQL功能

recharge表查出来的结果如下: +-------+-----+-------+----------------------------+------------------+--------+------+--------+---------------------+---------------------+-------+ | id | uid | money | type ...

fareast_mzh的博客 560
下一篇: [原]近一年的J2EE历程(从2005.4~2006.2的总结)
Wingel
博客等级 码龄23年 26粉丝 35原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值