In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail what to do about the 404 errors after the start-up and operation of the IDEAJavaWeb project. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
404 this mistake is really indescribable! However, most of them are errors in the configuration file, so it is possible to modify them carefully.
1.web.xml configuration error:
If the home page is not written by default, just add one to web.xml (as long as you have a jsp page and the name is not misspelled): for example:
Login.jsp
The 2.IDEA JavaWeb project running could not find the JSP page corresponding to the Servlet mapping
Annotated configuration is provided after servlet3.0 so that it does not need to be configured in web.xml. The annotation configuration of the servlet file generated using IDEA is as follows (first line):
@ WebServlet (value = "/ AdminServlet") public class AdminServlet extends HttpServlet {protected void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost (request, response);} protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {}
For how to configure it, please see:
Path: File > Settings > Editor > File and Code Templates > Other > Web > the editing template on the right side of the second point under Java code templates is as follows (this is my template):
# if (${PACKAGE_NAME} & & ${PACKAGE_NAME}! = ") package ${PACKAGE_NAME}; # end#parse (" File Header.java ") @ javax.servlet.annotation.WebServlet (value =" / ${Entity_Name} ") public class ${Class_Name} extends javax.servlet.http.HttpServlet {protected void doGet (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {doPost (request,response) } protected void doPost (javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {}}
3. Create a project with the same name as the previous project (with the same project name structure), overwrite the previous one and then run 404
The first thing that came to mind was to start looking for something wrong with the configuration file: this is the solution I just found:
The page that jumps after starting and running finds that the page you defined does not report a 404 error, which requires you to look for it in workspace.xml:
Your project name > .idea > workspace.xml, find the name of the jsp that is not your first jump, and modify the jsp name that you defined.
The details are here: just change the name.
This is the end of the article on "what to do if there are 404 errors after the IDEAJavaWeb project starts and runs". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.