Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: JSP Global Objects


Message #1 by "vinodbonde" <vinodbonde@h...> on Wed, 12 Mar 2003 13:17:35
It's urgent ...
I am facing a problem here. I am trying to access the bean object through 
the function declared in the same jsp in which the bean is instantiated.
Is there any way to achieve  this.

The Jsp code is as follows
---------------------------
<%@include file="prntBean.jsp"%>
<jsp:useBean id="testbean" class="TestBean" scope="request" />
<%!
	public synchronized void addFirst(){
		for(int i=0;i<1000000000;i++);

		for(int j=0; j<1000; j++){
			testbean.iClass = testbean.iClass + 1;
		}
		System.out.println("firstmeth:"+testbean);
	}
%>

 
<%
	out.println("Below is output of a method from prnt.jsp  page<br>");
	testbean.iClass = Integer.parseInt(request.getParameter("lval")); 
	addFirst();
	out.println("iclass = "+testbean.iClass);
%>

  Return to Index