Project Structure:
select * from users;
select * from users;
select * from user_transaction
web.xml
----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<servlet>
<servlet-name>sdnext</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/sdnext-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>sdnext</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.html</welcome-file>
</welcome-file-list>
</web-app>
login.jsp
------------------------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<h2>New User Master Data</h2>
<form:form method="POST" action="login2.html" modelAttribute="user" id="form">
<table>
<tr><td> <form:input path="user_id" placeholder="User ID:" value="" disabled="true"/></td></tr>
<tr><td><form:input path="email_id" placeholder="Email ID:" value="" /></td></tr>
<tr> <td> <form:password path="password" placeholder="Password" value="" /> </td></tr>
</table>
<input type="submit" value="Log-in"/>
</form:form>
</body>
</html>
UserController.java
---------------------------------------------
package com.users.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
import javax.swing.text.View;
import com.users.bean.TransactionDetails;
import com.users.bean.UserBean;
import com.users.bean.trans;
import com.users.model.Transaction;
import com.users.model.User;
import com.users.service.UserService;
import com.users.service.transService;
@Controller
public class UserController {
@Autowired
private UserService userService;
@Autowired
private transService transService;
Map<String, Object> model1 = new HashMap<String, Object>();
@RequestMapping(value = "/save", method = RequestMethod.POST)
public ModelAndView saveUser( @ModelAttribute("user") UserBean u1, BindingResult result) {
User u = prepareModel(u1);
System.out.println("1");
userService.addUser(u);
// mail m = new mail(u1.getEmail_id());
System.out.println("2");
return new ModelAndView("save");
}
@RequestMapping(value = "/save2", method = RequestMethod.POST)
public ModelAndView edit2(@ModelAttribute("trans") trans t1, BindingResult result) {
System.out.println("inside save2");
System.out.println("save 2 trans id "+t1.getTransaction_id());
System.out.println("save 2 user_id "+t1.getUser_id());
Transaction t = prepareModelTrans(t1);
System.out.println("model of transaction details");
System.out.println("t. user_id "+t.getUser_id());
System.out.println("t.transaction_id "+t.getTransaction_id());
System.out.println("just before trans service");
transService.addTrans(t);
return new ModelAndView("lala");
}
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public ModelAndView editTrans( @RequestParam("transaction_id") Integer transaction_id)
{
trans t = new trans();
t.setTransaction_id(transaction_id);
System.out.println("inside 1");
model1.put("t1", t);
return new ModelAndView("yeye",model1);
//return new ModelAndView("yeye", model1);
}
@RequestMapping(value = "/login2", method = RequestMethod.POST)
public ModelAndView login( @ModelAttribute("user") UserBean u1, BindingResult result) {
System.out.println("In controller");
System.out.println("u1.getEmailId() "+u1.getEmail_id());
Map<String, Object> model = new HashMap<String, Object>();
try
{
System.out.println("a");
User u = userService.validateUser(u1.getEmail_id(), u1.getPassword());
if(u.getEmail_id().equalsIgnoreCase("null"))
return new ModelAndView("notsave");
}
catch(Exception e)
{
}
System.out.println("trans1");
List t2 = userService.listTransaction(u1.getEmail_id());
System.out.println("XoXo");
Iterator it=t2.iterator();
List<TransactionDetails> lst = new ArrayList<TransactionDetails>();
while(it.hasNext())
{
TransactionDetails d1 = new TransactionDetails();
Object rows[] = (Object[])it.next();
System.out.println("kaula");
String s = rows[1].toString();
String t = rows[0].toString();
d1.setTransaction_id(s);
d1.setUser_id(t);
System.out.println("umpur");
lst.add(d1);
System.out.println(rows[0]+ " -- " +rows[1]);
}
Iterator io=lst.iterator();
while(io.hasNext())
{
System.out.println(io.next());
}
model.put("t1", lst);
System.out.println("inbetween");
return new ModelAndView("save", model);
}
@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView welcome(@ModelAttribute("user") UserBean u1, BindingResult result) {
return new ModelAndView("login");
}
private User prepareModel(UserBean uBean){
User u1 = new User();
u1.setPassword(uBean.getPassword());
u1.setEmail_id(uBean.getEmail_id());
u1.setUser_id(uBean.getUser_id());
uBean.setUser_id(null);
return u1;
}
private Transaction prepareModelTrans(trans t){
Transaction t1 = new Transaction();
t1.setUser_id(t.getUser_id());
t1.setTransaction_id(t.getTransaction_id());
return t1;
}
}
mail.java
--------------------------------------
package com.users.controller;
import java.util.Properties;
import java.util.regex.Pattern;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import org.apache.xerces.impl.xs.identity.Selector.Matcher;
public class mail {
mail(String m)
{
System.out.println("in mail constructor");
boolean trueBinary = false;
final String username = "< SENDING SERVER ID";
final String password = "SENDING SERVER PASSWORD";
String patt = "@(([a-zA-Z0-9_/-/.]+))*.*.";
Pattern pattern2 =Pattern.compile(patt);
java.util.regex.Matcher mat = pattern2.matcher(m);
int count = 0;
while(mat.find()) {
System.out.println("found gila bila: " + mat.group(0));
if(mat.group(0).equals("@gmail.com"))
{
System.out.println("gmail");
trueBinary = true;
}
else
trueBinary = false;
}
if(trueBinary == true)
{
Properties props = new Properties();
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("SENDING SERVER ID"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(m));
message.setSubject("Registration Complete");
message.setText("Dear user you have successfully registered");
Transport.send(message);
System.out.println("Done");
} catch (MessagingException e) {
throw new RuntimeException(e);
}
}
else
{
String to = "sento@ta.com";//change accordingly
String from = "sendfrom@lala.com";
String host = "localhost";//or IP address
//Get the session object
Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", host);
Session session = Session.getDefaultInstance(properties);
//compose the message
try{
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject("Ping");
message.setText("Hello, this is example of sending email ");
// Send message
Transport.send(message);
System.out.println("message sent successfully....");
}catch (MessagingException mex) {mex.printStackTrace();}
}
}
}
Beans
----------------------------
trans.java
---------------------------
package com.users.bean;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
public class trans implements Serializable{
Integer transaction_id;
Integer user_id;
public Integer getTransaction_id() {
return transaction_id;
}
public void setTransaction_id(Integer transaction_id) {
this.transaction_id = transaction_id;
}
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
}
TransactionDetails.java
-------------------------------------------------
package com.users.bean;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name="user_transaction")
public class TransactionDetails implements Serializable{
String user_id, transaction_id;
@Column(name = "user_id")
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
@Column(name = "transaction_id")
public String getTransaction_id() {
return transaction_id;
}
public void setTransaction_id(String transaction_id) {
this.transaction_id = transaction_id;
}
}
UserBean.java
--------------------------------------------------------
package com.users.bean;
import java.util.Date;
import com.ibm.icu.util.Calendar;
public class UserBean {
private Integer user_id;
private String email_id;
private String password;
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
public String getEmail_id() {
return email_id;
}
public void setEmail_id(String email_id) {
this.email_id = email_id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
transDao.java
---------------------------------------------
package com.users.dao;
import java.util.List;
import com.users.bean.TransactionDetails;
import com.users.bean.trans;
import com.users.model.Transaction;
import com.users.model.User;
import com.users.model.User;
public interface transDao {
public void addTrans(Transaction t);
}
transDaoImpl.java
-----------------------------------------------
package com.users.dao;
import java.sql.Array;
import java.util.List;
import java.util.Map;
import java.util.Iterator;
import javax.jms.Session;
import javax.management.Query;
import javax.resource.cci.ResultSet;
import org.hibernate.SQLQuery;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.users.bean.TransactionDetails;
import com.users.bean.UserBean;
import com.users.bean.trans;
import com.users.model.Transaction;
import com.users.model.User;
@Repository("tDao")
public class transDaoImpl implements transDao {
@Autowired
private SessionFactory sessionFactory;
public void addTrans(Transaction t) {
System.out.println("Inside transDaoImpl");
sessionFactory.getCurrentSession().update(t);
}
}
UserDao.java
------------------------------------------------
package com.users.dao;
import java.util.List;
import com.users.bean.TransactionDetails;
import com.users.model.User;
import com.users.model.User;
public interface UserDao {
public void addUser(User user);
public User validateUser(String uid, String password);
public List<TransactionDetails> listTransaction(String email_id);
}
UserDaoImpl.java
-----------------------------------------------------------
package com.users.dao;
import java.sql.Array;
import java.util.List;
import java.util.Map;
import java.util.Iterator;
import javax.jms.Session;
import javax.management.Query;
import javax.resource.cci.ResultSet;
import org.hibernate.SQLQuery;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.users.bean.TransactionDetails;
import com.users.bean.UserBean;
import com.users.model.User;
@Repository("uDao")
public class UserDaoImpl implements UserDao {
@Autowired
private SessionFactory sessionFactory;
int k;
public void addUser(User user) {
System.out.println("4");
sessionFactory.getCurrentSession().save(user);
}
@SuppressWarnings("finally")
public User validateUser(String email_id, String password)
{
System.out.println("cccc");
User l1 = new User();
try
{
System.out.println("cc1111");
String sql = "SELECT user_id FROM USERS WHERE email_id = :email_id and password = :password";
SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setParameter("password",password);
query.setParameter("email_id",email_id);
int u1 = (Integer) query.uniqueResult();
k = u1;
System.out.println(u1);
System.out.println("d");
}
catch(Exception e)
{
if(k==0)
{
l1.setEmail_id("null");
l1.setPassword("null");
}
}
finally
{
System.out.println(l1.getEmail_id());
return l1;
}
}
@SuppressWarnings("unchecked")
public List<TransactionDetails> listTransaction(String email_id) {
System.out.println("trans3");
String sql = "SELECT a.user_id, a.transaction_id FROM user_transaction a inner join users b on a.user_id = b.user_id AND b.email_id = :email_id";
SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setParameter("email_id",email_id);
TransactionDetails toto = new TransactionDetails();
System.out.println("hoho");
List<TransactionDetails> l = query.list();
Iterator it=l.iterator();
List<TransactionDetails> l2 = null;
while(it.hasNext())
{
Object rows[] = (Object[])it.next();
System.out.println(rows[0]+ " -- " +rows[1]);
}
return l;
}
}
Transaction.java
------------------------------------------------------
package com.users.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="user_transaction")
public class Transaction implements Serializable{
private static final long serialVersionUID = -723583058586873479L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "transaction_id")
private Integer transaction_id;
public static long getSerialversionuid() {
return serialVersionUID;
}
@Column(name = "user_id")
private Integer user_id;
public Integer getTransaction_id() {
return transaction_id;
}
public void setTransaction_id(Integer transaction_id) {
this.transaction_id = transaction_id;
}
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
}
User.java
--------------------------------------------------
package com.users.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="users")
public class User implements Serializable{
private static final long serialVersionUID = -723583058586873479L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "user_id")
private Integer user_id;
public static long getSerialversionuid() {
return serialVersionUID;
}
@Column(name = "email_id")
private String email_id;
@Column(name="password")
private String password;
public Integer getUser_id() {
return user_id;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
public String getEmail_id() {
return email_id;
}
public void setEmail_id(String email_id) {
this.email_id = email_id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
transService.java
---------------------------------------------------
package com.users.service;
import java.util.List;
import com.users.bean.TransactionDetails;
import com.users.bean.trans;
import com.users.model.Transaction;
import com.users.model.User;
public interface transService {
public void addTrans(Transaction t);
}
transServiceImpl.java
------------------------------------------------------------
package com.users.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.users.bean.TransactionDetails;
import com.users.bean.trans;
import com.users.dao.UserDao;
import com.users.dao.transDao;
import com.users.model.Transaction;
import com.users.model.User;
@Service("transService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class transServiceImpl implements transService {
@Autowired
private transDao tDao;
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void addTrans(Transaction t) {
System.out.println("At trans service add trans - before");
tDao.addTrans(t);
}
}
UserService.java
------------------------------------------------------
package com.users.service;
import java.util.List;
import com.users.bean.TransactionDetails;
import com.users.model.User;
public interface UserService {
public void addUser(User user);
public User validateUser(String uid, String password);
public List<TransactionDetails> listTransaction(String email_id);
}
UserServiceImpl.java
--------------------------------------------------------
package com.users.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.users.bean.TransactionDetails;
import com.users.dao.UserDao;
import com.users.model.User;
@Service("userService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class UserServiceImpl implements UserService {
@Autowired
private UserDao uDao;
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void addUser(User user) {
System.out.println("3");
uDao.addUser(user);
}
@Override
public User validateUser(String uid, String password) {
System.out.println("b");
return uDao.validateUser(uid, password);
}
public List<TransactionDetails> listTransaction(String email_id)
{
System.out.println("trans2");
List<TransactionDetails> l1 = uDao.listTransaction(email_id);
System.out.println("size"+l1.size());
return l1;
}
}
database.properties
--------------------------------------------------
database.driver=org.postgresql.Driver
database.url=jdbc:postgresql://localhost:5432/PMS
database.user=postgres
database.password=01988
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create
config > sdnext-servlet.xml
-------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
">
<context:property-placeholder location="classpath:resources/database.properties" />
<context:component-scan base-package="com.users" />
<mvc:annotation-driven/>
<mvc:resources mapping="/js/**" location="/js" />
<tx:annotation-driven transaction-manager="hibernateTransactionManager"/>
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="prefixJson" value="true"/>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${database.driver}" />
<property name="url" value="${database.url}" />
<property name="username" value="${database.user}" />
<property name="password" value="${database.password}" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>com.users.model.User</value>
<value>com.users.model.Transaction</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
</property>
</bean>
<bean id="hibernateTransactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"/>
</property>
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>
</list>
</property>
</bean>
</beans>
save.jsp
--------------------------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<h2>Add Employee Data</h2>
<c:if test="${!empty t1}">
<table align="left" border="1">
<tr>
<th>transaction ID</th>
<th>User ID</th>
</tr>
<c:forEach var="i" items="${t1}">
<tr>
<td><c:out value="${i.transaction_id}"/></td>
<td><c:out value="${i.user_id}"/></td>
<td align="center"><a href="edit.html?transaction_id=${i.transaction_id}">Edit</a> | <a href="delete.html?id=${i.transaction_id}">Delete</a></td>
</tr>
</c:forEach>
</table>
</c:if>
</body>
</html>
yeye.jsp
--------------------------------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<h1> in yeye </h1>
<table>
<form:form method="POST" action="save2.html" modelAttribute="t1" id = "form2">
<tr><td><form:input path="transaction_id" placeholder="Transaction ID" value="${t.transaction_id}" /></td></tr>
<tr><td><form:input path="user_id" placeholder="User ID" value="${t.user_id}" /></td></tr>
</table>
<input type="submit" value="Save"/>
</form:form>
</body>
lala.jsp
-----------------------------------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<h1> in lala </h1>
</body>
</html>
notsave.jsp
----------------------------------------------------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<h2 style="color:red">Incorrect Credentials, please try again</h2>
<form:form method="POST" action="login2.html" modelAttribute="user" id="form">
<table>
<tr><td> <form:input path="user_id" placeholder="User ID:" value="" disabled="true"/></td></tr>
<tr><td><form:input path="email_id" placeholder="Email ID:" value="" /></td></tr>
<tr> <td> <form:password path="password" placeholder="Password" value="" /> </td></tr>
</table>
<input type="submit" value="Log-in"/>
</form:form>
</body>
</html>