A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© REVEBAMBOU 初级黑马   /  2019-5-31 22:42  /  386 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

This week continues to learn servlet and other technology related it, including html, css, javascript, xml, bootstrap, tomcat server and so on. The most import thing I learnt is typing a case, which is login and manager user info. Here requires the following functionality in this case and using these technologies: java+mysql+tomcat
1.        Login including classes (files):
login.jsp, loginServlet, AdminService, AdminServiceImpl, AdminDao, AdminDaoImpl, admin_database
2.        Log out including classes(files): logoutServlet
3.        Serach Users by values and then page the result, including classes (methods):
list.jsp, findUserServlet, User findUserByValues(Map<String, String[]),
4.        Add a user including classes and methods:
add.jsp, addUserServlet, boolean addUser(User user)
5.        Update a user info, including classes and methods:
User showUserInfoById(String id), showUserServlet, update.jsp, updateUserServlet, boolean updateUser(User user)
6.        Delete a user including classes and methods:
delUserServlet, boolean delUserById(String id)
7.        Delete users selected, including classes and methods:
delUsersSelectedServlet, boolean delUsersSelected(String[] ids)
Here also are some issues encountered during studying:
1.        Messy code issues:
Perhaps caused by:
1.        The statement line of jsp is not added in jsp file.
2.        Style files are blocked by filter.
3.        Request stream charset is default.
4.        Response stream charset is default.
2.        Difference between forward and redirect:
1.        Forward is happened in one single request and 2 in redirect.
2.        Forward is able to read the info save in the Attribute, which redirect cannot read it.
3.        The location line is changed when using redirect, which the forward is not.
3. Incorrect object or no object is select when a redundant blank is typed between element object and filter condition, such as:
        div:first (correct one)
        div :first(incorrect): the first child div object is selected, not the first div object is selected.
        4. Why the jsp file is HttpServlet in nature?
-->When the jsp file is parsed/run in java virtual machine, a java file named [jsp Name]_JSP.java is product and the class in the file is extends JavaJspBase class which is extended HttpServlet.

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马