Skip to content

Commit 7b26cf2

Browse files
committed
New Updated code with servlet dependency
1 parent ea2616d commit 7b26cf2

112 files changed

Lines changed: 9482 additions & 415 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@
101101
<version>3.2.3.RELEASE</version>
102102
<scope>test</scope>
103103
</dependency>
104-
<dependency>
105-
<groupId>javax.servlet</groupId>
106-
<artifactId>javax.servlet-api</artifactId>
107-
<version>3.1.0</version>
108-
<scope>provided</scope>
109-
</dependency>
104+
110105
<dependency>
111106
<groupId>ch.qos.logback</groupId>
112107
<artifactId>logback-classic</artifactId>

target/VProfile-1.0.war

17.3 MB
Binary file not shown.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
5+
xmlns:tx="http://www.springframework.org/schema/tx"
6+
xmlns="http://www.springframework.org/schema/beans"
7+
xsi:schemaLocation="http://www.springframework.org/schema/beans
8+
http://www.springframework.org/schema/beans/spring-beans.xsd
9+
http://www.springframework.org/schema/data/jpa
10+
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
11+
http://www.springframework.org/schema/tx
12+
http://www.springframework.org/schema/tx/spring-tx.xsd">
13+
14+
15+
<!-- Configure the data source bean -->
16+
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
17+
<property name="driverClassName" value="${jdbc.driverClassName}"/>
18+
<property name="url" value="${jdbc.url}"/>
19+
<property name="username" value="${jdbc.username}"/>
20+
<property name="password" value="${jdbc.password}"/>
21+
</bean>
22+
23+
<!-- Configure the entity manager factory bean -->
24+
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
25+
<property name="dataSource" ref="dataSource"/>
26+
<property name="packagesToScan" value="com.visualpathit.account.model"/>
27+
<property name="jpaVendorAdapter">
28+
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
29+
</property>
30+
<property name="jpaProperties">
31+
<props>
32+
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
33+
<prop key="hibernate.show_sql">true</prop>
34+
</props>
35+
</property>
36+
</bean>
37+
38+
<!-- Configure the transaction manager bean -->
39+
<bean id="transactionManager"
40+
class="org.springframework.orm.jpa.JpaTransactionManager">
41+
<property name="entityManagerFactory" ref="entityManagerFactory"/>
42+
</bean>
43+
44+
<!-- Enable annotation driven transaction management -->
45+
<tx:annotation-driven/>
46+
47+
<!--
48+
Configure Spring Data JPA and set the base package of the
49+
repository interfaces
50+
-->
51+
52+
<jpa:repositories base-package="com.visualpathit.account.repository"/>
53+
</beans>
54+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns:mvc="http://www.springframework.org/schema/mvc"
3+
xmlns="http://www.springframework.org/schema/beans"
4+
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/beans
5+
http://www.springframework.org/schema/beans/spring-beans.xsd">
6+
7+
<mvc:annotation-driven/>
8+
9+
<mvc:resources mapping="/resources/**" location="/resources/"/>
10+
11+
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
12+
<property name="basenames">
13+
<list>
14+
<value>classpath:validation</value>
15+
</list>
16+
</property>
17+
</bean>
18+
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
19+
<property name="prefix">
20+
<value>/WEB-INF/views/</value>
21+
</property>
22+
<property name="suffix">
23+
<value>.jsp</value>
24+
</property>
25+
</bean>
26+
</beans>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns:context="http://www.springframework.org/schema/context"
4+
xmlns="http://www.springframework.org/schema/beans"
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
6+
7+
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
8+
9+
<import resource="appconfig-mvc.xml"/>
10+
11+
<import resource="appconfig-data.xml"/>
12+
13+
<import resource="appconfig-security.xml"/>
14+
15+
<!-- Scans within the base package of the application for @Component classes to configure as beans -->
16+
<context:component-scan base-package="com.visualpathit.account.*"/>
17+
18+
<context:property-placeholder location="classpath:application.properties"/>
19+
20+
</beans>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans:beans xmlns="http://www.springframework.org/schema/security"
3+
xmlns:beans="http://www.springframework.org/schema/beans"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans
6+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7+
http://www.springframework.org/schema/security
8+
http://www.springframework.org/schema/security/spring-security.xsd">
9+
10+
<http auto-config="true">
11+
<intercept-url pattern="/" access="hasRole('ROLE_USER')"/>
12+
<intercept-url pattern="/welcome" access="hasRole('ROLE_USER')"/>
13+
<form-login login-page="/login" default-target-url="/welcome" authentication-failure-url="/login?error" username-parameter="username" password-parameter="password"/>
14+
<logout logout-success-url="/login?logout" />
15+
</http>
16+
17+
<authentication-manager alias="authenticationManager">
18+
<authentication-provider user-service-ref="userDetailsServiceImpl">
19+
<password-encoder ref="encoder"></password-encoder>
20+
</authentication-provider>
21+
</authentication-manager>
22+
23+
<beans:bean id="userDetailsServiceImpl" class="com.visualpathit.account.service.UserDetailsServiceImpl"></beans:bean>
24+
25+
<beans:bean id="encoder"
26+
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder">
27+
<beans:constructor-arg name="strength" value="11"/>
28+
</beans:bean>
29+
</beans:beans>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jdbc.driverClassName=com.mysql.jdbc.Driver
2+
jdbc.url=jdbc:mysql://localhost:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
3+
jdbc.username=Wahid
4+
jdbc.password=@khtar
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)