Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Mallesham Karnati

Ranch Hand
+ Follow
since May 11, 2005
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 Mallesham Karnati

Kiran,
Try this. It will serve your purpose.

import java.util.*;
class ShuffleTest
{

public static void main(String[] args)
{
ArrayList<Integer> list = new ArrayList<Integer>();

for(int x = 1; x < 101; x++)
{
list.add(Integer.valueOf(x)); //Adds 100 numbers to the list
}
Collections.shuffle(list); //This shuffles the list

for(int x = 0, y = 11; x < y; x++)
{
System.out.println(list.get(x)); //This gets the first 10 from the list
}
}


}
11 years ago
Deepak,
Did you try using DVD from IMB? Your system config seems to be good enough and you should have no problems, unless there is problem with the downloaded image.
Regards,
Mallesham
12 years ago
Thank you all for your timely replies. The problem, according to my ISP support team, is due to a .jar file which is present in my WEB-INF folder. I don't know why that .jar file is causing the problem, but now my problem is solved.
Thanks,
Mallesham
12 years ago
JSP
Hi,
I am trying to run a very simple .jsp file on my ISP's site, which is using Resin.
Here is the source code of my test.jsp file:

<html>
<head>
<title>This is a test jsp page</title>
</head>
<body>
<h1> This is my first example of JSP Page</h1>
<h2>The time is now
<%= new java.util.Date()%> </h2>
</body>
</html>

This worked fine until recently. But for the last few days I am getting the following error:

500 Servlet Exception

java.lang.NoClassDefFoundError: org/apache/commons/validator/ValidatorResources
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1647)
at java.lang.Class.getDeclaredMethods(Class.java:1131)
at java.beans.Introspector$1.run(Introspector.java:1126)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1124)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:989)
at java.beans.Introspector.getBeanInfo(Introspector.java:370)
at java.beans.Introspector.getBeanInfo(Introspector.java:144)
at com.caucho.jsp.Taglib.fillTag(Taglib.java:497)
at com.caucho.jsp.Taglib.fillTagLibraryInfo(Taglib.java:445)
at com.caucho.jsp.Taglib.<init>(Taglib.java:188)
at com.caucho.jsp.Taglib.parseTld(Taglib.java:346)
at com.caucho.jsp.Taglib.loadJarTlds(Taglib.java:298)
at com.caucho.jsp.Taglib.loadAllTlds(Taglib.java:221)
at com.caucho.jsp.JspManager.getTldMap(JspManager.java:180)
at com.caucho.jsp.JspManager.createPage(JspManager.java:170)
at com.caucho.jsp.PageManager.getPage(PageManager.java:351)
at com.caucho.jsp.PageManager.getPage(PageManager.java:206)
at com.caucho.jsp.QServlet.getPage(QServlet.java:220)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:129)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:534)

Does this mean that there is some settings problem on my service providers site? Or am I missing any thing obvious? When I contacted the help desk, they advised me to compile this .jsp file on my local machine and move the .class file to the web and try. But I never had to do this kind of thing and I don't know why I am getting this error message.
Please click on this link to see the error:
http://www.itekhelpdesk.com/test.jsp

Please help me in diagnosing this problem.
Regards,
Mallesham

[ August 11, 2005: Message edited by: Mallesham Karnati ]
[ August 12, 2005: Message edited by: Bear Bibeault ]
12 years ago
JSP
Hello Adeel,
I have a question about JSF and after seeing your post, I thought you can help me.

1. How easy or difficult it is to send email from a JSF page?
2. Do I need to add JavaMail APIs to do this? or Is there any built-in method available in JSF to accomplish this? (I read somewhere that by using .NET you can accomplish this by just writing 3 or 4 lines of code)
3. Is there any examples or links on the net (that you know of) which describe this feature?
Regards,
Mallesham
12 years ago
JSF
Hi,
I have a small sample AddContactDetails.jsp page where the website visitors add their contact details. As a site admin, I want to be emailed whenever a new user adds his contact details. How to accomplish this?
1. My ISP provides MySql databse and Resin engine (J2EE 1.3.x). What mail APIs do I need to add to my WEB-INF folder?
2. What is the syntax (or psuedo-code) for sending email portion of this page?
3. What else do I need to add to my site to accomplish this?
Regards,
Mallesham
12 years ago
Mahesh,
Your analytical summarization is excellent! Thanks a lot.
I have just a small suggestion. Can you modify the code slightly and make Book-Author association as 1..* (One or More) since it will make more realistic? (Because, it is realistic to assume that a book has 1 or more authors).

Great Job!
Regards,
Mallesham
[ June 27, 2005: Message edited by: Mallesham Karnati ]
Thanks Jeane for your succinct summary.
Regards,
Mallesham
JVM is a platform-independent execution environment that converts Java bytecode into machine language and executes it. It playes a central role in making Java portable. It is called 'virtual' because it is implemented in software on top of a "real" hardware platform and operating system. It loads class files, verifies the bytecodes and also provides some security services. You can read the following link for more info:

http://java.sun.com/docs/books/vmspec/
12 years ago
Thanks Jeanne for your quick response. Could you please elaborate on 'transparent persistance' and tell me what is meant by 'more abstracted' in the context of databases?
Regards,
Mallesham
Hi,
I searched google for a good definition of call-level interface in vain. Could somemone explain me what is meant by 'call-level interface' and why it is called so? What does 'call-level interface' contrasts with? (I mean what is the other way of interface in contrast with 'call-level interface'?)
Regards,
Mallesham
How could you register when people say that the registration is closed? From which country did you register and on what date exactly?
[ June 15, 2005: Message edited by: Mallesham Karnati ]
"A callback method is a method intended to be passed as a parameter. The callee can then call the passed method asynchronously and with whatever parameters it deems appropriate. Callbacks are often used in event handling code."
(Source: About.com)

Also take a look at this link:
http://www.javaworld.com/javaworld/javatips/jw-javatip10.html
[ June 14, 2005: Message edited by: Mallesham Karnati ]
12 years ago
Could someone illustrate the significance of 'association navigation' with some working examples?