Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. Login Page JSP:
  2.  
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ page session="false"%>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8.  
  9. <link href="<c:url value="/resources/css/bootstrap.min.css" />"
  10. rel="stylesheet">
  11. <link href="<c:url value="/resources/css/Integration.css" />"
  12. rel="stylesheet">
  13. <link href="<c:url value="/resources/css/bootstrap-theme.min.css" />"
  14. rel="stylesheet">
  15.  
  16.  
  17. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  18. <title>Login</title>
  19.  
  20. </head>
  21.  
  22. <body id="body">
  23.  
  24. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  25. <script
  26. src="<c:url value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />"></script>
  27. <script src="<c:url value="/resources/js/bootstrap.min.js"/>"></script>
  28. <script src="<c:url value="/resources/js/home.js"/>"></script>
  29.  
  30.  
  31.  
  32. <script type="text/javascript">
  33. $(document).ready(function() {
  34. $("#login").click(function() {
  35. var userName = document.getElementById("userName").value;
  36. var password = document.getElementById("password").value;
  37. $.get("home",{
  38. userName : userName,
  39. password : password
  40. }, function(data) {
  41. document.getElementById("body").innerHTML = data;
  42. },"html");
  43. });
  44. });
  45. </script>
  46.  
  47.  
  48. <div class="container" id = "container">
  49.  
  50. <div class="row" style="margin-top: 20px">
  51. <div
  52. class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
  53. <form role="form">
  54. <fieldset>
  55. <h2>
  56. <span class="glyphicon glyphicon-align-left glyphicon-log-in"
  57. aria-hidden="true"> Integration Login</span>
  58. </h2>
  59.  
  60. <hr class="colorgraph">
  61. <div class="form-group">
  62. <input type="text" name="userName" id="userName"
  63. class="form-control input-lg" placeholder="User Name">
  64. </div>
  65. <div class="form-group">
  66. <input type="password" name="password" id="password"
  67. class="form-control input-lg" placeholder="Password">
  68. </div>
  69. <hr class="colorgraph">
  70. <div class="row">
  71. <div class="col-xs-3 col-sm-3 col-md-3">
  72. <input type="button" class="btn btn-lg btn-success btn-block"
  73. id="login" value="Sign In">
  74. </div>
  75. <div class="col-xs-6 col-sm-6 col-md-6">
  76. <a href="" class="btn btn-lg btn-primary btn-block">Register</a>
  77. </div>
  78. </div>
  79. </fieldset>
  80. </form>
  81. </div>
  82. </div>
  83. </div>
  84.  
  85.  
  86. </body>
  87. </html>
  88.  
  89. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  90. <%@ page session="false" %>
  91. <!DOCTYPE html>
  92. <html>
  93. <head>
  94. <meta charset="ISO-8859-1">
  95.  
  96. <link href="<c:url value="/resources/css/bootstrap.min.css" />" rel="stylesheet">
  97. <link href="<c:url value="/resources/css/Integration.css" />" rel="stylesheet">
  98. <link href="<c:url value="/resources/css/bootstrap-theme.min.css" />" rel="stylesheet">
  99. <title>Integration Wiki</title>
  100. </head>
  101. <body>
  102.  
  103. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  104. <script src="<c:url value="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />"></script>
  105. <script src="<c:url value="/resources/js/bootstrap.min.js"/>"></script>
  106.  
  107. <script type="text/javascript" id="getTeam">
  108.  
  109.  
  110. function getTeamList(id){
  111. alert("inside team fuction");
  112. $.ajax({url:"team",
  113. data:{'teamName':id},
  114. contentType: "application/json; charset=utf-8",
  115. dataType: "json",
  116. success: function(result){
  117.  
  118. }});
  119. //alert(result);
  120. }
  121.  
  122. </script>
  123.  
  124. <nav class="navbar navbar-inverse navbar-fixed-top">
  125. <div class="container">
  126. <div class="navbar-header">
  127. <button type="button" class="navbar-toggle collapsed"
  128. data-toggle="collapse" data-target="#navbar" aria-expanded="false"
  129. aria-controls="navbar">
  130. <span class="sr-only">Toggle navigation</span> <span
  131. class="icon-bar"></span> <span class="icon-bar"></span> <span
  132. class="icon-bar"></span>
  133. </button>
  134. <a class="navbar-brand" href="# ">Integration Inventory</a>
  135. </div>
  136. <div id="navbar" class="navbar-collapse collapse">
  137. <ul id= "tabNames" class="nav navbar-nav">
  138. <li class="dropdown"><a href="<c:url value="#"/>" class="dropdown-toggle"
  139. data-toggle="dropdown" role="button" aria-haspopup="true"
  140. aria-expanded="false">Teams <span
  141. class="caret"></span></a>
  142. <ul class="dropdown-menu">
  143. <li class="appserver" id="webapp" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">WebApp</a></li>
  144. <li class="mq" id="mq" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">MQ</a></li>
  145. <li class="informatica" id="informatica" onclick="getTeamList(this.id)"><a href="<c:url value="#"/>">Informatica</a></li>
  146. </ul></li>
  147. <li class="dropdown"><a href="#" class="dropdown-toggle"
  148. data-toggle="dropdown" role="button" aria-haspopup="true"
  149. aria-expanded="false">WebServer Technologies <span
  150. class="caret"></span></a>
  151. <ul class="dropdown-menu">
  152. <li class="jboss"><a href="jboss.jsp">JBOSS</a></li>
  153. <li class="weblogic"><a href="weblogic.jsp">WebLogic</a></li>
  154. <li class="webspjere"><a href="websphere.jsp">WebSphere</a></li>
  155. </ul></li>
  156. <li class="dropdown"><a href="#" class="dropdown-toggle"
  157. data-toggle="dropdown" role="button" aria-haspopup="true"
  158. aria-expanded="false">AppServer Technologies <span
  159. class="caret"></span></a>
  160. <ul class="dropdown-menu">
  161. <li id="apache"><a href="#">Apache</a></li>
  162. </ul></li>
  163. </ul>
  164. </div>
  165. <!--/.nav-collapse -->
  166. </div>
  167. </nav>
  168. <div class="content">
  169. Welcome to Integration Wiki!!!! Pleae select your Team
  170. </div>
  171. </body>
  172. </html>
  173.  
  174. package com.bestbuy.tcs;
  175.  
  176. import java.text.DateFormat;
  177. import java.util.Date;
  178. import java.util.List;
  179. import java.util.Locale;
  180.  
  181. import org.slf4j.Logger;
  182. import org.slf4j.LoggerFactory;
  183. import org.springframework.beans.factory.annotation.Autowired;
  184. import org.springframework.stereotype.Controller;
  185. import org.springframework.ui.Model;
  186. import org.springframework.web.bind.annotation.RequestMapping;
  187. import org.springframework.web.bind.annotation.RequestMethod;
  188. import org.springframework.web.bind.annotation.ResponseBody;
  189.  
  190. import com.bestbuy.tcs.Service.TeamService;
  191. import com.fasterxml.jackson.annotation.JsonView;
  192.  
  193.  
  194.  
  195. /**
  196. * Handles requests for the application home page.
  197. */
  198. @Controller
  199. public class HomeController {
  200.  
  201. private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
  202.  
  203. /**
  204. * Simply selects the home view to render by returning its name.
  205. */
  206.  
  207. @Autowired
  208. TeamService teamService;
  209.  
  210. @RequestMapping(value = "/", method = RequestMethod.GET)
  211. public String index(Locale locale, Model model) {
  212. return "login";
  213. }
  214.  
  215. @RequestMapping(value = "/home", method = RequestMethod.GET)
  216. public String login(String userName, String password) {
  217. System.out.println("inside home controler");
  218. System.out.println(userName +" "+ password );
  219. return "home";
  220. }
  221.  
  222.  
  223. @RequestMapping(value="/team", method = RequestMethod.GET, produces = "application/json")
  224. @ResponseBody
  225. @JsonView
  226. public List<List<List<String>>> getTeamList(String teamName){
  227.  
  228. System.out.println("inside team controller");
  229. return teamService.getTeamList(teamName);
  230.  
  231. }
  232.  
  233. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement