In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
WebServlet (name = "httpServletDemo", urlPatterns = "/ httpServletDemo", initParams = {@ WebInitParam (name = "name", value = "username"), @ WebInitParam (name = "mobile", value = "1232423434")}) @ Controllerpublic class HttpServletDemo extends HttpServlet {@ Override protected void doGet (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {String name = getInitParameter ("name"); String mobile = getInitParameter ("mobile") System.out.println ("name:" + name+ "; mobile:" + mobile); resp.getWriter (). Print ("this is a demo"); resp.setStatus;} @ Override protected long getLastModified (HttpServletRequest req) {return super.getLastModified (req);} @ Override protected void doHead (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doHead (req, resp) } @ Override protected void doPost (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doPost (req, resp);} @ Override protected void doPut (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doPut (req, resp);} @ Override protected void doDelete (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doDelete (req, resp) } @ Override protected void doOptions (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doOptions (req, resp);} @ Override protected void doTrace (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.doTrace (req, resp);} @ Override protected void service (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {super.service (req, resp) } @ Override public void service (ServletRequest req, ServletResponse res) throws ServletException, IOException {String name = getInitParameter ("name"); String mobile = getInitParameter ("mobile"); System.out.println ("name:" + name+ "; mobile:" + mobile); super.service (req, res);}}
Spring boot startup class
SpringBootApplication@EnableEurekaClient@ServletComponentScan (basePackages = {"com.example.demo.filter", "com.example.demo.interceptor", "com.example.demo.servlet"}) public class SpringWebDemoApplication {public static void main (String [] args) {SpringApplication.run (SpringWebDemoApplication.class, args);}}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.