zoukankan      html  css  js  c++  java
  • Struts---- <s:bean>标签

    近几天学习的都是跟struts有关的、详细写<s:bean>标签

    具体内容为:

    一、准备工作

     1.新建Web工程

     2.添加struts:右键点击工程名选择My Eclipse-->点击add struts..-->添加struts2.1

    二、编写程序

    1.分别建Action,org.vo两个包(名字可自拟),并在其中编写student实体类和BeanAction。BeanAction中一定要重写方法

    2.Struts中要写如下代码:

    <package name="default" extends="struts-default">
    <action name="login" class="Action.BeanAction">
    <result name="success">index.jsp</result>
    </action>
    </package>

    3.写出jsp代码

    三、注意事项

    1.在运行代码时不能直接运行C层

    2.在浏览器输出http://localhost:8080/Struts/login.action

    3.在jsp页面中必须有<%@ taglib uri="/struts-tags" prefix="s" %>这句话

      心得与得会:在写代码的过程中 不懂一定要问同学与老师,不要自己不会就闷着,不会也要去看别人怎么做,在学习完别个的之后 不要自己抄好就好了,还要重新写过代码,多写几次就渐渐掌握方法。

  • 相关阅读:
    c++ 队列
    17:特殊类成员:函数指针5
    c++ deque 双端队列
    18:字符串-char型字符串
    c++ 16 this 和 继承 及继承机制中的构造函数 与 析构函数
    c++ string char* const char*
    c++ 小片段
    google protobuf 使用示例
    hibernate-cache
    hibernate-criteria查询(二)
  • 原文地址:https://www.cnblogs.com/zhang-miaomiao/p/5332750.html
Copyright © 2011-2022 走看看