Coder Social home page Coder Social logo

Comments (3)

codingXiaxw avatar codingXiaxw commented on June 16, 2024

1.是在BaseServlet中将servlet的转发、重定向进行了封装,等你以后学习了Spring框架,查看它的源码时会发现它也是这么做的。
2.封装后需要注意:1.在servlet中return填写相应的jsp名(可以参考我servlet中的代码)。2.在提交表单时,若method=post,那么需要在

的下面填入一个,作用就是在url后加入一个隐藏的method="servlet中对应的方法名,不需要加括号"的参数。估计你就是错在这里,忘了加上这样一个hidden的input标签。

希望这样的解答对你有所帮助。

from customermanagement.

wanghaojie1997 avatar wanghaojie1997 commented on June 16, 2024

Duplicate of # @codingXiaxw 想问一下invoke()方法中的this指的是什么,是BaseServlet这个类么,那么图中第二行中的this又是指的哪个对象,如果是这样,那么invoke()方法会返回对应的jsp么?谢谢了

from customermanagement.

codingXiaxw avatar codingXiaxw commented on June 16, 2024

@wanghaojie1997 invoke()属于Java反射中的方法,你网上搜一下Java反射中Method类的invoke()方法就了解了

from customermanagement.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.