Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Login Page JSP:
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ page session="false"%>
- <!DOCTYPE html>
- <html>
- <head>
- <link href="<c:url value="/resources/css/bootstrap.min.css" />"
- rel="stylesheet">
- <link href="<c:url value="/resources/css/Integration.css" />"
- rel="stylesheet">
- <link href="<c:url value="/resources/css/bootstrap-theme.min.css" />"
- rel="stylesheet">
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Login</title>
- </head>
- <body id="body">
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
- <script
- src="<c:url value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />"></script>
- <script src="<c:url value="/resources/js/bootstrap.min.js"/>"></script>
- <script src="<c:url value="/resources/js/home.js"/>"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $("#login").click(function() {
- var userName = document.getElementById("userName").value;
- var password = document.getElementById("password").value;
- $.get("home",{
- userName : userName,
- password : password
- }, function(data) {
- document.getElementById("body").innerHTML = data;
- },"html");
- });
- });
- </script>
- <div class="container" id = "container">
- <div class="row" style="margin-top: 20px">
- <div
- class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
- <form role="form">
- <fieldset>
- <h2>
- <span class="glyphicon glyphicon-align-left glyphicon-log-in"
- aria-hidden="true"> Integration Login</span>
- </h2>
- <hr class="colorgraph">
- <div class="form-group">
- <input type="text" name="userName" id="userName"
- class="form-control input-lg" placeholder="User Name">
- </div>
- <div class="form-group">
- <input type="password" name="password" id="password"
- class="form-control input-lg" placeholder="Password">
- </div>
- <hr class="colorgraph">
- <div class="row">
- <div class="col-xs-3 col-sm-3 col-md-3">
- <input type="button" class="btn btn-lg btn-success btn-block"
- id="login" value="Sign In">
- </div>
- <div class="col-xs-6 col-sm-6 col-md-6">
- <a href="" class="btn btn-lg btn-primary btn-block">Register</a>
- </div>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- </div>
- </body>
- </html>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@ page session="false" %>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="ISO-8859-1">
- <link href="<c:url value="/resources/css/bootstrap.min.css" />" rel="stylesheet">
- <link href="<c:url value="/resources/css/Integration.css" />" rel="stylesheet">
- <link href="<c:url value="/resources/css/bootstrap-theme.min.css" />" rel="stylesheet">
- <title>Integration Wiki</title>
- </head>
- <body>
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
- <script src="<c:url value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />"></script>
- <script src="<c:url value="/resources/js/bootstrap.min.js"/>"></script>
- <script type="text/javascript" id="getTeam">
- function getTeamList(id){
- alert("inside team fuction");
- $.ajax({url:"team",
- data:{'teamName':id},
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function(result){
- }});
- //alert(result);
- }
- </script>
- <nav class="navbar navbar-inverse navbar-fixed-top">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed"
- data-toggle="collapse" data-target="#navbar" aria-expanded="false"
- aria-controls="navbar">
- <span class="sr-only">Toggle navigation</span> <span
- class="icon-bar"></span> <span class="icon-bar"></span> <span
- class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="# ">Integration Inventory</a>
- </div>
- <div id="navbar" class="navbar-collapse collapse">
- <ul id= "tabNames" class="nav navbar-nav">
- <li class="dropdown"><a href="<c:url value="#"/>" class="dropdown-toggle"
- data-toggle="dropdown" role="button" aria-haspopup="true"
- aria-expanded="false">Teams <span
- class="caret"></span></a>
- <ul class="dropdown-menu">
- <li class="appserver" id="webapp" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">WebApp</a></li>
- <li class="mq" id="mq" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">MQ</a></li>
- <li class="informatica" id="informatica" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">Informatica</a></li>
- </ul></li>
- <li class="dropdown"><a href="#" class="dropdown-toggle"
- data-toggle="dropdown" role="button" aria-haspopup="true"
- aria-expanded="false">WebServer Technologies <span
- class="caret"></span></a>
- <ul class="dropdown-menu">
- <li class="jboss"><a href="jboss.jsp">JBOSS</a></li>
- <li class="weblogic"><a href="weblogic.jsp">WebLogic</a></li>
- <li class="webspjere"><a href="websphere.jsp">WebSphere</a></li>
- </ul></li>
- <li class="dropdown"><a href="#" class="dropdown-toggle"
- data-toggle="dropdown" role="button" aria-haspopup="true"
- aria-expanded="false">AppServer Technologies <span
- class="caret"></span></a>
- <ul class="dropdown-menu">
- <li id="apache"><a href="#">Apache</a></li>
- </ul></li>
- </ul>
- </div>
- <!--/.nav-collapse -->
- </div>
- </nav>
- <div class="content">
- Welcome to Integration Wiki!!!! Pleae select your Team
- </div>
- </body>
- </html>
- package com.bestbuy.tcs;
- import java.text.DateFormat;
- import java.util.Date;
- import java.util.List;
- import java.util.Locale;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.ResponseBody;
- import com.bestbuy.tcs.Service.TeamService;
- import com.fasterxml.jackson.annotation.JsonView;
- /**
- * Handles requests for the application home page.
- */
- @Controller
- public class HomeController {
- private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
- /**
- * Simply selects the home view to render by returning its name.
- */
- @Autowired
- TeamService teamService;
- @RequestMapping(value = "/", method = RequestMethod.GET)
- public String index(Locale locale, Model model) {
- return "login";
- }
- @RequestMapping(value = "/home", method = RequestMethod.GET)
- public String login(String userName, String password) {
- System.out.println("inside home controler");
- System.out.println(userName +" "+ password );
- return "home";
- }
- @RequestMapping(value="/team", method = RequestMethod.GET, produces = "application/json")
- @ResponseBody
- @JsonView
- public List<List<List<String>>> getTeamList(String teamName){
- System.out.println("inside team controller");
- return teamService.getTeamList(teamName);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement