1.
Student Module List page does not jump normally
The Stuid attribute is not found, but I have the same properties as the database table in Entity Stuid;grade module code, but it can run normally
What's the problem?
<c:foreach items= "Slist" var= "Student" >
<tr>
<td>${student.stuid}</td>
<td>${student.stuname}</td>
<td>
<a href= "" > View </a>
<a href= "" > Modify </a>
<a href= "" > Delete </a>
</td>
</tr>
</c:forEach>
Question ①
The Var attribute in the For loop is the object that gets into the loop every time, but where does the object get it? Where is the student object declared?
Get by key of the Items property.
has been resolved
For loop, the Items property is the key obtained from the servlet, the value must be written in the El expression, and then through this key to get the Var property of the object, this is the answer to the above question
2.
The issue of non-null validation is not resolved
The code in the servlet is written like this:
The JSP page code is written like this:
However, the running result cannot implement the non-null validation feature:
Question ①
Should be two setattribute statement problem, can not write two interactive statements, but add the condition to judge or not, first implement other functions, go back to consider how to correctly implement non-null verification
3.
Is it useful to hide the Name property of the primary key? Can you not write it?
① does not write Stuname Name property, cannot complete the modification operation, return blank
② does not write Stuid's name attribute, error, 500.
These two properties are parameters that are passed to the page by the servlet, and if not, you cannot find the corresponding place to pass the value. So it must be written.
4.
Problems with multi-table associated queries:
Is the code wrong? Go back to the check.
The premise is that you did not add the grade column to the Stu table when the table was previously built,
Multi-Table Association query: I remember that, when building a relational model diagram, the ①-->-
Then there is the creation of a table space. This means that even if I, after the original Stu table is deleted, and then re-establish a property and the original, just add a column, you should be able to run. There is no error.
But now the hint STUDENT GID identifier is invalid, what is going on?
Ideas:
① mean the GID column in the Stu table is invalid?
But I'm querying through the GID attribute and I can do it correctly
② the code for the associated query?
This question needs verification, go back to find a book to look at, then come to answer .
==========================================================================================
Javaweb Learning 008-Today's issue (non-null validation not yet resolved) 2016-12-2