Javaweb Learning 008-Today's issue (non-null validation not yet resolved) 2016-12-2

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.