├── Furniture_Spring ├── .classpath ├── .project ├── .settings │ ├── .jsdtscope │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.wst.common.component │ ├── org.eclipse.wst.common.project.facet.core.prefs.xml │ ├── org.eclipse.wst.common.project.facet.core.xml │ ├── org.eclipse.wst.jsdt.ui.superType.container │ ├── org.eclipse.wst.jsdt.ui.superType.name │ ├── org.eclipse.wst.validation.prefs │ └── org.hibernate.eclipse.console.prefs ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ ├── hiber │ │ │ └── model │ │ │ │ ├── Address.java │ │ │ │ ├── Admin.java │ │ │ │ ├── Bufcart.java │ │ │ │ ├── OrderPlaced.java │ │ │ │ ├── Product.java │ │ │ │ └── User.java │ │ │ └── project │ │ │ ├── config │ │ │ ├── WebConfig.java │ │ │ └── WebInitializer.java │ │ │ ├── controller │ │ │ └── HomeController.java │ │ │ ├── dao │ │ │ ├── UserDao.java │ │ │ └── UserDaoImpl.java │ │ │ ├── service │ │ │ ├── UserService.java │ │ │ └── UserServiceImpl.java │ │ │ └── util │ │ │ └── PasswordUtil.java │ │ ├── resources │ │ └── log4j.properties │ │ └── webapp │ │ └── WEB-INF │ │ ├── images │ │ └── MainPage.jpg │ │ ├── views │ │ ├── addItem.jsp │ │ ├── address.jsp │ │ ├── adminPage.jsp │ │ ├── editItem.jsp │ │ ├── index.jsp │ │ ├── login.jsp │ │ ├── signup.jsp │ │ ├── userPage.jsp │ │ └── viewcart.jsp │ │ └── web.xml └── target │ ├── classes │ ├── com │ │ ├── hiber │ │ │ └── model │ │ │ │ ├── Address.class │ │ │ │ ├── Admin.class │ │ │ │ ├── Bufcart.class │ │ │ │ ├── OrderPlaced.class │ │ │ │ ├── Product.class │ │ │ │ └── User.class │ │ └── project │ │ │ ├── config │ │ │ ├── WebConfig$1.class │ │ │ ├── WebConfig.class │ │ │ └── WebInitializer.class │ │ │ ├── controller │ │ │ └── HomeController.class │ │ │ ├── dao │ │ │ ├── UserDao.class │ │ │ └── UserDaoImpl.class │ │ │ ├── service │ │ │ ├── UserService.class │ │ │ └── UserServiceImpl.class │ │ │ └── util │ │ │ └── PasswordUtil.class │ └── log4j.properties │ ├── first-web-0.0.1-SNAPSHOT.war │ ├── first-web-0.0.1-SNAPSHOT │ └── WEB-INF │ │ ├── classes │ │ ├── com │ │ │ └── project │ │ │ │ ├── config │ │ │ │ ├── WebConfig.class │ │ │ │ └── WebInitializer.class │ │ │ │ ├── controller │ │ │ │ └── HomeController.class │ │ │ │ ├── dao │ │ │ │ ├── UserDao.class │ │ │ │ ├── UserDaoImpl$1.class │ │ │ │ ├── UserDaoImpl$ProductMapper.class │ │ │ │ ├── UserDaoImpl$UserMapper.class │ │ │ │ └── UserDaoImpl.class │ │ │ │ ├── model │ │ │ │ ├── PasswordUtil.class │ │ │ │ ├── Product.class │ │ │ │ └── User.class │ │ │ │ └── service │ │ │ │ ├── UserService.class │ │ │ │ └── UserServiceImpl.class │ │ └── log4j.properties │ │ ├── images │ │ └── MainPage.jpg │ │ ├── lib │ │ ├── aopalliance-1.0.jar │ │ ├── commons-logging-1.2.jar │ │ ├── javax.servlet-api-3.1.0.jar │ │ ├── jstl-1.2.jar │ │ ├── log4j-1.2.17.jar │ │ ├── spring-aop-4.2.2.RELEASE.jar │ │ ├── spring-beans-4.2.2.RELEASE.jar │ │ ├── spring-context-4.2.2.RELEASE.jar │ │ ├── spring-core-4.2.2.RELEASE.jar │ │ ├── spring-expression-4.2.2.RELEASE.jar │ │ ├── spring-jdbc-4.2.2.RELEASE.jar │ │ ├── spring-tx-4.2.2.RELEASE.jar │ │ ├── spring-web-4.2.2.RELEASE.jar │ │ └── spring-webmvc-4.2.2.RELEASE.jar │ │ ├── views │ │ ├── index.jsp │ │ ├── login.jsp │ │ ├── signup.jsp │ │ ├── userPage.jsp │ │ ├── user_form.jsp │ │ └── user_page.jsp │ │ └── web.xml │ ├── m2e-wtp │ └── web-resources │ │ └── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ └── com.project │ │ └── first-web │ │ ├── pom.properties │ │ └── pom.xml │ ├── maven-archiver │ └── pom.properties │ └── maven-status │ └── maven-compiler-plugin │ ├── compile │ └── default-compile │ │ ├── createdFiles.lst │ │ └── inputFiles.lst │ └── testCompile │ └── default-testCompile │ └── inputFiles.lst └── README.md /Furniture_Spring/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Furniture_Spring/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | first-web 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | org.springframework.ide.eclipse.core.springbuilder 30 | 31 | 32 | 33 | 34 | org.springframework.ide.eclipse.boot.validation.springbootbuilder 35 | 36 | 37 | 38 | 39 | 40 | org.springframework.ide.eclipse.core.springnature 41 | org.eclipse.jem.workbench.JavaEMFNature 42 | org.eclipse.wst.common.modulecore.ModuleCoreNature 43 | org.eclipse.jdt.core.javanature 44 | org.eclipse.m2e.core.maven2Nature 45 | org.eclipse.wst.common.project.facet.core.nature 46 | org.eclipse.wst.jsdt.core.jsNature 47 | 48 | 49 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 3 | org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 | org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 | org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= 6 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 7 | org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= 8 | org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 9 | org.eclipse.jdt.core.compiler.annotation.nullable.secondary= 10 | org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 13 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 14 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 15 | org.eclipse.jdt.core.compiler.compliance=1.8 16 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 17 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 18 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 19 | org.eclipse.jdt.core.compiler.problem.APILeak=warning 20 | org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 21 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 22 | org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 23 | org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 24 | org.eclipse.jdt.core.compiler.problem.deadCode=warning 25 | org.eclipse.jdt.core.compiler.problem.deprecation=warning 26 | org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 27 | org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 28 | org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 29 | org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore 30 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 31 | org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 32 | org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 33 | org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 34 | org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore 35 | org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 36 | org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 37 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 38 | org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 39 | org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 40 | org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 41 | org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 42 | org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 43 | org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 44 | org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 45 | org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 46 | org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 47 | org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 48 | org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 49 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 50 | org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 51 | org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 52 | org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 53 | org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 54 | org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 55 | org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 56 | org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 57 | org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning 58 | org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 59 | org.eclipse.jdt.core.compiler.problem.nullReference=warning 60 | org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 61 | org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 62 | org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 63 | org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 64 | org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning 65 | org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 66 | org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 67 | org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 68 | org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 69 | org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 70 | org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 71 | org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 72 | org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 73 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 74 | org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 75 | org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 76 | org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore 77 | org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 78 | org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 79 | org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 80 | org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 81 | org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning 82 | org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 83 | org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 84 | org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 85 | org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 86 | org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 87 | org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 88 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning 89 | org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled 90 | org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info 91 | org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 92 | org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 93 | org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 94 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 95 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 96 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 97 | org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 98 | org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 99 | org.eclipse.jdt.core.compiler.problem.unusedImport=warning 100 | org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 101 | org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 102 | org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore 103 | org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 104 | org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 105 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 106 | org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 107 | org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 108 | org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 109 | org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 110 | org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 111 | org.eclipse.jdt.core.compiler.source=1.8 112 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /Furniture_Spring/.settings/org.hibernate.eclipse.console.prefs: -------------------------------------------------------------------------------- 1 | default.configuration= 2 | eclipse.preferences.version=1 3 | hibernate3.enabled=false 4 | -------------------------------------------------------------------------------- /Furniture_Spring/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.project 5 | first-web 6 | 0.0.1-SNAPSHOT 7 | war 8 | 9 | 10 | 11 | javax.servlet 12 | jstl 13 | 1.2 14 | 15 | 16 | 17 | javax.servlet 18 | javax.servlet-api 19 | 3.1.0 20 | 21 | 22 | org.springframework 23 | spring-context 24 | 4.3.18.RELEASE 25 | 26 | 27 | 28 | org.springframework 29 | spring-tx 30 | 4.3.18.RELEASE 31 | 32 | 33 | 34 | org.springframework 35 | spring-core 36 | 4.3.18.RELEASE 37 | 38 | 39 | 40 | org.springframework 41 | spring-web 42 | 4.3.18.RELEASE 43 | 44 | 45 | 46 | org.springframework 47 | spring-context-support 48 | 4.3.18.RELEASE 49 | 50 | 51 | 52 | org.springframework 53 | spring-webmvc 54 | 4.3.18.RELEASE 55 | 56 | 57 | 58 | org.springframework 59 | spring-orm 60 | 4.3.18.RELEASE 61 | 62 | 63 | 64 | org.hibernate 65 | hibernate-entitymanager 66 | 5.3.1.Final 67 | 68 | 69 | 70 | org.hibernate 71 | hibernate-core 72 | 5.3.1.Final 73 | 74 | 75 | commons-dbcp 76 | commons-dbcp 77 | 1.4 78 | 79 | 80 | log4j 81 | log4j 82 | 1.2.17 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-compiler-plugin 92 | 3.2 93 | 94 | true 95 | 1.7 96 | 1.7 97 | true 98 | 99 | 100 | 101 | org.apache.tomcat.maven 102 | tomcat7-maven-plugin 103 | 2.2 104 | 105 | / 106 | true 107 | 108 | 109 | 110 | org.apache.maven.plugins 111 | maven-war-plugin 112 | 2.6 113 | 114 | false 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/Address.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class Address { 8 | 9 | @Id 10 | private String email; 11 | private String address; 12 | private String city; 13 | private String zipcode; 14 | private String state; 15 | 16 | public String getEmail() { 17 | return email; 18 | } 19 | 20 | public void setEmail(String email) { 21 | this.email = email; 22 | } 23 | 24 | public Address(String address, String city, String state, String zipcode) { 25 | super(); 26 | this.address = address; 27 | this.city = city; 28 | this.state = state; 29 | this.zipcode = zipcode; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Address [address=" + address + ", city=" + city + ", state=" + state + ", zipcode=" + zipcode 35 | + ", email=" + "]"; 36 | } 37 | 38 | public Address() { 39 | super(); 40 | } 41 | 42 | public String getAddress() { 43 | return address; 44 | } 45 | 46 | public void setAddress(String address) { 47 | this.address = address; 48 | } 49 | 50 | public String getCity() { 51 | return city; 52 | } 53 | 54 | public void setCity(String city) { 55 | this.city = city; 56 | } 57 | 58 | public String getState() { 59 | return state; 60 | } 61 | 62 | public void setState(String state) { 63 | this.state = state; 64 | } 65 | 66 | public String getZipcode() { 67 | return zipcode; 68 | } 69 | 70 | public void setZipcode(String zipcode) { 71 | this.zipcode = zipcode; 72 | } 73 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/Admin.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import java.sql.Blob; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class Admin { 10 | 11 | @Id 12 | private String email; 13 | private String firstName; 14 | private String lastName; 15 | private String password; 16 | private String salt; 17 | private String gender; 18 | private String phonenumber; 19 | private String birthdate; 20 | private Blob image; 21 | 22 | public Blob getImage() { 23 | return image; 24 | } 25 | 26 | public void setImage(Blob image) { 27 | this.image = image; 28 | } 29 | 30 | public String getSalt() { 31 | return salt; 32 | } 33 | 34 | public void setSalt(String salt) { 35 | this.salt = salt; 36 | } 37 | 38 | public String getFirstName() { 39 | return firstName; 40 | } 41 | 42 | public void setFirstName(String firstName) { 43 | this.firstName = firstName; 44 | } 45 | 46 | public String getLastName() { 47 | return lastName; 48 | } 49 | 50 | public void setLastName(String lastName) { 51 | this.lastName = lastName; 52 | } 53 | 54 | public String getEmail() { 55 | return email; 56 | } 57 | 58 | public void setEmail(String email) { 59 | this.email = email; 60 | } 61 | 62 | public String getPassword() { 63 | return password; 64 | } 65 | 66 | public void setPassword(String password) { 67 | this.password = password; 68 | } 69 | 70 | public String getGender() { 71 | return gender; 72 | } 73 | 74 | public void setGender(String gender) { 75 | this.gender = gender; 76 | } 77 | 78 | public String getDOB() { 79 | return birthdate; 80 | } 81 | 82 | public void setDOB(String dOB) { 83 | birthdate = dOB; 84 | } 85 | 86 | public String getPhonenumber() { 87 | return phonenumber; 88 | } 89 | 90 | public void setPhonenumber(String phonenumber) { 91 | this.phonenumber = phonenumber; 92 | } 93 | 94 | public Admin(String email) { 95 | super(); 96 | this.email = email; 97 | } 98 | 99 | public Admin() { 100 | super(); 101 | } 102 | 103 | @Override 104 | public String toString() { 105 | return "User [firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + ", password=" + password 106 | + ", salt=" + salt + ", gender=" + gender + ", phonenumber=" + phonenumber + ", DOB=" + birthdate + "]"; 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/Bufcart.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | 7 | @Entity 8 | public class Bufcart { 9 | 10 | @Id 11 | private int bufcartId; 12 | 13 | @Column(nullable = true) 14 | private int orderId; 15 | 16 | public int getOrderId() { 17 | return orderId; 18 | } 19 | 20 | public int getBufcartId() { 21 | return bufcartId; 22 | } 23 | 24 | public void setBufcartId(int bufcartId) { 25 | this.bufcartId = bufcartId; 26 | } 27 | 28 | private String ProductId, ProductName, email, DateAdded, quantity, price; 29 | 30 | public void setOrderId(int orderId) { 31 | this.orderId = orderId; 32 | } 33 | 34 | public String getProductName() { 35 | return ProductName; 36 | } 37 | 38 | public void setProductName(String productName) { 39 | this.ProductName = productName; 40 | } 41 | 42 | public String getPrice() { 43 | return price; 44 | } 45 | 46 | public void setPrice(String price) { 47 | this.price = price; 48 | } 49 | 50 | public String getQuantity() { 51 | return quantity; 52 | } 53 | 54 | public void setQuantity(String quantity) { 55 | this.quantity = quantity; 56 | } 57 | 58 | public String getProductId() { 59 | return ProductId; 60 | } 61 | 62 | public void setProductId(String productId) { 63 | this.ProductId = productId; 64 | } 65 | 66 | public String getEmail() { 67 | return email; 68 | } 69 | 70 | public void setEmail(String email) { 71 | this.email = email; 72 | } 73 | 74 | public String getDateAdded() { 75 | return DateAdded; 76 | } 77 | 78 | public void setDateAdded(String dateAdded) { 79 | this.DateAdded = dateAdded; 80 | } 81 | 82 | public Bufcart(String productId, String productName, String email, String dateAdded, String quantity, 83 | String price) { 84 | super(); 85 | this.ProductId = productId; 86 | this.ProductName = productName; 87 | this.email = email; 88 | this.DateAdded = dateAdded; 89 | this.quantity = quantity; 90 | this.price = price; 91 | } 92 | 93 | public Bufcart() { 94 | super(); 95 | } 96 | 97 | public Bufcart(String email) { 98 | super(); 99 | this.email = email; 100 | } 101 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/OrderPlaced.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class OrderPlaced { 8 | 9 | @Id 10 | private int orderId; 11 | private String email; 12 | private String totalCost; 13 | private String orderDate; 14 | private String orderStatus; 15 | 16 | public int getOrderId() { 17 | return orderId; 18 | } 19 | 20 | public void setOrderId(int orderId) { 21 | this.orderId = orderId; 22 | } 23 | 24 | public String getEmail() { 25 | return email; 26 | } 27 | 28 | public void setEmail(String email) { 29 | this.email = email; 30 | } 31 | 32 | public String getTotalCost() { 33 | return totalCost; 34 | } 35 | 36 | public void setTotalCost(String totalCost) { 37 | this.totalCost = totalCost; 38 | } 39 | 40 | public String getOrderDate() { 41 | return orderDate; 42 | } 43 | 44 | public void setOrderDate(String orderDate) { 45 | this.orderDate = orderDate; 46 | } 47 | 48 | public String getOrderStatus() { 49 | return orderStatus; 50 | } 51 | 52 | public void setOrderStatus(String orderStatus) { 53 | this.orderStatus = orderStatus; 54 | } 55 | 56 | public OrderPlaced(int orderId, String email, String totalCost, String orderDate, String orderStatus) { 57 | super(); 58 | this.orderId = orderId; 59 | this.email = email; 60 | this.totalCost = totalCost; 61 | this.orderDate = orderDate; 62 | this.orderStatus = orderStatus; 63 | } 64 | 65 | public OrderPlaced() { 66 | super(); 67 | } 68 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class Product { 8 | 9 | @Id 10 | private String productId; 11 | private String description; 12 | private String productname; 13 | private String productprice; 14 | private String quantity; 15 | 16 | public String getProductId() { 17 | return productId; 18 | } 19 | 20 | public void setProductId(String productId) { 21 | this.productId = productId; 22 | } 23 | 24 | public String getDescription() { 25 | return description; 26 | } 27 | 28 | public void setDescription(String description) { 29 | this.description = description; 30 | } 31 | 32 | public String getProductname() { 33 | return productname; 34 | } 35 | 36 | public void setProductname(String productname) { 37 | this.productname = productname; 38 | } 39 | 40 | public String getProductprice() { 41 | return productprice; 42 | } 43 | 44 | public void setProductprice(String productprice) { 45 | this.productprice = productprice; 46 | } 47 | 48 | public String getQuantity() { 49 | return quantity; 50 | } 51 | 52 | public void setQuantity(String quantity) { 53 | this.quantity = quantity; 54 | } 55 | 56 | @Override 57 | public String toString() { 58 | return "Product [productId=" + productId + ", description=" + description + ", productname=" + productname 59 | + ", productprice=" + productprice + ", quantity=" + quantity + ", prodImage=" + "]"; 60 | } 61 | 62 | public Product(String productId, String description, String productname, String productprice, String quantity) { 63 | super(); 64 | this.productId = productId; 65 | this.description = description; 66 | this.productname = productname; 67 | this.productprice = productprice; 68 | this.quantity = quantity; 69 | 70 | } 71 | 72 | public Product() { 73 | super(); 74 | } 75 | 76 | public Product(String productId) { 77 | super(); 78 | this.productId = productId; 79 | } 80 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/hiber/model/User.java: -------------------------------------------------------------------------------- 1 | package com.hiber.model; 2 | 3 | import java.sql.Blob; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.Id; 7 | 8 | @Entity 9 | public class User { 10 | 11 | @Id 12 | private String email; 13 | private String firstName; 14 | private String lastName; 15 | private String password; 16 | private String salt; 17 | private String gender; 18 | private String phonenumber; 19 | private String birthdate; 20 | private Blob image; 21 | 22 | public Blob getImage() { 23 | return image; 24 | } 25 | 26 | public void setImage(Blob image) { 27 | this.image = image; 28 | } 29 | 30 | public String getSalt() { 31 | return salt; 32 | } 33 | 34 | public void setSalt(String salt) { 35 | this.salt = salt; 36 | } 37 | 38 | public String getFirstName() { 39 | return firstName; 40 | } 41 | 42 | public void setFirstName(String firstName) { 43 | this.firstName = firstName; 44 | } 45 | 46 | public String getLastName() { 47 | return lastName; 48 | } 49 | 50 | public void setLastName(String lastName) { 51 | this.lastName = lastName; 52 | } 53 | 54 | public String getEmail() { 55 | return email; 56 | } 57 | 58 | public void setEmail(String email) { 59 | this.email = email; 60 | } 61 | 62 | public String getPassword() { 63 | return password; 64 | } 65 | 66 | public void setPassword(String password) { 67 | this.password = password; 68 | } 69 | 70 | public String getGender() { 71 | return gender; 72 | } 73 | 74 | public void setGender(String gender) { 75 | this.gender = gender; 76 | } 77 | 78 | public String getDOB() { 79 | return birthdate; 80 | } 81 | 82 | public void setDOB(String dOB) { 83 | birthdate = dOB; 84 | } 85 | 86 | public String getPhonenumber() { 87 | return phonenumber; 88 | } 89 | 90 | public void setPhonenumber(String phonenumber) { 91 | this.phonenumber = phonenumber; 92 | } 93 | 94 | public User(String email) { 95 | super(); 96 | this.email = email; 97 | } 98 | 99 | public User() { 100 | super(); 101 | } 102 | 103 | @Override 104 | public String toString() { 105 | return "User [firstName=" + firstName + ", lastName=" + lastName + ", email=" + email + ", password=" + password 106 | + ", salt=" + salt + ", gender=" + gender + ", phonenumber=" + phonenumber + ", DOB=" + birthdate + "]"; 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.project.config; 2 | 3 | import java.util.Properties; 4 | 5 | import javax.naming.NamingException; 6 | import javax.sql.DataSource; 7 | 8 | import org.apache.commons.dbcp.BasicDataSource; 9 | import org.hibernate.SessionFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.context.annotation.Bean; 12 | import org.springframework.context.annotation.ComponentScan; 13 | import org.springframework.context.annotation.Configuration; 14 | import org.springframework.orm.hibernate5.HibernateTransactionManager; 15 | import org.springframework.orm.hibernate5.LocalSessionFactoryBean; 16 | import org.springframework.transaction.PlatformTransactionManager; 17 | import org.springframework.transaction.annotation.EnableTransactionManagement; 18 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 19 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 20 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 21 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 22 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 23 | import org.springframework.web.servlet.view.JstlView; 24 | 25 | @Configuration 26 | @EnableWebMvc 27 | @EnableTransactionManagement 28 | @ComponentScan(basePackages = "com.project") 29 | public class WebConfig extends WebMvcConfigurerAdapter { 30 | /* 31 | * @Autowired DataSource dataSource; 32 | * 33 | * @Bean public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() { 34 | * return new NamedParameterJdbcTemplate(dataSource); } 35 | */ 36 | 37 | // Hibernate with localSessionFactory 38 | @Bean 39 | public LocalSessionFactoryBean getSessionFactory() throws NamingException { 40 | LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); 41 | sessionFactory.setDataSource(getDataSource()); 42 | sessionFactory.setPackagesToScan(new String[] { "com.hiber.model" }); 43 | sessionFactory.setHibernateProperties(hibernateProperties()); 44 | return sessionFactory; 45 | } 46 | 47 | @Bean 48 | @Autowired 49 | public PlatformTransactionManager transactionManager(SessionFactory s) { 50 | HibernateTransactionManager txManager = new HibernateTransactionManager(); 51 | txManager.setSessionFactory(s); 52 | return txManager; 53 | } 54 | 55 | Properties hibernateProperties() { 56 | return new Properties() { 57 | { 58 | setProperty("hibernate.hbm2ddl.auto", "update"); 59 | setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect"); 60 | // setProperty("hibernate.dialect", "org.hibernate.dialect.Oracle10gDialect"); 61 | setProperty("hibernate.show_sql", "true"); 62 | } 63 | }; 64 | } 65 | 66 | @Bean 67 | public DataSource getDataSource() throws NamingException { 68 | BasicDataSource dataSource = new BasicDataSource(); 69 | dataSource.setDriverClassName("com.mysql.jdbc.Driver"); 70 | dataSource.setUrl("jdbc:mysql://localhost:3306/spring"); 71 | dataSource.setUsername("****"); 72 | dataSource.setPassword("******"); 73 | return dataSource; 74 | } 75 | 76 | @Override 77 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 78 | // TODO Auto-generated method stub 79 | registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); 80 | registry.addResourceHandler("/images/**").addResourceLocations("/WEB-INF/images/"); 81 | 82 | } 83 | 84 | @Bean 85 | public InternalResourceViewResolver viewResolver() { 86 | InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); 87 | viewResolver.setViewClass(JstlView.class); 88 | viewResolver.setPrefix("/WEB-INF/views/"); 89 | viewResolver.setSuffix(".jsp"); 90 | return viewResolver; 91 | } 92 | 93 | @Override 94 | public void addViewControllers(ViewControllerRegistry registry) { 95 | registry.addViewController("/").setViewName("index"); 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/config/WebInitializer.java: -------------------------------------------------------------------------------- 1 | package com.project.config; 2 | 3 | import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; 4 | 5 | public class WebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { 6 | 7 | @Override 8 | protected Class[] getRootConfigClasses() { 9 | // TODO Auto-generated method stub 10 | return new Class[] { WebConfig.class }; 11 | } 12 | 13 | @Override 14 | protected Class[] getServletConfigClasses() { 15 | // TODO Auto-generated method stub 16 | return null; 17 | } 18 | 19 | @Override 20 | protected String[] getServletMappings() { 21 | // TODO Auto-generated method stub 22 | return new String[] { "/" }; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.project.controller; 2 | 3 | import java.security.NoSuchAlgorithmException; 4 | import java.text.DateFormat; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.List; 8 | import java.util.Random; 9 | 10 | import javax.servlet.http.HttpSession; 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.ui.Model; 15 | import org.springframework.web.bind.annotation.ModelAttribute; 16 | import org.springframework.web.bind.annotation.PathVariable; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.RequestMethod; 19 | import org.springframework.web.bind.annotation.RequestParam; 20 | import org.springframework.web.bind.annotation.SessionAttributes; 21 | import org.springframework.web.servlet.ModelAndView; 22 | 23 | import com.hiber.model.Address; 24 | import com.hiber.model.Admin; 25 | import com.hiber.model.Bufcart; 26 | import com.hiber.model.OrderPlaced; 27 | import com.hiber.model.Product; 28 | import com.hiber.model.User; 29 | import com.project.service.UserService; 30 | import com.project.util.PasswordUtil; 31 | 32 | @Controller 33 | @RequestMapping(value = "/user") 34 | @SessionAttributes("useremail") 35 | public class HomeController { 36 | 37 | @Autowired 38 | private UserService userService; 39 | 40 | // ==========NAVIGATION TO LOGIN PAGE========================// 41 | @RequestMapping(value = "/login", method = RequestMethod.GET) 42 | public ModelAndView loginView() { 43 | 44 | ModelAndView model = new ModelAndView("login"); 45 | User user = new User(); 46 | model.addObject("userloginform", user); 47 | return model; 48 | 49 | } 50 | 51 | // ==================VERIFYING CREDENTIALS AND REDIRECTING TO USER HOME 52 | // PAGE========================// 53 | @RequestMapping(value = "/logincheck", method = RequestMethod.POST) 54 | public ModelAndView validateLogin(@ModelAttribute("userloginform") User user, HttpSession session) 55 | throws NoSuchAlgorithmException { 56 | List AllUser = userService.listAllUser(); 57 | List AllAdmin = userService.listAllAdmin(); 58 | boolean index = false; 59 | for (int i = 0; i < AllUser.size(); i++) { 60 | if (AllUser.get(i).getEmail().equals(user.getEmail())) { 61 | index = true; 62 | } 63 | } 64 | if (!index) { 65 | boolean indexsec = false; 66 | for (int i = 0; i < AllAdmin.size(); i++) { 67 | if (AllAdmin.get(i).getEmail().equals(user.getEmail())) { 68 | indexsec = true; 69 | } 70 | } 71 | if (indexsec) { 72 | Admin userfa = userService.findAdminBy(user.getEmail()); 73 | if (userfa.getPassword().equals(user.getPassword())) { 74 | ModelAndView model = new ModelAndView("adminPage"); 75 | List list = userService.listAllProducts(); 76 | // System.out.println(list.toString()); 77 | Product prod = new Product(); 78 | model.addObject("productform", prod); 79 | model.addObject("useremail", user.getEmail()); 80 | model.addObject("listAdminProduct", list); 81 | session.setAttribute("user", user.getEmail()); 82 | return model; 83 | } 84 | } 85 | } else { 86 | User userf = userService.findUserBy(user.getEmail()); 87 | if (PasswordUtil.hashAndSaltPassword(user.getPassword(), userf.getSalt()).equals(userf.getPassword())) { 88 | 89 | ModelAndView model = new ModelAndView("userPage"); 90 | List list = userService.listAllProducts(); 91 | model.addObject("useremail", user.getEmail()); 92 | model.addObject("listProduct", list); 93 | session.setAttribute("user", user.getEmail()); 94 | return model; 95 | } 96 | } 97 | return new ModelAndView("redirect:/user/login"); 98 | } 99 | 100 | // ==========================REDIRECTING TO USER HOME 101 | // PAGE=====================================// 102 | @RequestMapping(value = "/home") 103 | public ModelAndView homeDirect(HttpSession session) throws NoSuchAlgorithmException { 104 | 105 | ModelAndView model = new ModelAndView("userPage"); 106 | List list = userService.listAllProducts(); 107 | 108 | model.addObject("useremail", session.getAttribute("user")); 109 | model.addObject("listProduct", list); 110 | session.setAttribute("user", session.getAttribute("user")); 111 | return model; 112 | 113 | } 114 | 115 | // ======================LOGGING OUT FROM 116 | // SESSION===============================================// 117 | @RequestMapping(value = "/logout", method = RequestMethod.GET) 118 | public String logout(HttpSession session, Model model) { 119 | 120 | session.invalidate(); 121 | if (model.containsAttribute("useremail")) 122 | model.asMap().remove("useremail"); 123 | return "redirect:/user/login"; 124 | } 125 | 126 | // ========================NAVIGATING TO SIGN UP 127 | // PAGE============================================// 128 | @RequestMapping(value = "/signup", method = RequestMethod.GET) 129 | public ModelAndView signupView() { 130 | 131 | ModelAndView model = new ModelAndView("signup"); 132 | User user = new User(); 133 | model.addObject("usersignform", user); 134 | return model; 135 | 136 | } 137 | 138 | // ====================REGESTERING DETAILS AND REDIRECTING TO WEBSITE HOME 139 | // PAGE=========================// 140 | @RequestMapping(value = "/savedetails", method = RequestMethod.POST) 141 | public ModelAndView addUser(@ModelAttribute("usersignform") User user) { 142 | userService.addUser(user); 143 | return new ModelAndView("redirect:/user/login"); 144 | } 145 | 146 | // =====================NAVIGATING TO ADDRESS EDIT 147 | // PAGE=============================================// 148 | @RequestMapping(value = "/address", method = RequestMethod.GET) 149 | public ModelAndView addressChange(HttpSession session) { 150 | 151 | ModelAndView model = new ModelAndView("address"); 152 | Address addr = userService.getAddress(session.getAttribute("user").toString()); 153 | System.out.println(addr.toString()); 154 | model.addObject("useremail", session.getAttribute("user")); 155 | model.addObject("addressform", addr); 156 | return model; 157 | 158 | } 159 | 160 | // ===================UPDATING ADDRESS AND REDIRECTING TO USER HOME 161 | // PAGE=============================// 162 | @RequestMapping(value = "/addresschange", method = RequestMethod.POST) 163 | public ModelAndView addressChange(@ModelAttribute("addressform") Address addr) { 164 | userService.addAddress(addr); 165 | return new ModelAndView("redirect:/user/home"); 166 | } 167 | 168 | // ==================ADDING PRODUCT TO 169 | // CART==============================================// 170 | @RequestMapping(value = "/product/{prodId}", method = RequestMethod.GET) 171 | public ModelAndView addtocart(@PathVariable("prodId") String prodId, HttpSession session) { 172 | 173 | ModelAndView model = new ModelAndView("userPage"); 174 | List list = userService.listAllProducts(); 175 | Bufcart buf = new Bufcart(); 176 | buf.setProductId(prodId); 177 | Product prod = userService.getProduct(prodId); 178 | buf.setProductName(prod.getProductname()); 179 | buf.setPrice(prod.getProductprice()); 180 | String email = (String) session.getAttribute("user"); 181 | buf.setEmail(email); 182 | buf.setQuantity("1"); 183 | buf.setOrderId(0); 184 | userService.addToCart(buf); 185 | model.addObject("useremail", session.getAttribute("user")); 186 | model.addObject("listProduct", list); 187 | session.setAttribute("user", session.getAttribute("user")); 188 | return model; 189 | 190 | } 191 | 192 | // =====================NAVIGATING TO VIEW CART PAGE 193 | // =================================// 194 | 195 | @RequestMapping(value = "/viewcart", method = RequestMethod.GET) 196 | public ModelAndView viewCart(HttpSession session) { 197 | 198 | ModelAndView model = new ModelAndView("viewcart"); 199 | String email = (String) session.getAttribute("user"); 200 | List list = userService.listAllBufCart(email); 201 | model.addObject("listBufcart", list); 202 | return model; 203 | 204 | } 205 | 206 | // =====================UPDATING QUANTITY IN CART 207 | // ITEMS====================================// 208 | 209 | @RequestMapping(value = "/updateQuantity", method = RequestMethod.POST) 210 | public ModelAndView updateQuantity(@RequestParam("newquantity") String quantity, 211 | @RequestParam("newprodId") String productId, HttpSession session) { 212 | 213 | String email = (String) session.getAttribute("user"); 214 | ModelAndView model = new ModelAndView("viewcart"); 215 | List list = userService.listAllBufCart(email); 216 | list.forEach(buf -> { 217 | if (buf.getEmail().equals(email) && buf.getProductId().equals(productId)) { 218 | Bufcart bufcart = buf; 219 | bufcart.setQuantity(quantity); 220 | userService.addToCart(bufcart); 221 | } 222 | }); 223 | model.addObject("listBufcart", list); 224 | return model; 225 | 226 | } 227 | 228 | // =================REMOVING ITEM FROM CART 229 | // ITEMS===================================================// 230 | 231 | @RequestMapping(value = "/removeItem", method = RequestMethod.POST) 232 | public ModelAndView removeItem(@RequestParam("newdelprodId") String productId, HttpSession session) { 233 | 234 | String email = (String) session.getAttribute("user"); 235 | ModelAndView model = new ModelAndView("viewcart"); 236 | 237 | userService.listAllBufCart(email).forEach(buf -> { 238 | if (buf.getEmail().equals(email) && buf.getProductId().equals(productId)) { 239 | userService.removeItem(buf.getBufcartId()); 240 | } 241 | }); 242 | List list = userService.listAllBufCart(email); 243 | model.addObject("listBufcart", list); 244 | return model; 245 | 246 | } 247 | 248 | // ===============PLACING 249 | // ORDER==================================================================// 250 | 251 | @RequestMapping(value = "/place", method = RequestMethod.GET) 252 | public ModelAndView placeOrder(HttpSession session) { 253 | 254 | String email = (String) session.getAttribute("user"); 255 | List list = userService.listAllBufCart(email); 256 | 257 | Random rand = new Random(); 258 | OrderPlaced opd = new OrderPlaced(); 259 | int orderId = rand.nextInt(10000); 260 | opd.setOrderId(orderId); 261 | opd.setEmail(email); 262 | int tosum = 0; 263 | for (int i = 0; i < list.size(); i++) { 264 | int price = Integer.parseInt(list.get(i).getPrice()); 265 | int quantity = Integer.parseInt(list.get(i).getQuantity()); 266 | tosum = tosum + (price * quantity); 267 | } 268 | opd.setTotalCost(Integer.toString(tosum)); 269 | DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); 270 | Date date = new Date(); 271 | opd.setOrderDate(dateFormat.format(date)); 272 | opd.setOrderStatus("Pending"); 273 | userService.placeOrder(opd); 274 | list.forEach(action -> { 275 | action.setOrderId(orderId); 276 | userService.addToCart(action); 277 | }); 278 | 279 | return new ModelAndView("redirect:/user/home"); 280 | 281 | } 282 | 283 | // ==============================ADMIN CONTROLLER 284 | // MODULES============================================// 285 | 286 | @RequestMapping(value = "/adminhome") 287 | public ModelAndView homeDirectAdmin(HttpSession session) throws NoSuchAlgorithmException { 288 | 289 | ModelAndView model = new ModelAndView("adminPage"); 290 | List list = userService.listAllProducts(); 291 | model.addObject("useremail", session.getAttribute("user")); 292 | model.addObject("listAdminProduct", list); 293 | session.setAttribute("user", session.getAttribute("user")); 294 | return model; 295 | 296 | } 297 | 298 | // ========================NAVIGATING TO ADD PRODUCT 299 | // PAGE============================================// 300 | @RequestMapping(value = "/addProductView", method = RequestMethod.GET) 301 | public ModelAndView addProductView() { 302 | 303 | ModelAndView model = new ModelAndView("addItem"); 304 | Product prod = new Product(); 305 | model.addObject("productform", prod); 306 | return model; 307 | 308 | } 309 | 310 | // =======================ADDING PRODUCT TO 311 | // DATABASE============================================// 312 | @RequestMapping(value = "/addProduct", method = RequestMethod.POST) 313 | public ModelAndView addProduct(@ModelAttribute("productform") Product prod, HttpSession session) { 314 | 315 | // saving user details in database 316 | Random rand = new Random(); 317 | System.out.println(prod.toString()); 318 | prod.setProductId(Integer.toString(rand.nextInt(10000))); 319 | userService.addProduct(prod); 320 | return new ModelAndView("redirect:/user/adminhome"); 321 | 322 | } 323 | 324 | // ========================NAVIGATING TO EDIT PRODUCT 325 | // PAGE============================================// 326 | @RequestMapping(value = "/editproduct/{prodId}", method = RequestMethod.GET) 327 | public ModelAndView editProductView(@PathVariable("prodId") String prodId) { 328 | 329 | ModelAndView model = new ModelAndView("editItem"); 330 | Product selProd = userService.getProduct(prodId); 331 | System.out.println(selProd.toString()); 332 | Product prod = new Product(); 333 | model.addObject("productform", prod); 334 | model.addObject("selproduct", selProd); 335 | return model; 336 | 337 | } 338 | 339 | // =======================ADDING PRODUCT TO 340 | // DATABASE============================================// 341 | @RequestMapping(value = "/editProductsave", method = RequestMethod.POST) 342 | public ModelAndView editProduct(@ModelAttribute("productform") Product prod, HttpSession session) { 343 | 344 | // updating user details in database 345 | 346 | userService.editProduct(prod); 347 | return new ModelAndView("redirect:/user/adminhome"); 348 | 349 | } 350 | 351 | // ========================NAVIGATING TO EDIT PRODUCT 352 | // PAGE============================================// 353 | @RequestMapping(value = "/delproduct/{prodId}", method = RequestMethod.GET) 354 | public ModelAndView delProductView(@PathVariable("prodId") String prodId) { 355 | 356 | userService.delProduct(prodId); 357 | return new ModelAndView("redirect:/user/adminhome"); 358 | 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.project.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.hiber.model.Address; 6 | import com.hiber.model.Admin; 7 | import com.hiber.model.Bufcart; 8 | import com.hiber.model.OrderPlaced; 9 | import com.hiber.model.Product; 10 | import com.hiber.model.User; 11 | 12 | public interface UserDao { 13 | 14 | public void addUser(User user); 15 | 16 | public User findUserBy(String email); 17 | 18 | public Admin findAdminBy(String email); 19 | 20 | public List listAllUser(); 21 | 22 | public List listAllAdmin(); 23 | 24 | public void addAddress(Address addr); 25 | 26 | public Address getAddress(String email); 27 | 28 | public List listAllProducts(); 29 | 30 | public Product getProduct(String prodId); 31 | 32 | public void addProduct(Product prod); 33 | 34 | public void editProduct(Product prod); 35 | 36 | public void delProduct(String prod); 37 | 38 | public void addToCart(Bufcart bufcart); 39 | 40 | public List listAllBufCart(String email); 41 | 42 | public void removeItem(int bufcartId); 43 | 44 | public void placeOrder(OrderPlaced opd); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/dao/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.project.dao; 2 | 3 | import java.security.NoSuchAlgorithmException; 4 | import java.util.List; 5 | 6 | import org.hibernate.Session; 7 | import org.hibernate.SessionFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import com.hiber.model.Address; 12 | import com.hiber.model.Admin; 13 | import com.hiber.model.Bufcart; 14 | import com.hiber.model.OrderPlaced; 15 | import com.hiber.model.Product; 16 | import com.hiber.model.User; 17 | import com.project.util.PasswordUtil; 18 | 19 | @Repository 20 | public class UserDaoImpl implements UserDao { 21 | 22 | @Autowired 23 | private SessionFactory sessionFactory; 24 | 25 | protected Session getCurrentSession() { 26 | return sessionFactory.getCurrentSession(); 27 | } 28 | 29 | @Override 30 | public void addUser(User user) { 31 | // TODO Auto-generated method stub 32 | Session session = this.sessionFactory.getCurrentSession(); 33 | PasswordUtil putil = new PasswordUtil(); 34 | String salt = putil.getSalt(); 35 | try { 36 | String newPass = putil.hashAndSaltPassword(user.getPassword(), salt); 37 | user.setPassword(newPass); 38 | user.setSalt(salt); 39 | session.persist(user); 40 | } catch (NoSuchAlgorithmException e) { 41 | // TODO Auto-generated catch block 42 | e.printStackTrace(); 43 | } 44 | 45 | } 46 | 47 | @Override 48 | public User findUserBy(String email) { 49 | // TODO Auto-generated method stub 50 | Session session = this.sessionFactory.getCurrentSession(); 51 | String hql = "FROM User WHERE email ='" + email + "'"; 52 | User results = (User) session.createQuery(hql).getSingleResult(); 53 | return results; 54 | } 55 | 56 | @Override 57 | public Admin findAdminBy(String email) { 58 | // TODO Auto-generated method stub 59 | Session session = this.sessionFactory.getCurrentSession(); 60 | String hql = "FROM Admin WHERE email ='" + email + "'"; 61 | Admin results = (Admin) session.createQuery(hql).getSingleResult(); 62 | return results; 63 | } 64 | 65 | @Override 66 | public List listAllUser() { 67 | // TODO Auto-generated method stub 68 | Session session = this.sessionFactory.getCurrentSession(); 69 | List emps = session.createQuery("from User", User.class).list(); 70 | return emps; 71 | } 72 | 73 | @Override 74 | public List listAllAdmin() { 75 | // TODO Auto-generated method stub 76 | Session session = this.sessionFactory.getCurrentSession(); 77 | List emps = session.createQuery("from Admin", Admin.class).list(); 78 | return emps; 79 | } 80 | 81 | @Override 82 | public void addAddress(Address addr) { 83 | // TODO Auto-generated method stub 84 | Session session = this.sessionFactory.getCurrentSession(); 85 | session.saveOrUpdate(addr); 86 | } 87 | 88 | @Override 89 | public Address getAddress(String email) { 90 | // TODO Auto-generated method stub 91 | Session session = this.sessionFactory.getCurrentSession(); 92 | Address address = session.createQuery("from Address where email='" + email + "'", Address.class) 93 | .getSingleResult(); 94 | System.out.println(address.toString()); 95 | return address; 96 | } 97 | 98 | @Override 99 | public List listAllProducts() { 100 | // TODO Auto-generated method stub 101 | Session session = this.sessionFactory.getCurrentSession(); 102 | List emps = session.createQuery("from Product", Product.class).list(); 103 | return emps; 104 | } 105 | 106 | @Override 107 | public Product getProduct(String prodId) { 108 | // TODO Auto-generated method stub 109 | Session session = this.sessionFactory.getCurrentSession(); 110 | String hql = "FROM Product WHERE productId =" + prodId; 111 | Product results = (Product) session.createQuery(hql).getSingleResult(); 112 | return results; 113 | } 114 | 115 | @Override 116 | public void addProduct(Product prod) { 117 | // TODO Auto-generated method stub 118 | Session session = this.sessionFactory.getCurrentSession(); 119 | session.persist(prod); 120 | } 121 | 122 | @Override 123 | public void editProduct(Product prod) { 124 | // TODO Auto-generated method stub 125 | Session session = this.sessionFactory.getCurrentSession(); 126 | session.update(prod); 127 | } 128 | 129 | @Override 130 | public void delProduct(String prod) { 131 | // TODO Auto-generated method stub 132 | Session session = this.sessionFactory.getCurrentSession(); 133 | Product product = session.get(Product.class, prod); 134 | session.delete(product); 135 | } 136 | 137 | @Override 138 | public void addToCart(Bufcart bufcart) { 139 | // TODO Auto-generated method stub 140 | Session session = this.sessionFactory.getCurrentSession(); 141 | session.saveOrUpdate(bufcart); 142 | } 143 | 144 | @Override 145 | public List listAllBufCart(String email) { 146 | // TODO Auto-generated method stub 147 | Session session = this.sessionFactory.getCurrentSession(); 148 | String hql = "FROM Bufcart WHERE email ='" + email + "'"; 149 | @SuppressWarnings("unchecked") 150 | List results = session.createQuery(hql).list(); 151 | return results; 152 | } 153 | 154 | @Override 155 | public void removeItem(int bufcartId) { 156 | // TODO Auto-generated method stub 157 | Session session = this.sessionFactory.getCurrentSession(); 158 | Bufcart product = session.get(Bufcart.class, bufcartId); 159 | session.delete(product); 160 | } 161 | 162 | @Override 163 | public void placeOrder(OrderPlaced opd) { 164 | // TODO Auto-generated method stub 165 | Session session = this.sessionFactory.getCurrentSession(); 166 | session.saveOrUpdate(opd); 167 | } 168 | 169 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.project.service; 2 | 3 | import java.util.List; 4 | 5 | import com.hiber.model.Address; 6 | import com.hiber.model.Admin; 7 | import com.hiber.model.Bufcart; 8 | import com.hiber.model.OrderPlaced; 9 | import com.hiber.model.Product; 10 | import com.hiber.model.User; 11 | 12 | public interface UserService { 13 | 14 | public void addUser(User user); 15 | 16 | public User findUserBy(String email); 17 | 18 | public Admin findAdminBy(String email); 19 | 20 | public List listAllUser(); 21 | 22 | public List listAllAdmin(); 23 | 24 | public void addAddress(Address addr); 25 | 26 | public Address getAddress(String email); 27 | 28 | public List listAllProducts(); 29 | 30 | public Product getProduct(String prodId); 31 | 32 | public void addProduct(Product prod); 33 | 34 | public void editProduct(Product prod); 35 | 36 | public void delProduct(String prod); 37 | 38 | public void addToCart(Bufcart bufcart); 39 | 40 | public List listAllBufCart(String email); 41 | 42 | public void removeItem(int bufcartId); 43 | 44 | public void placeOrder(OrderPlaced opd); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.project.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.hiber.model.Address; 10 | import com.hiber.model.Admin; 11 | import com.hiber.model.Bufcart; 12 | import com.hiber.model.OrderPlaced; 13 | import com.hiber.model.Product; 14 | import com.hiber.model.User; 15 | import com.project.dao.UserDao; 16 | 17 | @Service 18 | @Transactional 19 | public class UserServiceImpl implements UserService { 20 | 21 | private UserDao userDao; 22 | 23 | @Autowired 24 | public void setUserDao(UserDao userDao) { 25 | this.userDao = userDao; 26 | } 27 | 28 | @Override 29 | public void addUser(User user) { 30 | // TODO Auto-generated method stub 31 | userDao.addUser(user); 32 | } 33 | 34 | @Override 35 | public User findUserBy(String email) { 36 | // TODO Auto-generated method stub 37 | return userDao.findUserBy(email); 38 | } 39 | 40 | @Override 41 | public List listAllProducts() { 42 | // TODO Auto-generated method stub 43 | return userDao.listAllProducts(); 44 | } 45 | 46 | @Override 47 | public void addAddress(Address addr) { 48 | // TODO Auto-generated method stub 49 | userDao.addAddress(addr); 50 | } 51 | 52 | @Override 53 | public Address getAddress(String email) { 54 | // TODO Auto-generated method stub 55 | return userDao.getAddress(email); 56 | } 57 | 58 | @Override 59 | public void addToCart(Bufcart bufcart) { 60 | // TODO Auto-generated method stub 61 | userDao.addToCart(bufcart); 62 | } 63 | 64 | @Override 65 | public Product getProduct(String prodId) { 66 | // TODO Auto-generated method stub 67 | return userDao.getProduct(prodId); 68 | } 69 | 70 | @Override 71 | public List listAllBufCart(String email) { 72 | // TODO Auto-generated method stub 73 | return userDao.listAllBufCart(email); 74 | } 75 | 76 | @Override 77 | public void removeItem(int bufcartId) { 78 | // TODO Auto-generated method stub 79 | userDao.removeItem(bufcartId); 80 | } 81 | 82 | @Override 83 | public void placeOrder(OrderPlaced opd) { 84 | // TODO Auto-generated method stub 85 | userDao.placeOrder(opd); 86 | } 87 | 88 | @Override 89 | public Admin findAdminBy(String email) { 90 | // TODO Auto-generated method stub 91 | return userDao.findAdminBy(email); 92 | } 93 | 94 | @Override 95 | public List listAllUser() { 96 | // TODO Auto-generated method stub 97 | return userDao.listAllUser(); 98 | } 99 | 100 | @Override 101 | public List listAllAdmin() { 102 | // TODO Auto-generated method stub 103 | return userDao.listAllAdmin(); 104 | } 105 | 106 | @Override 107 | public void addProduct(Product prod) { 108 | // TODO Auto-generated method stub 109 | userDao.addProduct(prod); 110 | } 111 | 112 | @Override 113 | public void editProduct(Product prod) { 114 | // TODO Auto-generated method stub 115 | userDao.editProduct(prod); 116 | } 117 | 118 | @Override 119 | public void delProduct(String prod) { 120 | // TODO Auto-generated method stub 121 | userDao.delProduct(prod); 122 | } 123 | 124 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/java/com/project/util/PasswordUtil.java: -------------------------------------------------------------------------------- 1 | package com.project.util; 2 | 3 | import java.security.MessageDigest; 4 | import java.security.NoSuchAlgorithmException; 5 | import java.security.SecureRandom; 6 | import java.util.Base64; 7 | import java.util.Random; 8 | 9 | public class PasswordUtil { 10 | 11 | public static String hashPassword(String password) throws NoSuchAlgorithmException { 12 | MessageDigest md = MessageDigest.getInstance("SHA-256"); 13 | md.reset(); 14 | md.update(password.getBytes()); 15 | byte[] mdArray = md.digest(); 16 | StringBuilder sb = new StringBuilder(mdArray.length * 2); 17 | for (byte b : mdArray) { 18 | int v = b & 0xff; 19 | if (v < 16) { 20 | sb.append(0); 21 | } 22 | sb.append(Integer.toHexString(v)); 23 | } 24 | return sb.toString(); 25 | } 26 | 27 | public static String getSalt() { 28 | Random r = new SecureRandom(); 29 | byte[] saltBytes = new byte[32]; 30 | r.nextBytes(saltBytes); 31 | 32 | return Base64.getEncoder().encodeToString(saltBytes); 33 | } 34 | 35 | public static String hashAndSaltPassword(String password, String salt) throws NoSuchAlgorithmException { 36 | 37 | return hashPassword(password + salt); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /Furniture_Spring/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=TRACE, Appender1, Appender2 2 | 3 | log4j.appender.Appender1=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Appender1.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.Appender1.layout.ConversionPattern=%-7p %d [%t] %c %x - %m%n 6 | 7 | #TRACE 8 | #DEBUG 9 | #INFO 10 | #WARN 11 | #ERROR -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/images/MainPage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/src/main/webapp/WEB-INF/images/MainPage.jpg -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/addItem.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 6 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | 15 |
16 | 28 |
29 |
30 |
31 | 32 | 33 |
34 |

Add Products

35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/address.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 3 | pageEncoding="ISO-8859-1"%> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 6 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 7 | 8 | 9 | 10 | 11 | 12 | Home Of Furniture 13 | 14 | 15 | 16 | <% 17 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. 18 | response.setHeader("Pragma", "no-cache"); // HTTP 1.0. 19 | response.setHeader("Expires", "0"); // Proxies. 20 | 21 | if(session.getAttribute("user")==null){ 22 | response.sendRedirect("${loginrURL}"); 23 | } 24 | %> 25 | 26 | 27 | 44 |
45 |
46 | 47 | 48 |

Please provide us your location


49 |
50 | 51 |
52 |
53 |
54 |
55 |
56 | 57 |
58 |
59 |
60 |
61 |
62 | 63 |
64 |
65 |
66 |
67 |
68 | 69 |
70 |
71 | 72 | 73 |
74 |
75 |

76 |
77 |
78 | 81 |
82 |
83 |
84 |
85 |
86 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/adminPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 6 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | 15 |
16 | 28 |
29 |
30 |
31 |
32 | 33 |
34 |
35 |
36 |

37 | ${prod.productname}

38 |

39 | ${prod.description}

40 |
41 |
42 |

43 | ${prod.productprice}

44 |
45 |
46 | 47 | Edit Items 48 |
49 |
50 | 51 | Remove 52 |
53 |
54 |
55 |
56 |
57 | 58 |
59 |
60 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/editItem.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | Home 12 | 13 | 14 |
15 | 27 |
28 |
29 |
30 | 31 | 32 |
33 |

Edit Products

34 |

Please provide new description for the updated product

35 |
36 |
37 |
38 |
39 |
40 | 41 |
42 |
43 |
44 | 45 | 46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | 55 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | ') no-repeat center center;"> 15 | 26 |
27 |

Furniture Mart

28 |

Its home for furniture products

29 |
30 |
31 |
32 |
33 | 34 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | 15 | 26 | 27 | 28 |
29 | 30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/signup.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | Sign Up 11 | 12 | 13 | 14 | 15 | 62 | 69 |

Create your account:

70 | 71 | 72 |
73 | 74 |
75 |
76 |
77 |
78 |
79 | 80 |
81 |
82 |
83 |
84 |
85 | 86 |
87 |
88 | 89 |
90 |
91 | 92 |
93 |
94 |

95 |
96 | 97 |
98 |
99 |
100 |
101 |
102 | 103 |
104 |
105 |
106 |
107 |
108 | 109 |
110 |
111 |
112 |
113 |
114 | 115 |
116 |
117 | 118 |
119 |
120 | 178 |
179 | 180 |
181 |
182 | 183 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/userPage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 3 | pageEncoding="ISO-8859-1"%> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 6 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 7 | 8 | 9 | 10 | 11 | 12 | Home Of Furniture 13 | 14 | 15 | 16 | <% 17 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. 18 | response.setHeader("Pragma", "no-cache"); // HTTP 1.0. 19 | response.setHeader("Expires", "0"); // Proxies. 20 | 21 | if(session.getAttribute("user")==null){ 22 | response.sendRedirect("${loginrURL}"); 23 | } 24 | %> 25 | 26 | 27 | 28 | 81 | 99 | 100 | 159 | 160 |
161 |
162 | 163 |
164 |
165 |
166 |

167 | ${prod.productname}

168 |

169 | ${prod.description}

170 |
171 |
172 |

173 | ${prod.productprice}

174 |
175 |
176 | 177 | Add to cart 178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 | 187 | 188 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/views/viewcart.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | View Cart 15 | 16 | 17 | 34 | 35 |
36 |

Click to continue your shopping

37 |
38 | 39 | Continue Shopping 40 |

To change Quantity, Edit Quantity and Click on Update button

41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 | 66 | 67 | 68 | 69 | 72 | 78 | 83 | 87 | 88 | 89 | 96 | 97 | 98 | 99 | 100 | 101 | 106 | 107 | 108 | 109 | 114 | 119 | 120 | 121 |
ProductPriceQuantitySubtotal
59 |
60 |
61 |

${prod.productName}

62 | 63 |
64 |
65 |
${prod.price} 70 | 71 | 79 | 82 | 84 | 85 | 86 | 90 | 91 | 92 | 93 | 94 | 95 |
102 | 105 |
115 | 116 | Checkout 117 | 118 |
122 |
123 | 124 | -------------------------------------------------------------------------------- /Furniture_Spring/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | To do List 7 | 8 | /list 9 | 10 | 11 | first-web 12 | org.springframework.web.servlet.DispatcherServlet 13 | 1 14 | 15 | 16 | 17 | first-web 18 | /user 19 | 20 | -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/Address.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/Address.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/Admin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/Admin.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/Bufcart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/Bufcart.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/OrderPlaced.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/OrderPlaced.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/Product.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/hiber/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/hiber/model/User.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/config/WebConfig$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/config/WebConfig$1.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/config/WebConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/config/WebConfig.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/config/WebInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/config/WebInitializer.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/controller/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/controller/HomeController.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/dao/UserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/dao/UserDao.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/dao/UserDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/dao/UserDaoImpl.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/service/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/service/UserService.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/service/UserServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/service/UserServiceImpl.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/com/project/util/PasswordUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/classes/com/project/util/PasswordUtil.class -------------------------------------------------------------------------------- /Furniture_Spring/target/classes/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=TRACE, Appender1, Appender2 2 | 3 | log4j.appender.Appender1=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Appender1.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.Appender1.layout.ConversionPattern=%-7p %d [%t] %c %x - %m%n 6 | 7 | #TRACE 8 | #DEBUG 9 | #INFO 10 | #WARN 11 | #ERROR -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT.war: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT.war -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/config/WebConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/config/WebConfig.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/config/WebInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/config/WebInitializer.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/controller/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/controller/HomeController.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDao.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$1.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$ProductMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$ProductMapper.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$UserMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl$UserMapper.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/dao/UserDaoImpl.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/PasswordUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/PasswordUtil.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/Product.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/model/User.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/service/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/service/UserService.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/service/UserServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/com/project/service/UserServiceImpl.class -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/classes/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=TRACE, Appender1, Appender2 2 | 3 | log4j.appender.Appender1=org.apache.log4j.ConsoleAppender 4 | log4j.appender.Appender1.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.Appender1.layout.ConversionPattern=%-7p %d [%t] %c %x - %m%n 6 | 7 | #TRACE 8 | #DEBUG 9 | #INFO 10 | #WARN 11 | #ERROR -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/images/MainPage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/images/MainPage.jpg -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/javax.servlet-api-3.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/javax.servlet-api-3.1.0.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-aop-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-aop-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-beans-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-beans-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-context-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-core-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-core-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-expression-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-expression-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-jdbc-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-jdbc-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-tx-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-tx-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-web-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-web-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-webmvc-4.2.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/lib/spring-webmvc-4.2.2.RELEASE.jar -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | ') no-repeat center center;"> 15 | 27 |
31 | 32 |

Furniture Mart

33 |

Its home for furniture products

34 | 35 |
36 |
37 |
38 |
39 | 40 | 41 |
42 |
43 |
44 | 45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | Home 13 | 14 | 15 | 26 | 27 | 28 |
29 | 30 |
31 |
32 |
33 |
34 |
35 | 36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 | 47 | 48 |
49 | 50 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/signup.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | Sign Up 11 | 12 | 13 | 14 | 15 | 62 | 69 | 70 |

Create your account:

71 | 72 | 73 |
74 | 75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |
83 |
84 |
85 |
86 | 87 |
88 |
89 | 90 |
91 |
92 | 93 |
94 |
95 |

96 |
97 | 98 |
99 |
100 |
101 |
102 |
103 | 104 |
105 |
106 |
107 |
108 |
109 | 110 |
111 |
112 |
113 |
114 |
115 | 116 |
117 |
118 | 119 |
120 |
121 | 122 | 123 | 181 | 182 |
183 | 184 |
185 | 186 |
187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/userPage.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 3 | pageEncoding="ISO-8859-1"%> 4 | 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 8 | 9 | 10 | 11 | 12 | 13 | Home Of Furniture 14 | 15 | 16 | 17 | 18 | 19 | 72 | 87 | 146 | 147 |
148 | 149 |
150 | 151 | 152 |
153 |
154 | 155 |
156 |

157 | ${prod.productname}

158 |

159 | ${prod.description}

160 |
161 |
162 |

163 | ${prod.productprice}

164 |
165 |
166 | Add to cart 167 |
168 |
169 |
170 |
171 |
172 | 173 |
174 |
175 |
176 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/user_form.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | 6 | 7 | 8 | 9 | user form 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
Firstname:
LastName:
email:
password:
Phonenumber:
41 |
42 | 43 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/views/user_page.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 6 | 7 | 8 | 9 | 10 | user page 11 | 12 | 13 | 14 | 15 | Add User 16 |

Users List

17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 37 | 38 | 39 | 40 |
EmailFirstnameLastnameAction
${user.email}${user.firstName}${user.lastName} 30 | 31 | Update 32 | 34 | 35 | Delete 36 |
41 | 42 | -------------------------------------------------------------------------------- /Furniture_Spring/target/first-web-0.0.1-SNAPSHOT/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | To do List 7 | 8 | /list 9 | 10 | 11 | first-web 12 | org.springframework.web.servlet.DispatcherServlet 13 | 1 14 | 15 | 16 | 17 | first-web 18 | /user 19 | 20 | -------------------------------------------------------------------------------- /Furniture_Spring/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: Chandrakanth 3 | Build-Jdk: 1.8.0_144 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /Furniture_Spring/target/m2e-wtp/web-resources/META-INF/maven/com.project/first-web/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Tue Sep 10 21:55:23 EDT 2019 3 | version=0.0.1-SNAPSHOT 4 | groupId=com.project 5 | m2e.projectName=first-web 6 | m2e.projectLocation=C\:\\Users\\Chandrakanth\\Desktop\\GitHubWorkSpace\\E-Commerce Application Spring Hibernate\\Furniture_Spring 7 | artifactId=first-web 8 | -------------------------------------------------------------------------------- /Furniture_Spring/target/m2e-wtp/web-resources/META-INF/maven/com.project/first-web/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.project 5 | first-web 6 | 0.0.1-SNAPSHOT 7 | war 8 | 9 | 10 | 11 | javax.servlet 12 | jstl 13 | 1.2 14 | 15 | 16 | 17 | javax.servlet 18 | javax.servlet-api 19 | 3.1.0 20 | 21 | 22 | org.springframework 23 | spring-context 24 | 4.3.18.RELEASE 25 | 26 | 27 | 28 | org.springframework 29 | spring-tx 30 | 4.3.18.RELEASE 31 | 32 | 33 | 34 | org.springframework 35 | spring-core 36 | 4.3.18.RELEASE 37 | 38 | 39 | 40 | org.springframework 41 | spring-web 42 | 4.3.18.RELEASE 43 | 44 | 45 | 46 | org.springframework 47 | spring-context-support 48 | 4.3.18.RELEASE 49 | 50 | 51 | 52 | org.springframework 53 | spring-webmvc 54 | 4.3.18.RELEASE 55 | 56 | 57 | 58 | org.springframework 59 | spring-orm 60 | 4.3.18.RELEASE 61 | 62 | 63 | 64 | org.hibernate 65 | hibernate-entitymanager 66 | 5.3.1.Final 67 | 68 | 69 | 70 | org.hibernate 71 | hibernate-core 72 | 5.3.1.Final 73 | 74 | 75 | commons-dbcp 76 | commons-dbcp 77 | 1.4 78 | 79 | 80 | log4j 81 | log4j 82 | 1.2.17 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | org.apache.maven.plugins 91 | maven-compiler-plugin 92 | 3.2 93 | 94 | true 95 | 1.7 96 | 1.7 97 | true 98 | 99 | 100 | 101 | org.apache.tomcat.maven 102 | tomcat7-maven-plugin 103 | 2.2 104 | 105 | / 106 | true 107 | 108 | 109 | 110 | org.apache.maven.plugins 111 | maven-war-plugin 112 | 2.6 113 | 114 | false 115 | 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Furniture_Spring/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Apache Maven 2 | #Thu Mar 08 00:36:12 EST 2018 3 | version=0.0.1-SNAPSHOT 4 | groupId=com.project 5 | artifactId=first-web 6 | -------------------------------------------------------------------------------- /Furniture_Spring/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com\project\dao\UserDaoImpl$1.class 2 | com\project\config\WebInitializer.class 3 | com\project\service\UserService.class 4 | com\project\model\Product.class 5 | com\project\dao\UserDaoImpl.class 6 | com\project\model\PasswordUtil.class 7 | com\project\dao\UserDaoImpl$ProductMapper.class 8 | com\project\service\UserServiceImpl.class 9 | com\project\config\WebConfig.class 10 | com\project\model\User.class 11 | com\project\dao\UserDaoImpl$UserMapper.class 12 | com\project\controller\HomeController.class 13 | com\project\dao\UserDao.class 14 | -------------------------------------------------------------------------------- /Furniture_Spring/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\service\UserService.java 2 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\controller\HomeController.java 3 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\model\PasswordUtil.java 4 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\config\WebInitializer.java 5 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\dao\UserDao.java 6 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\dao\UserDaoImpl.java 7 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\model\Product.java 8 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\config\WebConfig.java 9 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\model\User.java 10 | C:\Users\Chandrakanth\eclipse-workspace\first-web\src\main\java\com\project\service\UserServiceImpl.java 11 | -------------------------------------------------------------------------------- /Furniture_Spring/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyela/Spring-Web-App/3d32f3add2c3b31cd50b06974a8aa75c38fcf93b/Furniture_Spring/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Spring Web Application 2 | #### Its a E-Commerce Shopping Application built for both Admin and Customer operations. Application is built using Spring framework and Data base handling is managed using Hibernate ORM Tool. 3 | #### Following are the operations that can be performed by the Respective User 4 | * Admin 5 | * Adding products 6 | * Updating products 7 | * Deleting products 8 | * Customer 9 | * Registering into System 10 | * Login into Website 11 | * Updating Address 12 | * Adding product to Cart 13 | * Updating/ Deleting the Product 14 | * Placing the order 15 | 16 | * Technologies: 17 | * Maven Project 18 | * Apache Tomcat 19 | * Spring Java Configuration 20 | * Hibernate Session Factory 21 | * JSP, Spring Forms 22 | * JSTL 23 | * MySQL 24 | --------------------------------------------------------------------------------