gshockneo 0 Newbie Poster

Hi
Actually i require that as soon as a jsp gets loaded , An Aglet is created and dispatched to remote site.
I am able to do dis directly in java..but how to do it through jsp page.
Plz help

gshockneo 0 Newbie Poster

hi friends

I am trying to implement a SAAS based sample application in my final year project. But I do not know where to start and what is needed to build it.
Kindly if anyone knows about it please help me

Thanks

gshockneo 0 Newbie Poster

Yeah i think its not possible to store multiple sessions in same browser.
We can let multiple user login but for rest of personalized pages,how we are going to differentiate.

gshockneo 0 Newbie Poster

Hi,
I am really struggling with this problem.

For ex. I have a login jsp page . After user logs in , I store their username and password in session object in next page.
Now if I want more than 1 user to abe able to login from same browser.
But problem is that As soon as user logs in from 2nd tab, It overwrites the information stored in session object for previous user.

How can i create different session on same browsers. so that different users can work simultaneously .Please help.

<html>
<body>
<form action = "next.jsp">
Name : <input type="text" name="name">
Password:<input type="text" name="password">
</form></body
</html>

next.jsp

<%
session.setAttribute("user",request.getParameter("name"));
session.setAttribute("password",request.getParameter("password"));
%>
gshockneo 0 Newbie Poster

hi
I have a simple log in form.
I want that after user logs in , he should not be able to goto login page again using back button of browser.
Does page reloads fresh when back button is clicked or it simply displays what was earlier.

login.jsp

<%
response.setHeader("Cache-Control","max-age=0");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
%>
<script type="text/javascript">
alert("hi");
</script>
<HTML>
<HEAD> 
</HEAD> 
<BODY>
my page body
<form action="validation.jsp">
<input type="submit">
</form>
</BODY>
</HTML>

If user clicks back button of browser , alert("hi") is not executed.it means it simply display the last page.

How can i prevent this.
Thanx in advance

gshockneo 0 Newbie Poster
<html>
<head>
<jsp:useBean id="track" scope="session" class="ReturnProgress"></jsp:useBean>


<script type="text/javascript">
function getProgress()
{
document.getElementById('error')='<%=track.findProgress()%>';
}
</script>
</head>
<body>

<p id = "error"> </p>
<button onclick = "getProgress()">click me</button>
</body>
</html>

Is it correct to call this function like this beacuse this function runs on server side.

gshockneo 0 Newbie Poster

Thanks for reply.
You are right. It gets called when page loads.
Then after each time you click it keeps on displaying same information i.e. it does nt call function.
So how can i make sure that this function does not get called when page loads but on button click.

gshockneo 0 Newbie Poster

hi all,

I want to call a class function using beans inside java script. but it is not working. It calls that function only 1 time.

<jsp:useBean id="track" scope="session" class="ReturnProgress"></jsp:useBean>

<script type="text/javascript">
function getProgress()
{
document.getElementById('progress').innerHTML = '<%=track.findProgress()%>';
}


</script>

I want that Whenever user clicks on button , I call getProgress function on onclick event that fetches progress using findprogress() method.
please help.

gshockneo 0 Newbie Poster

Hi everyone
Plz reply..its urgent
I am trying to track progress of a database operation . and want to dislplay percentage progress on page asynchronously.

Process.jsp - In this i used javascript to call ajax function continuously which returns precentage progress.
My Code is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp"><title>Untitled Document</title>
</head>
<jsp:useBean id="form1" scope="session" class="testing.HelloWorld"/>
<%
form1.check();
 %>
<body>

<script type="text/javascript">
var j=0;

function repeat()
{
var i=0;

while(i!=1)
{
i=getPercentage();
alert ("i = " + i);
}
}

function getPercentage()
{

var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
 	document.myForm.time.value=xmlhttp.responseText;
 	if(document.myForm.time.value=="100")
 	{
 	alert("final reached");
 	j=1;
 	}
  }
}


xmlhttp.open("GET","test.jsp",true);
xmlhttp.send(null);
alert ("j=" + j);
return j;
}
</script>

<form name="myForm">
Name: <input type="text" name="username"  />
Time: <input type="text" size=100 name="time" />
<button onclick="repeat()">Track Progress</button>
</form>

</body>
</html>

So that when user clicks on track progress button, It calls a repeat () function which continuously calls getPercentage() function and break when i=1 (Value returned by getPercentage is 1 when it is 100 %).

But it is not functioning properly.
can some one tell what is problem.

code of test.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %> …