Ajax callback function does not execute, JS implementation jump page and pass value, Java Generate ID method, JQ to input assignment __ios

Source: Internet
Author: User
Tags base64 md5 trim uuid sessionstorage

Implementation of the Cloud Notes login and Registration function

Encountered a number of problems summarized.
First, it takes some time to configure the framework. It will be much better after that. The problem with configuring the framework is that you cannot find the Mapper.xml file. I changed it for a long time. Use absolute paths, relative paths, and so on. The Bean was later written and Classpath succeeded. Main Process

After a while I want to specifically write down the process ~

And then write the front end when the Ajax callback function does not execute
Going to crash. It turned out that my HTML file was opened locally and was not put into the project. So the file protocol is open for use, and Java Tomcat is the HTTP protocol. A cross-domain is produced.
as long as the protocol, domain name, port has any one different, are treated as a different domain then Java generates the ID method

     Generate ID public
     static String Createid () {
          uuid  uuid = Uuid.randomuuid ();
          return uuid.tostring ();
     }

The ID of the build process is this:

5fc3c527-6007-4f73-9405-c0e3f67ec3a0

Passwords stored in the database are first MD5 encrypted and then saved to the database using Base64 encoding to prevent coding problems Md5+base64

Package yunnote.util;

Import Java.security.MessageDigest;
Import java.security.NoSuchAlgorithmException;

Import org.apache.commons.codec.binary.Base64;

Import Sun.misc.BASE64Encoder;

/** *
 Encrypted plaintext *
 @author Administrator
 */public
class Noteutil {public
     static String MD5 ( String msg) throws nosuchalgorithmexception{
          messagedigest md =   messagedigest.getinstance ("MD5");
          He handled byte byte
          [] input = Msg.getbytes ();
          byte [] output = md.digest (input);
          MD5 processing output into a string//
          involves coding problems ~ Avoid garbled, using Base64
          //directly with new string (output) will appear garbled
          ///will output into a string
          String mmsg =base64.encodebase64string (output);


          return mmsg;

     }
     public static void Main (string[] args) throws nosuchalgorithmexception{
          System.out.println ("1234") );
     }




}
JS implement jump page and pass value

Baidu, using a number of methods to achieve. Success and Good is sessionstorage.

After registering, jump to the login interface and write the registered user and password into the text box

Register page

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

Login Page

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  

During the encounter can get the stored data, but can not assign value, Baidu found that I assigned to the input is the use of HTML (). You should use Val () Success ~

I have recorded the exact process in the impression notes
Let's take a break. Haven't eaten yet.

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.