zoukankan      html  css  js  c++  java
  • JAVA知识点必看

    forEach遍历map集合

     由xml解析出类名和方法名执行该方法:

    HelloAction类:

    public class HelloAction {
        public String hello(){
            System.out.println("ms future");
            return "success";
        }
    }

    对应的xml文件:

    <package name="hello" namespace="/hello" extends="struts-default" >    
        <action name="HelloAction" class="cn.itheima.a_hello.HelloAction" method="hello" >
            <result name="success" type="dispatcher" >/hello.jsp</result>
        </action>
    </package>

    执行过程:

    public static void main(String[] args) throws Exception {
            
      Class clazz = Class.forName("class com.future.ms.HelloAction");
      HelloAction helloAction = (HelloAction) clazz.newInstance();
      Method method = clazz.getMethod("hello", null);
      method.invoke(helloAction, null);
    }
  • 相关阅读:
    POJ 1511
    POJ 1125
    POJ 2240
    POJ 1459
    POJ 1274
    POJ 1789
    POJ 2485,1258
    POJ 1236
    POJ 1273
    Ruby on Rails 观后感
  • 原文地址:https://www.cnblogs.com/ms-grf/p/7066758.html
Copyright © 2011-2022 走看看