Make a simple landing with struts2

Source: Internet
Author: User

Using Strust2 to make a simple landing interface, you can check the username of the login.

Make a login username and password into JavaBean, that is, to encapsulate it.

User class omitted

Loginaction

Struts.xml Configuration

Login Login Interface

Success and Error interface omitted

In this case, I made such a mistake.

Since username and password are encapsulated, the submission of my login interface is written like this

<input name= "username" .................>

This has always been a null pointer exception

I was the first to cancel than the user this code, found to be available, so there is no check the login interface

Then the package class is canceled, the user name and password are written in the action also useful,

But in turn, there's a 500 anomaly.

Later found the page on the submission made a small error

With the user name and password encapsulated, the page's submission should be changed to "property name. Object Name"

Make a simple landing with struts2

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.