Commit 85b5434e by tzn

Java-login

parent a9605977
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<component name="ArtifactManager">
<artifact type="exploded-war" name="javaProject2:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/javaProject2_war_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="javaProject2/web/Web" />
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="javaProject2" />
</element>
</element>
</root>
</artifact>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="javaProject2" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="javaProject2" target="17" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="javaProject2" options="" />
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="test@localhost" uuid="591218a6-654c-4332-a2e7-63f68d72c7e6">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/test</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.alibaba:fastjson:1.2.62">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.62/fastjson-1.2.62-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/alibaba/fastjson/1.2.62/fastjson-1.2.62-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.auth0:java-jwt:3.3.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/auth0/java-jwt/3.3.0/java-jwt-3.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/auth0/java-jwt/3.3.0/java-jwt-3.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/auth0/java-jwt/3.3.0/java-jwt-3.3.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: com.sun.mail:javax.mail:1.6.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: commons-codec:commons-codec:1.11">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.11/commons-codec-1.11-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.activation:activation:1.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: javax.annotation:javax.annotation-api:1.3.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.3.1/javax.annotation-api-1.3.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.3.1/javax.annotation-api-1.3.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.3.1/javax.annotation-api-1.3.1-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: junit:junit:4.12">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-lang3:3.3.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.apache.commons:commons-pool2:2.6.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.6.2/commons-pool2-2.6.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.6.2/commons-pool2-2.6.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-pool2/2.6.2/commons-pool2-2.6.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.slf4j:slf4j-api:1.7.25">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.2.6.RELEASE/spring-boot-2.2.6.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.2.6.RELEASE/spring-boot-2.2.6.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.2.6.RELEASE/spring-boot-2.2.6.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-aop:5.2.5.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.5.RELEASE/spring-aop-5.2.5.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.5.RELEASE/spring-aop-5.2.5.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.5.RELEASE/spring-aop-5.2.5.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-beans:5.2.9.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.9.RELEASE/spring-beans-5.2.9.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.9.RELEASE/spring-beans-5.2.9.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-beans/5.2.9.RELEASE/spring-beans-5.2.9.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-context:5.2.5.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.5.RELEASE/spring-context-5.2.5.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.5.RELEASE/spring-context-5.2.5.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context/5.2.5.RELEASE/spring-context-5.2.5.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-context-support:5.3.14">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context-support/5.3.14/spring-context-support-5.3.14.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context-support/5.3.14/spring-context-support-5.3.14-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-context-support/5.3.14/spring-context-support-5.3.14-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-core:5.3.14">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.3.14/spring-core-5.3.14.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.3.14/spring-core-5.3.14-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.3.14/spring-core-5.3.14-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-expression:5.2.5.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.5.RELEASE/spring-expression-5.2.5.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.5.RELEASE/spring-expression-5.2.5.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.5.RELEASE/spring-expression-5.2.5.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: org.springframework:spring-jcl:5.3.14">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.3.14/spring-jcl-5.3.14.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.3.14/spring-jcl-5.3.14-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jcl/5.3.14/spring-jcl-5.3.14-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="Maven: redis.clients:jedis:3.2.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/redis/clients/jedis/3.2.0/jedis-3.2.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/redis/clients/jedis/3.2.0/jedis-3.2.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/redis/clients/jedis/3.2.0/jedis-3.2.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="mysql-connector-java-8.0.27">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../MySQL/mysql的jar包/mysql-connector-java-8.0.27/mysql-connector-java-8.0.27/mysql-connector-java-8.0.27.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../MySQL/mysql的jar包/mysql-connector-java-8.0.27/ojdbc14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/javaProject2.iml" filepath="$PROJECT_DIR$/javaProject2.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebContextManager">
<option name="state">
<map>
<entry key="file://$PROJECT_DIR$/web/index.jsp" value="file://$PROJECT_DIR$/web" />
<entry key="file://$PROJECT_DIR$/web/register.jsp" value="file://$PROJECT_DIR$/web" />
<entry key="file://$PROJECT_DIR$/web/show.jsp" value="file://$PROJECT_DIR$/web" />
<entry key="file://$PROJECT_DIR$/web/结算.jsp" value="file://$PROJECT_DIR$/web" />
</map>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
<sourceRoots />
</configuration>
</facet>
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" scope="PROVIDED" name="Tomcat 9.0.58" level="application_server_libraries" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/web/WEB-INF/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$MODULE_DIR$/web/WEB-INF/lib" recursive="false" />
</library>
</orderEntry>
<orderEntry type="library" name="mysql-connector-java-8.0.27" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:3.2.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.6.2" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.1" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.auth0:java-jwt:3.3.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.62" level="project" />
<orderEntry type="library" name="Maven: com.sun.mail:javax.mail:1.6.2" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.14" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.14" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.14" level="project" />
</component>
</module>
\ No newline at end of file
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ page import="shopping.*" %>
<%
Cart c = (Cart)session.getAttribute("cart");
if(c == null) {
c = new Cart();
session.setAttribute("cart", c);
}
double totalPrice = c.getTotalPrice();
request.setCharacterEncoding("GBK");
String action = request.getParameter("action");
Map products = (HashMap)session.getAttribute("products");
if(action != null && action.trim().equals("add")) {
String id = request.getParameter("id");
Product p = (Product)products.get(id);
CartItem ci = new CartItem();
ci.setProduct(p);
ci.setCount(1);
c.add(ci);
}
if(action != null && action.trim().equals("delete")) {
String id = request.getParameter("id");
c.deleteItemById(id);
}
if(action != null && action.trim().equals("update")) {
for(int i=0; i<c.getItems().size(); i++) {
CartItem ci = c.getItems().get(i);
int count = Integer.parseInt(request.getParameter("p" + ci.getProduct().getId()));
ci.setCount(count);
}
}
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
List<CartItem> items = c.getItems();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>购物车</title>
</head>
<body>
<!-- c的值是:<%=(c == null) %> items的值是:<%=(items == null) %> -->
<form action="Buy.jsp" method="get">
<input type="hidden" name="action" value="update"/>
<table align="center" border="1">
<tr>
<td>产品ID</td>
<td>产品名称</td>
<td>购买数量</td>
<td>单位价格</td>
<td>总价</td>
<td>处理</td>
</tr>
<%
for(Iterator<CartItem> it = items.iterator(); it.hasNext(); ) {
CartItem ci = it.next();
%>
<tr>
<td><%=ci.getProduct().getId() %></td>
<td><%=ci.getProduct().getName() %></td>
<td>
<input type="text" size=3 name="<%="p" + ci.getProduct().getId() %>" value="<%=ci.getCount() %>"
onkeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;"
onchange="document.forms[0].submit()">
</td>
<td><%=ci.getProduct().getPrice() %></td>
<td><%=ci.getProduct().getPrice()*ci.getCount() %></td>
<td>
<a href="Buy.jsp?action=delete&id=<%=ci.getProduct().getId() %>">删除</a>
</td>
</tr>
<%
}
%>
<tr>
<td colspan=3 align="right">
全部商品总价格为:
</td>
<td colspan=3><%=c.getTotalPrice() %></td>
</tr>
<tr>
<!-- <td colspan=3>
<a href="javascript:document.forms[0].submit()">改动</a>
</td> -->
<td colspan=6 align="right">
<a href="">下单</a>
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Manifest-Version: 1.0
Created-By: IntelliJ IDEA
Built-By: lenovo
Build-Jdk: 17.0.1
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ page import="shopping.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'ShowProductsJSP.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body bgcolor="#ffffff">
<%
Map products = new HashMap();
products.put("1", new Product("1", "mp3播放器",
"效果非常不错的mp3播放器,存储空间达1GB", 100.00));
products.put("2", new Product("2", "数码相机", "象素500万,10倍光学变焦",
500.00));
products.put("3", new Product("3", "数码摄像机",
"120万象素,支持夜景拍摄,20倍光学变焦", 200.00));
products.put("4", new Product("4", "迷你mp4",
"市面所能见到的最好的mp4播放器,国产", 300.00));
products.put("5", new Product("5", "多功能手机",
"集mp3播放、100万象素数码相机,手机功能于一体", 400.00));
products.put("6", new Product("6", "多功能手机111",
"集mp3播放23100万象素数码相机111,手机功能于一体111",600.00));
products.put("7", new Product("7", "11111111111",
"集mp3播放23100万象素数码相机111,手机功能于一体111",700.00));
products.put("8", new Product("8", "2222222222",
"集mp3播放23100万象素数码相机111,手机功能于一体111",800.00));
products.put("9", new Product("9", "33333333333333",
"集mp3播放23100万象素数码相机111,手机功能于一体111",900.00));
session.setAttribute("products", products);
%>
<H1>
产品显示
</H1>
<form name="productForm"
action="http://localhost:8088/JSPlearning/ShopCartJSP.jsp"
method="POST">
<input type="hidden" name="action" value="purchase">
<table border="1" cellspacing="0">
<tr bgcolor="#CCCCCC">
<tr bgcolor="#CCCCCC">
<td>
序号
</td>
<td>
产品名称
</td>
<td>
产品描写叙述
</td>
<td>
产品单位价格(¥)
</td>
<td>
加入到购物车
</td>
</tr>
<%
Set productIdSet = products.keySet();
Iterator it = productIdSet.iterator();
int number = 1;
while (it.hasNext()) {
String id = (String) it.next();
Product product = (Product) products.get(id);
%><tr>
<td>
<%=number++%>
</td>
<td>
<%=product.getName()%>
</td>
<td><%=product.getDescription()%>
</td>
<td>
<%=product.getPrice()%></td>
<td>
<a href="Buy.jsp?id=<%=product.getId()%>&action=add" target="cart">我要购买</a>
</td>
</tr>
<%
}
%>
</table>
<p>
</p>
</form>
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<context-param>
<param-name>encode</param-name>
<param-value>UTF-8</param-value>
</context-param>
</web-app>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 12:49
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>用户登录</title>
<title>login</title>
<%--切换验证码,加载完成后点击验证码图片--%>
<script language="javaScript" src="Js/jquery-3.4.1.min.js"></script>
<script language="JavaScript">
$(function () {
$("#img").click(function () {
$(this).prop("src","checkCodeServlet?id="+Math.random());
});
});
</script>
<%--上述功能为登录验证码部分--%>
</head>
<body>
<form action="loginServlet" method="post">
学号: <input type="text" name="student_id"> <br>
密码: <input type="password" name="user_password"> <br>
<td>验证码</td>
<td><input type="text" name="checkCode"> </td>
</tr>
<tr>
<td colspan="2"><img id="img" src="checkCodeServlet"> </td>
</tr>
<button>登录</button>
<input type="reset">
<span style="color: red;font-size: 12px">${msg}</span>
<a href="register.jsp">注册</a>
</form>
</body>
</html>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 12:47
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>云餐厅</title>
<%-- 标题居中--%>
<style>
h2 {text-align:center}
</style>
</head>
<body>
<%--标题--%>
<form action="结算.jsp" method="get">
<h2> <span style="color: red;font-size: 30px">登录成功</span></h2>
<h2> <span style="color: red;font-size: 30px">云餐厅欢迎您</span></h2>
<table border="1px">
<%--表格居中代码--%>
<style>table {margin: auto;} body{text-align: center}</style>
<%-- --%>
<tr>
<td>编号</td>
<td>名称</td>
<td>图片</td>
<td>价格</td>
<td>选择</td>
</tr>
<tr>
<td>001</td>
<td>饺子</td>
<td><img src="resource/image/饺子.webp" height="300" width="500"></td>
<td>20</td>
<%-- 表单为00120 --%>
<td><input type="radio" name="001" value="20"></td>
</tr>
<tr>
<td>002</td>
<td></td>
<td><img src="resource/image/鱼.webp" height="300" width="500"></td>
<td>35</td>
<%-- 表单为00235 --%>
<td><input type="radio" name="002" value="35"></td>
</tr>
<tr>
<td>003</td>
<td>花馍</td>
<td><img src="resource/image/花馍.webp" height="300" width="500"></td>
<td>10</td>
<%-- 表单为00310 --%>
<td><input type="radio" name="003" value="10"></td>
</tr>
<tr>
<td>004</td>
<td>火锅</td>
<td><img src="resource/image/火锅.webp" height="300" width="500"></td>
<td>55</td>
<%-- 表单为00455 --%>
<td><input type="radio" name="004" value="55"></td>
</tr>
<%--align="center"居中; colspan="5"所占行数;提交 --%>
<td align="center" colspan="5"> <input type="submit" value="俺选好了" ></td>
</table>
</form>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/2/21
Time: 15:09
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<fieldset id="">
<legend>注册页面</legend>
<form action="register" method="post" id ="form">
<table>
<tr>
<td>
姓名:
</td>
<td>
<input type="text" name="username" /><span id="span1"></span></td>
</td>
</tr>
<tr>
<td>
学号:
</td>
<td>
<input type="text" name="student_id" />
</td>
</tr>
<tr>
<td>
密码:
</td>
<td>
<input type="password" name="user_password" />
</td>
</tr>
<tr>
<td>
确认密码:
</td>
<td>
<input type="password" name="repassword" />
<span id="span2"></span>
</td>
</tr>
<tr>
<td>
电话号码:
</td>
<td>
<input type="text" name="phone_number" />
</td>
</tr>
<tr>
<td>
QQ邮箱:
</td>
<td>
<input type="text" name="qq_mail" />
</td>
</tr>
</table>
<input type="submit" value="提交" />
<span style="color: rgba(0,0,0,0.5);font-size: 12px">${ms}</span>
</form>
</fieldset>
</body>
</html>
\ No newline at end of file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 18:17
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>结算</title>
</head>
<body>
<table border="1px">
<%--表格居中代码--%>
<style>table {margin: auto;} body{text-align: center}</style>
<%-- --%>
<tr>
<td>编号</td>
<td>名称</td>
<td>图片</td>
<td>价格</td>
</tr>
</table>
<%
int money=0;int a=0;
String str1=request.getParameter("001");
String str2=request.getParameter("002");
String str3=request.getParameter("003");
String str4=request.getParameter("004");
if(str1==null)
str1="";
if(str2==null)
str2="";
if(str3==null)
str3="";
if(str4==null)
str4="";
if(str1.equals("20"))
{money+=20;}
if(str2.equals("35"))
{money+=35;}
if(str3.equals("10"))
{money+=10;}
if(str4.equals("55"))
{money+=55;}
%>
<c:choose>
<c:when test="${money==20}">
<img src="resource/image/饺子.webp" height="300" width="500" >
</c:when>
<c:otherwise >
<img src="resource/image/花馍.webp" height="300" width="500">
</c:otherwise>
</c:choose>
<h3 align="center">您的消费金额为:</h3>
<p align="center"><%=money%></p>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>javaProject</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version><!--版本号-->
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.1</version>
</dependency>
<!--用于单元测试的包-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<!--jedis 代码中使用这个链接redis -->
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.3.0</version>
</dependency>
<!--fastjson-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.62</version>
</dependency>
<!--qq邮箱验证所需的依赖 -->
<!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.2.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context-support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>5.3.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.14</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
</project>
\ No newline at end of file
package com.xxxx.controller;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Random;
@WebServlet(urlPatterns = "/checkCodeServlet",loadOnStartup = 1)
public class CheckCodeServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int width = 100;
int height = 50;
//1.创建一对象,在内存中图片(验证码图片对象)
BufferedImage image = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
//2.美化图片
//2.1 填充背景色
Graphics g = image.getGraphics();//画笔对象
g.setColor(Color.PINK);//设置画笔颜色
g.fillRect(0,0,width,height);
//2.2画边框
g.setColor(Color.BLUE);
g.drawRect(0,0,width - 1,height - 1);//线条的长度大概1
String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghigklmnopqrstuvwxyz23456789";
//生成随机角标
Random ran = new Random();
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= 4; i++) {
int index = ran.nextInt(str.length());//生成一个大于等0小于str长度的随机数
//获取字符
char ch = str.charAt(index);//随机字符
sb.append(ch);//把字符放到一个字符串中
//2.3写验证码
g.drawString(ch+"",width/5*i,height/2);
}
String checkCode_session = sb.toString();
//将验证码存入session
request.getSession().setAttribute("checkCode_session",checkCode_session);
//2.4画干扰线
g.setColor(Color.GREEN);
//随机生成坐标点
for (int i = 0; i < 10; i++) {
int x1 = ran.nextInt(width);
int x2 = ran.nextInt(width);
int y1 = ran.nextInt(height);
int y2 = ran.nextInt(height);
g.drawLine(x1,y1,x2,y2);
}
//3.将图片输出到页面展示
ImageIO.write(image,"jpg",response.getOutputStream());
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doPost(request,response);
}
}
\ No newline at end of file
package com.xxxx.controller;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.*;
import java.util.UUID;
/**
* @author yanchaochao
* @date 2022/1/
*/
@WebServlet("/loginServlet")
public class LoginServlet extends HttpServlet {
static boolean loginSuccess=false;
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//设置客户端的编码格式(防止乱码)
HttpSession session = req.getSession();
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");
resp.setContentType("text/html");
//接受客户端传递的参数
String student_id = req.getParameter("student_id");
String user_password = req.getParameter("user_password");
String userCode = req.getParameter("checkCode");
//提取session中
String code =session.getAttribute("checkCode_session").toString();
//删除验证码,这样返回的时候验证码就会重新刷一次
session.removeAttribute("checkCode_session");
//JDBC代码
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
//1.注册驱动
Class.forName("java.sql.Driver");
//2.获取连接
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","15135757306ycc");
//3.获取数据库操作对象
stmt = conn.createStatement();
//4.执行sql
String sql ="select * from user where student_id='"+student_id+"' and user_password='"+user_password+"' ";
rs = stmt.executeQuery(sql);
//5.处理结果集
if (rs.next()&&code!=null&&code.equalsIgnoreCase(userCode)){
//第一个是检查账号密码是否正确
//第二个是为了防止空指针
//忽略大小写
//登录成功
loginSuccess = true;
}
}catch (Exception e){
e.printStackTrace();
}finally {
//6.释放资源
if(rs !=null){
try {
rs.close();
}catch (SQLException e){
e.printStackTrace();
}
}
if(stmt!=null){
try {
stmt.close();
}catch (SQLException e){
e.printStackTrace();
}
}
if(conn !=null){
try {
conn.close();
}catch (SQLException e){
e.printStackTrace();
}
}
}
if(loginSuccess){
//登录成功
String token = UUID.randomUUID().toString();
//设置登录信息到session
req.getSession().setAttribute("student_id",user_password);
//跳转到index.jsp
resp.sendRedirect("login.jsp");
}
else{
//提示用户信息
req.setAttribute("msg", "登录失败");
//请求转发跳转到login.jsp
req.getRequestDispatcher("index.jsp").forward(req, resp);
}
}
}
package com.xxxx.controller;
/**
* @author yanchaochao
* @date 2022/2/23 21:29
*/
import java.util.Properties;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
/**
* 使用QQ发送邮件工具类
*/
public class QQ_mail {
private final static String SERVICE_HOST = "smtp.qq.com";//QQ服务器
private final static int PORT = 465; //smtp的端口号
private final static String PROTOCOL = "smtp"; //协议名称。smtp表示简单邮件传输协议
private final static String ACCOUNT = "2673408959@qq.com"; //发送邮件的QQ账号
private final static String AUTH_CODE = "iquvlogbzzggdjgc"; //QQ授权码(需要到https://mail.qq.com/申请)
private static final JavaMailSenderImpl senderImpl = new JavaMailSenderImpl();
/*
*发送QQ邮件的初始化配置
*/
static{
senderImpl.setHost(SERVICE_HOST); //设置 使用QQ邮箱发送邮件的主机名
senderImpl.setPort(PORT); //设置端口号
senderImpl.setProtocol(PROTOCOL); //协议名称
senderImpl.setUsername(ACCOUNT); // 设置自己的邮箱帐号名称
senderImpl.setPassword(AUTH_CODE); // 设置对应账号申请到的授权码
Properties prop = new Properties();
prop.put(" mail.smtp.auth ", "true"); // 将这个参数设为true,让服务器进行认证,认证用户名和密码是否正确
prop.put("mail.smtp.starttls.enable", "true");
prop.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); //使用ssl协议来保证连接安全
prop.put(" mail.smtp.timeout ", "25000"); //传输超时时间
senderImpl.setJavaMailProperties(prop);
}
/**
* 发送qq邮件
* @param qqid
*/
public static void send_qq_mail(String qqid) {
String[] str = new String[3];
str[0] = qqid;
str[1] = "亲爱的云子,您于借的《》已到归还时间,请在前归还该书籍,若有问题请及时联系管理员处理,电话为。";
str[2] = "【云淄】超时提醒";
send(str);
}
/**
* 发送简单邮件
* @param accounts 被发邮件的用户数组
* @param info 邮件信息
* @param title 邮件主题
*/
public static void sendSimpleMail(String[] accounts,String info,String title){
//创建简单邮件对象
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setTo(accounts); //设置邮件接收者账号数组
mailMessage.setFrom(ACCOUNT); //设置邮件的发送者
mailMessage.setSubject(title);//设置邮件的主题
mailMessage.setText(info); //设置邮件的内容
//发送邮件
senderImpl.send(mailMessage);
}
public static void send(String [] str) {
if(str.length != 3){//判断输入参数是否正确
System.out.println("请输入正确的参数,分别是qq邮箱账号、邮件主题和邮件内容");
return;
}
try {
//创建一个存储账号信息
StringBuilder builder = new StringBuilder();
//遍历账号信息
int index = 0 ;//索引
String string = str[0];
// while ((index < string.length()) ) {//readLine()读取一个文本行
string = string.trim();//trim()去掉字符串前后的空格
// if (string.equals(""))//判断该行是否为空
// continue;
//把读取到的邮箱帐号添加到builder中,多个值用逗号分隔
if (index == 0) {
builder.append(string);//append(line)追加数据
} else {
builder.append("," + string);
}
index++;
// }
//把字符串切割成数组array
//toString()将对象中的数据以字符串的形式返回
//split(",")将当前字符串以,字符串隔开,隔开后的片段以String[]形式返回。
String[] accounts = builder.toString().split(",");
//发送邮件
sendSimpleMail(accounts, str[1], str[2]);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(" 邮件发送成功.. ");
}
}
// public static void main(String[] args) {
//
// String[] str = new String[3];
//
// str[0] = "E:\\_JAVA\\图书借阅管理系统\\qqmail\\account.txt";
//// str[0] = "705054686@qq.com";
// str[1] = "亲爱的孙智桐云子,您于${borrow_time}借的${book_name}已到归还时间,请在${deaed_time}前归还该书籍,若有问题请及时联系管理员处理,电话为${phone_number}";
//
// str[2] = "【云淄】超时提醒";
//
// send(str);
// }
// public static void send(String [] str)
//
// {
//
// if(str.length != 3){//判断输入参数是否正确
//
// System.out.println("请输入正确的参数,分别是文件名、邮件主题和邮件内容");
//
// return;
//
// }
//
// try {
//
////建立输入缓冲流,读取邮箱账号文件信息
//
// BufferedReader reader = new BufferedReader(new FileReader(str[0]));
//
////创建一个存储账号信息
//
// StringBuilder builder = new StringBuilder();
//
////遍历账号信息
//
// String line = "" ;
//
// int index = 0 ;//索引
//
// while ((line = reader.readLine()) != null) {//readLine()读取一个文本行
//
//// while (index <= str) {//readLine()读取一个文本行
////取出两边空格
//
// line = line.trim();//trim()去掉字符串前后的空格
//
//// char a = line.charAt(index);
// //判断该行是否为空
//
// if (line.equals(""))
//
// continue;
//
////把读取到的邮箱帐号添加到builder中,多个值用逗号分隔
//
// if (index == 0) {
//
// builder.append(line);//append(line)追加数据
//
// } else {
//
// builder.append("," + line);
//
// }
//
// index++;
// }
////把字符串切割成数组array
// //toString()将对象中的数据以字符串的形式返回
// //split(",")将当前字符串以,字符串隔开,隔开后的片段以String[]形式返回。
// String[] accounts = builder.toString().split(",");
//
////发送邮件,args[1] 邮件主题,args[2] 邮件内容
//
// sendSimpleMail(accounts, str[1], str[2]);
//
// } catch (Exception e) {
//
// e.printStackTrace();
//
// }
//
// System.out.println(" 邮件发送成功.. ");
//
// }
//
//}
package com.xxxx.controller;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.*;
import java.util.UUID;
/**
* @author yanchaochao
* 2022/2/21 15:14
*/
@WebServlet(urlPatterns = "/register")
public class Register extends HttpServlet {
//数字
public static final String REG_NUMBER = ".*\\d+.*";
//小写字母
public static final String REG_UPPERCASE = ".*[A-Z]+.*";
//大写字母
public static final String REG_LOWERCASE = ".*[a-z]+.*";
//特殊符号
public static final String REG_SYMBOL = ".*[~!@#$%^&*()_+|<>,.?/:;'\\[\\]{}\"]+.*";
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req,resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//获取在web.xml中的配置的全局属性
String encode = req.getServletContext().getInitParameter("encode");
//为了防止乱码设置编码
req.setCharacterEncoding(encode);
resp.setContentType("text/html;charset="+encode);
//获得请求过来的资源
String username = req.getParameter("username");
String student_id = req.getParameter("student_id");
String user_password = req.getParameter("user_password");
String repassword = req.getParameter("repassword");
String phone_number = req.getParameter("phone_number");
String qq_mail = req.getParameter("qq_mail");
String user_uuid = UUID.randomUUID().toString();
//这里将获取到的请求数据都在控制台上打印了一遍
//看是否拿到了这些数据
System.out.println(user_uuid);
System.out.println(student_id);
System.out.println(username);
System.out.println(user_password);
System.out.println(repassword);
System.out.println(phone_number);
System.out.println(qq_mail);
//---------------------------------------------------------------
/*
判断区域
1.信息是否全部填写
2.密码长度判断
3.密码和确认密码是否一致
*/
//判断信息是否填写
if(username.equals("") || user_password.equals("") || repassword.equals("") || phone_number.equals("") || student_id.equals("")|| qq_mail.equals("") ){
req.setAttribute("ms", "所有的数据都不能为空");
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
System.out.println("555");
SendEmail.qq_mail("2954295419@qq.com");
System.out.println("555");
//判断学号的格式
if(student_id.length()!=10){
req.setAttribute("ms", "请输入正确的学号格式");
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
//判断密码长度是否在6-15内
if (user_password.length() >= 15||user_password.length() <= 6) {
req.setAttribute("ms", "密码长度应该在6-15内");
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
//判断密码是否应包含大小写字母、数字、特殊字符
int i = 0;
if (user_password.matches(REG_NUMBER)) i++;
if (user_password.matches(REG_LOWERCASE))i++;
if (user_password.matches(REG_UPPERCASE)) i++;
if (user_password.matches(REG_SYMBOL)) i++;
if (i < 3 ){
req.setAttribute("ms", "密码应包含大小写字母、数字、特殊字符");
//请求转发跳转到register.jsp
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
//判断手机号码的格式
if(phone_number.length()==10){
req.setAttribute("ms", "请输入正确的手机号码");
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
//判断两次密码是否一致
if(!user_password.equals(repassword)){
req.setAttribute("ms", "两次密码输入不一致");
req.getRequestDispatcher("register.jsp").forward(req, resp);
return;
}
//
//-----------------------------------------------
try {
//加载MySQL的数据库驱动
Class.forName("com.mysql.jdbc.Driver");
//添加了一个名为day02的数据库
String url = "jdbc:mysql://localhost:3306/test";
//默认是系统管理员的账户
String user = "root";
//这里你自己设置的数据库密码
String passw = "15135757306ycc";
//获取到数据库的连接
Connection connection = DriverManager.getConnection(url, user, passw);
//获取到执行器
Statement stmt = connection.createStatement();
//需要执行的sql语句
String sql = "insert into user values (null,'"+user_uuid+"','"+student_id+"','"+username+"','"+user_password+"','"+phone_number+"','"+qq_mail+"')";
//打印一下sql语句,放在数据库中看是否能将数据添加到数据库中
System.out.println(sql);
//执行sql语句
int a = stmt.executeUpdate(sql);
//添加成功上边这个执行器就会返回1
if(a==1){
resp.getWriter().write("注册成功,请<a href = 'index.jsp'>登录</a>");
}else{
resp.getWriter().write("注册失败,请返回重新<a href = 'register.jsp'></a>");
}
stmt.close();
connection.close();
}catch (Exception e){
e.printStackTrace();
}
}
}
\ No newline at end of file
package com.xxxx.controller;
/**
* @author yanchaochao
* @date 2022/2/24 12:59
*/
import java.util.Properties;
import java.util.Random;
import javax.mail.Authenticator;
import javax.mail.Message.RecipientType;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class SendEmail {
public static void qq_mail(String qqid) {
try {
//创建Properties 类用于记录邮箱的一些属性
final Properties props = new Properties();
//表示SMTP发送邮件,必须进行身份验证
props.put("mail.smtp.auth", "true");
//此处填写SMTP服务器
props.put("mail.smtp.host", "smtp.qq.com");
//端口号,QQ邮箱给出了两个端口,但是另一个我一直使用不了,所以就给出这一个587
props.put("mail.smtp.port", "587");
//此处填写你的账号
props.put("mail.user", "2895548613@qq.com");
//此处的密码就是前面说的16位STMP口令
props.put("mail.password", "cgryarketubyddih");
//构建授权信息,用于进行SMTP进行身份验证
Authenticator authenticator = new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
// 用户名、密码
String userName = props.getProperty("mail.user");
String password = props.getProperty("mail.password");
return new PasswordAuthentication(userName, password);
}
};
//使用环境属性和授权信息,创建邮件会话
Session mailSession = Session.getInstance(props, authenticator);
//创建邮件消息
MimeMessage message = new MimeMessage(mailSession);
//设置发件人
InternetAddress form = new InternetAddress(
props.getProperty("mail.user"));
message.setFrom(form);
//设置收件人的邮箱
InternetAddress to = new InternetAddress(qqid);
message.setRecipient(RecipientType.TO, to);
//设置邮件标题
message.setSubject("测试邮件");
String msg = "吃了";
//html文件
StringBuilder sb = new StringBuilder();
sb.append("<html>");
sb.append("<head>");
sb.append("<title>xxx</title>");
sb.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
sb.append("<style type=\"text/css\">");
sb.append(".post {margin-bottom: 20px;background: #5BCE9E;}.title {padding: 5px 20px;}.posted {padding: 0 0 0 20px;font-size: small;}.story {padding: 20px;}.meta {height: 60px;padding: 40px 0 0 0;}.meta p {margin: 0;padding: 0 20px 0 0; text-align: right;}");
sb.append("</style>");
sb.append("</head>");
sb.append("<body>");
sb.append("<div>");
sb.append("<div class=\"post\">");
sb.append("<h2 class=\"title\">某某某</h2>");
sb.append("<h3 class=\"posted\">这是一条来自xxx系统xxx的xxx</h3>");
sb.append("<div class=\"story\">"+msg+"</div>");
sb.append("<div class=\"meta\"><p>xxxx年xx月xx时xx分</p></div>");
sb.append("</div>");
sb.append("</div>");
sb.append("</body>");
sb.append("</html>");
//设置邮件的内容体
message.setContent(sb.toString(), "text/html;charset=UTF-8");
//最后当然就是发送邮件啦
Transport.send(message);
} catch (AddressException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<context-param>
<param-name>encode</param-name>
<param-value>UTF-8</param-value>
</context-param>
</web-app>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 12:49
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>用户登录</title>
<title>login</title>
<%--切换验证码,加载完成后点击验证码图片--%>
<script language="javaScript" src="Js/jquery-3.4.1.min.js"></script>
<script language="JavaScript">
$(function () {
$("#img").click(function () {
$(this).prop("src","checkCodeServlet?id="+Math.random());
});
});
</script>
<%--上述功能为登录验证码部分--%>
</head>
<body>
<form action="loginServlet" method="post">
学号: <input type="text" name="student_id"> <br>
密码: <input type="password" name="user_password"> <br>
<td>验证码</td>
<td><input type="text" name="checkCode"> </td>
</tr>
<tr>
<td colspan="2"><img id="img" src="checkCodeServlet"> </td>
</tr>
<button>登录</button>
<input type="reset">
<span style="color: red;font-size: 12px">${msg}</span>
<a href="register.jsp">注册</a>
</form>
</body>
</html>
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 12:47
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>云餐厅</title>
<%-- 标题居中--%>
<style>
h2 {text-align:center}
</style>
</head>
<body>
<%--标题--%>
<form action="结算.jsp" method="get">
<h2> <span style="color: red;font-size: 30px">登录成功</span></h2>
<h2> <span style="color: red;font-size: 30px">云餐厅欢迎您</span></h2>
<table border="1px">
<%--表格居中代码--%>
<style>table {margin: auto;} body{text-align: center}</style>
<%-- --%>
<tr>
<td>编号</td>
<td>名称</td>
<td>图片</td>
<td>价格</td>
<td>选择</td>
</tr>
<tr>
<td>001</td>
<td>饺子</td>
<td><img src="resource/image/饺子.webp" height="300" width="500"></td>
<td>20</td>
<%-- 表单为00120 --%>
<td><input type="radio" name="001" value="20"></td>
</tr>
<tr>
<td>002</td>
<td></td>
<td><img src="resource/image/鱼.webp" height="300" width="500"></td>
<td>35</td>
<%-- 表单为00235 --%>
<td><input type="radio" name="002" value="35"></td>
</tr>
<tr>
<td>003</td>
<td>花馍</td>
<td><img src="resource/image/花馍.webp" height="300" width="500"></td>
<td>10</td>
<%-- 表单为00310 --%>
<td><input type="radio" name="003" value="10"></td>
</tr>
<tr>
<td>004</td>
<td>火锅</td>
<td><img src="resource/image/火锅.webp" height="300" width="500"></td>
<td>55</td>
<%-- 表单为00455 --%>
<td><input type="radio" name="004" value="55"></td>
</tr>
<%--align="center"居中; colspan="5"所占行数;提交 --%>
<td align="center" colspan="5"> <input type="submit" value="俺选好了" ></td>
</table>
</form>
</body>
</html>
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/2/21
Time: 15:09
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<fieldset id="">
<legend>注册页面</legend>
<form action="register" method="post" id ="form">
<table>
<tr>
<td>
姓名:
</td>
<td>
<input type="text" name="username" /><span id="span1"></span></td>
</td>
</tr>
<tr>
<td>
学号:
</td>
<td>
<input type="text" name="student_id" />
</td>
</tr>
<tr>
<td>
密码:
</td>
<td>
<input type="password" name="user_password" />
</td>
</tr>
<tr>
<td>
确认密码:
</td>
<td>
<input type="password" name="repassword" />
<span id="span2"></span>
</td>
</tr>
<tr>
<td>
电话号码:
</td>
<td>
<input type="text" name="phone_number" />
</td>
</tr>
<tr>
<td>
QQ邮箱:
</td>
<td>
<input type="text" name="qq_mail" />
</td>
</tr>
</table>
<input type="submit" value="提交" />
<span style="color: rgba(0,0,0,0.5);font-size: 12px">${ms}</span>
</form>
</fieldset>
</body>
</html>
\ No newline at end of file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2022/1/28
Time: 18:17
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>结算</title>
</head>
<body>
<table border="1px">
<%--表格居中代码--%>
<style>table {margin: auto;} body{text-align: center}</style>
<%-- --%>
<tr>
<td>编号</td>
<td>名称</td>
<td>图片</td>
<td>价格</td>
</tr>
</table>
<%
int money=0;int a=0;
String str1=request.getParameter("001");
String str2=request.getParameter("002");
String str3=request.getParameter("003");
String str4=request.getParameter("004");
if(str1==null)
str1="";
if(str2==null)
str2="";
if(str3==null)
str3="";
if(str4==null)
str4="";
if(str1.equals("20"))
{money+=20;}
if(str2.equals("35"))
{money+=35;}
if(str3.equals("10"))
{money+=10;}
if(str4.equals("55"))
{money+=55;}
%>
<c:choose>
<c:when test="${money==20}">
<img src="resource/image/饺子.webp" height="300" width="500" >
</c:when>
<c:otherwise >
<img src="resource/image/花馍.webp" height="300" width="500">
</c:otherwise>
</c:choose>
<h3 align="center">您的消费金额为:</h3>
<p align="center"><%=money%></p>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment