Saturday, July 11, 2020
Thursday, May 28, 2020
Get Realtime Date and Time
During the development of my project, I wanted to get the RealTime date and time to user.
Code is as under:
var myVar=setInterval(function () {showTime()}, 1000);
var counter = 0;
function showTime() {
var date = new Date();
document.getElementById("time").innerHTML = date;
span id="time"
Time is most powerful thing.
Regards
Deepak Pandey
Creation of System Parameter/Variables
Sunday, May 24, 2020
Micro Level User Role Management
In application, it has been taken care that clients are able to manage access of application to user level. We are maintaining view at 2 levels
> User Group Level : It has permission for application access and assigned to user.
> Application Access at User Level: Access level can be modified at user level.
With regards
Deepak Pandey
(Bug Tracking System, Office Automation, Project Management System, Task Activity, Graphs)
Monday, May 18, 2020
User Registration
Sunday, May 17, 2020
Bug Tracking System
Friends, I am introducing Web Application with below mentioned Key feature:
1- Project Management System
2- N Level Maintenance for Location, Role, Module and Task
3- User Wise Application Control
4- Tracking of Bugs
5- Tracking of Task Status
6- Interactive Graphs
......Continued
Further, I will host it soon and help you to manage your project in a minute.
With Regards
Deepak Pandey
Sunday, April 26, 2020
Read value from properties file
To get the value of database connection or fetch labels for JSP, it is better to use properties file. So that if you change at one place, it will be reflected to all places.
Code to read properties file and return value
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ReadLabelProperties {
public static String getProperties(String key) throws IOException
{
InputStream inputStream=ReadLabelProperties.class.getClassLoader().getResourceAsStream("label.properties");
Properties myproperties = new Properties();
myproperties.load(inputStream);
return myproperties.getProperty(key);
}
}
label.properties are having entries like below
dbserver=jdbc:mysql://localhost:3306/
dbdriver=com.mysql.jdbc.Driver
Hope the same is useful while creating web application
Deepak
Monday, April 13, 2020
Web Application
After a long time, I got chance to design a web application:
Dynamic web application, using JSP and Servlet
-Download Java (JDK and JRE) and install
-Download Eclipse IDE and install
-Download Tomcat and install
-Download MySql and install
- File - Download - Dynamic Web Project
Give Project Name-(Next)-src-(Next)-Click on web.xml (deployment descriptor)
web.xml: (file would be like this
WebApp1
login.jsp
Login
LoginServlet
LoginServlet
/login/*
- login.jsp
-loginBean.jsp
Class:
1- LoginBean
public class LoginBean {
String userName="";
String password="";
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}2- LoginServlet
import javax.servlet.annotation.WebServlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.sql.*;
import java.sql.*;
/**
* Servlet implementation class Login
*/
@WebServlet("/Login")
public class Login extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Login() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Server at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
//doGet(request, response);
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String username=request.getParameter("username").toString();
String userpass=request.getParameter("password").toString();
HttpSession session = request.getSession(true);
if(username.equalsIgnoreCase(userpass))
{
response.sendRedirect("welcome.jsp");
}
else
{
response.sendRedirect("login.jsp");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
- Select Project-Run on Server
Subscribe to:
Posts (Atom)