java - Tomcat caters to multiple user with same memory - JSP -


i have jsp web application, when try deploy tomcat server, , try run application different machines, dont new pages every user.

my application takes input html input , keep in memory press of button, ao push values in memory , keeps untill reset pressed. problem comes when goto machine , run application, same modified page previous user.

i have used session management keep username in session. if application not creating new session every new user request.

eg:

main.jsp has input fields , when click 'add' values html input stored in memory objects, , showed in html inputs till memory not cleared.

now machine, access application , go main.jsp, there prefilled html input boxes.

why not getting new page everytime go different machine. tomcat server serves users same memory space?

sample code main.jsp

 <%@ page import="test.databaseaccessconnectionmanager" %> <%@ page import="test.functionkeywordmanager" %> <%@ page import="test.testscenariomanager" %> <%@ page import="test.dataparameter" %> <%@ page import="test.repositorymanager" %> <%@ page import="java.util.listiterator"%> <%@ page import="java.util.*"%>   <%@ page import="java.sql.resultset"%>   <%@ page import="test.testcase" %> <%@ page import="test.reportgenerator" %> <jsp:usebean id="connn" scope="session" class="test.databaseaccessconnectionmanager"></jsp:usebean> <jsp:usebean id="connn1" scope="session" class="test.functionkeywordmanager"></jsp:usebean> <jsp:usebean id="connn2" scope="session" class="test.testscenariomanager"></jsp:usebean> <%  string username=null; string projectname = null; if(session.getattribute("username")!=null) {     username = session.getattribute("username").tostring();     projectname = session.getattribute("projectname").tostring(); } else { response.sendredirect("login.jsp");  } %> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>test scenario management</title> <script src="static/js/jquery-2.1.3.min.js"></script> <script src="static/js/script.js"></script> <link rel="stylesheet" type="text/css" href="static/css/style.css"> <!-- <script> function displaymessage(strmessage) {         alert(strmessage); }; </script> --> </head> <body>  <div id="parameterpopup"> <div class="heading">enter parameter values</div> <br> <div class="content"></div> <br> <div class="buttons"> <input type="button" value="submit values" id="btnsubmitparams" /> </div> </div>   <div id="wrapper"> <div id="userinfonlogout">    <p>welcome <b><%=username %></b></p> <center><a href="logout.jsp" >logout</a></center> </div> <div id="topheader"> <div id="logo"> <img src="static/images/cs_200px.png"/> </div> <center><div id="headertext"><h1>data validation automation</h1></div>                 </center> </div> <div id="navigation"> <ul> <li><a href="dashboard.jsp">home</a></li> <li><a href="projects.jsp">projects</a></li> <li><a href="repository.jsp">repository</a></li> <li><a href="createtestscenario.jsp">create test scenario</a></li> <li><a href="existingtestscenariomanagement.jsp">maintain test     scenarios</a></li> <li><a href="config.jsp">configuration</a></li> </ul> </div>  <div id="body">  <div id="popup" style="display:none">   <div class="content">  </div>  <input type="button" class="close" value="close"/> </div> <h2> <p align="center"> create test scenario</p></h2> <%! functionkeywordmanager objfunctionkeywordmanager; list<string> listkeywords; testscenariomanager objtestscenariomanager; reportgenerator objreportgenerator=new reportgenerator(); public void jspinit(){ objfunctionkeywordmanager = new functionkeywordmanager(); listkeywords = objfunctionkeywordmanager.getallfunctionkeyword(); objtestscenariomanager = new testscenariomanager(); }   %> <% repositorymanager objrm = new repositorymanager(); list<string> listrepo = objrm.getrepositorylistforproject(projectname); %> 

p.s: newbie jsp , tomcat. in advance.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -