pankaj kapoor

Greenhorn
+ Follow
since Sep 22, 2005
Merit badge: grant badges
For More
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 pankaj kapoor

I am a beginner in Java .
I am trying to run a simple java program but I am getting
"Exception in thread "main" java.lang.NoClassDefFoundError:" error when I run the program .
I suppose I am not able to set the (classpath/environment variables)
in my system.
could anyone help me for this. Thanks in advance

Pankaj
17 years ago
In what situation do we use reflection? is it a good practice to use reflection or should it be avoided? what are the advantages/disadvantages to use reflection?
18 years ago
If you willl manipulate String 10 times ten new Strings will be created, while if you do the same with StringBuffer, it will remain 1 String only
could anyone provide the links for K&B . I am preparing for SCJP
In many postings I have seen 'Please refer to K&B' . I wanted to know what is this K&B

Thaanks in advance
Pankaj
could anyone tell me the difference between

this.getClass().getClassLoader().getResourceAsStream(filename );
and
this.getClass().getResourceAsStream(filename);


Thanks in advance
Pankaj
18 years ago
To store value using javascript you have to use

var v = document.form1.view.value;
not
String val = document.form1.view.value;
I tried this code
<%@ page import="java.util.*" %><%@ page isELIgnored="false" %><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%List ll = new ArrayList();ll.add("India");ll.add("Pakistan"); request.setAttribute( "ll" , ll ) ;%><c ut value="${fn:length(ll)}"

but it does not work. I suppose there is some problem with the JSP version I am using.(JSP 1.2) but even 1.2 version supports this.
18 years ago
JSP
I am trying to print the size of list with the following code in jsp
<%
List ll = new ArrayList();
ll.add("India");
ll.add("Pakistan");
%>
<c ut value="${fn:length(ll)}" />
but I am not able to do so.

The tablib I have included in jsp is
<%@ taglib uri='http://java.sun.com/jstl/functions' prefix='fn' %>
but error 'broken link' comes

I have included standard.jar in classpath

could anyone suggest to me what is the solution to this problem.

Thanks in advance
18 years ago
JSP
String s = new String("abc");
String b = new String("abc");
if(s==b )
System.out.println("equal");

String s1 = "abc";
String b1 = "abc";
if(s1==b1 )
System.out.println("equal String");

In the above code s1==b1 prints "equal String"
while s==b does not print "equal"

could anyone explain to me the reason for this .
Thanks in advance
18 years ago
I am still not clear with your comment

'I think after forward you are pretty much done with request/response and can't use it anymore to change content received by a browser. In case of include you can.
'
could you elaborate on it.
18 years ago
what I have understood is that both of the methods direct to the JSP file mentioned in the method argument. ie include or forward.
18 years ago
could anyone tell me the difference between
req.getRequestDispatcher("try.jsp" ).forward(req ,resp)
and
req.getRequestDispatcher("try.jsp" ).include(req ,resp);

Thanks in advance
18 years ago
Can anybody tell me the difference between request.getParameter() and request.getAttribute().

Thanks in advance
18 years ago