Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Nehal Dave

Greenhorn
+ Follow
since Dec 22, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nehal Dave

Hi
I need to know how can we validate an import statement.
For e.g
import com.javaranch.ABC;
I need to find out if com.javaranch.ABC class is present in my classpath.
Any ideas?
Thanks
Nehal.
16 years ago
Hi I am using a java bean in JSP.
This bean calls a perticular api which tries to connect to some legacy back end system.
Sometimes the api which i call respond back after say 10 mins & its 2 long for a user to wait .
I want to find out a way where while calling this api from java bean is their any way to set time out ...
For eg..
public class A
{

public static int endless()
{
int i = 0;

while(i!=1)
{

}
return i;
}
}

public class B
{

public static void main(String args[])
{
System.out.println("Before A ");
A.endless();
System.out.println("After A ");
}
}

This above code creates a dead lock which some times happen in our system. i want to add a timer mechanism while calling A.endless() ....
Any ideas how..
Cheers
Nehal.
17 years ago
JSP
Christian & Chris
Thanks for ur replies. It really made my understanding clear. What i understood is that the scope of tranaction is limited to a method.
Correct me if i am wrong.
Cheers
Nehal.
I have a confusion about transactions with statefull session beans. If i use delarative transaction does all the methods of the bean in which ever called is a single transaction???
Am totally LOST......
this is the prob...
Context ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("nehalDS");

Connection con = ds.getConnection();
Statement stmt = con.createStatement();
stmt.execute(some query");
ResultSet rs = stmt.getResultSet();
the same code i am using in all the jsps through out the site to access the oracle database. I need to abstract it into some reuseable pattern.i found out Data Access Object pattern is the solution but how to use it... can any1 help me with some small example on which i can built up...
Thanks
Nehal.
[ December 02, 2002: Message edited by: Nehal Dave ]
I want to create ConnectionPoolDataSource and PooledConnection in console for oracle 8.1.7 so that i can use them in the same way i am using ConnectionPool & DataSource in my jsp's/servlets. Does weblogic 6.1 support ConnectionPoolDataSource and PooledConnection creation. Till i know the jdbc driver needs to support ConnectionPoolDataSource and PooledConnection & oracle thin driver does support them. so how to use it in weblogic I am lost...
17 years ago
Ruilin
yea he will have to create a button & then on click of button just call window.print() using javascript...
Nehal.
17 years ago
JSP
John
First of all i disagree your comments about consultants & lousy documentation. I am working in usa from last 3-4 years & all i have seend is that people like you or your bosses call consultants when u people cant handle the situation & then u people are so much in haste .. never give enough time to consultants to document the code. Let me tell u if u have ever studied (even heard)about Software Development Life Cycle, majority of project time goes (should be utilized) in creating specifications & documentation. I can write lots more but...
Anyways
Cheers
Nehal.
17 years ago
JSP
Sandep
Till i know one should not extend Jsp pages for following reasons :
As we all know Jsp pages r compiled in servlet classes by servlet containers. They compile the Jsp pages to their custom classes which implement HttpServlet. They use this feature to increase the performance.(Al least thats what i read somewhere.. ) So if u extend your JSP to some other custom classes it may create probs... or decrease the performance..
Personally i am confused abt this thing.. so just wanted to make u confused too...
Cheers
Nehal
17 years ago
JSP
To print an HTML page without pressing any button can be achived by javascript. The code down in here prints the page after the page is loaded.

Hope this helps u...
CHeers
Nehal. ..
[ August 27, 2002: Message edited by: Nehal Dave ]
[ August 27, 2002: Message edited by: Nehal Dave ]
17 years ago
JSP
Hi Everybody,
I am working on an application with JSP's which has images for tabs for the main menu.Here is the requirement.
Requirement:When you click on the tab which is an image the image changes & calls a jsp
>>
To change the image on click u need to use javascript. This can be done by making a link on image & then calling a javascript function onclick event. This function will just change the src of the image which u need to change. Altenatively u can preload the image which will be displayed on click so that their is no time delay for the new image to be seen. As for calling the jsp.. it will be the href of the link.
Hope this helps u ..
Cheers
Nehal.
17 years ago
JSP
SteveC U r rite.. i need to find out the class which implements the interface weblogic.management.runtime.RuntimeMBean But i wassnt able to find it.. Here is what i am looking for... I want to track the active sessions .. & the count of it. I know its simple to have a counter in DB But i want to know if weblogic provides an API for it.. As it lets us moniter sessions in console.. I tried to find it out every where but no luck ....
U guys have any idea ???
18 years ago
I need to know how many sessions are active at a perticular time in weblogic 5.1/6.x servers. I coudnt find any reference in 5.1 doc. In 6.x docs i could found out the following things..
public interface WebAppComponentRuntimeMBean which
extends weblogic.management.runtime.RuntimeMBean has a method called getOpenSessionsCurrentCount()
which returns ant int... It returns the current total number of open sessions in this component. The prob is as its an interface how do i call the method.....
18 years ago
I am trying to test MVC in visualage with a simple application.
I have servlet whichgets the request, adds a String object in session & forwards it to JSP which just displays the Session variable...
here is the code
Controller Servlet
String a= new String("TeStInG MvC .....");
HttpSession s = request.getSession();
s.setAttribute("test",a);

ServletContext sc= getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("/view.jsp");

if (rd != null)
rd.forward(request,response);
View.jsp
String a=(String)session.getAttribute("test");
out.println(a);

View.jsp is in following dir..
D:\Program Files\ibm\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\web
The error i get in console is...
javax.servlet.ServletException: non-HTTP request or response
I dont understand what is goign wrong Plz help...
Nehal.
18 years ago