Pradeep Kanwar

Ranch Hand
+ Follow
since Jun 11, 2001
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 Pradeep Kanwar

Friends,
I tried a lot on tomcat but no success and left it. Now on J2EE server .. still no success.
I want to try a simple jsp with a java bean. here is the code for both
JSP/// TestJSP.jsp
<jsp:useBean id="name" class="JavaBean" />
<html>
<body>
<%= name.getName() %>
</body>
</html>
JavaBean// JavaBean.java
public class JavaBean
{
private String myName;
public JavaBean()
{
myName = "Pradeep Kanwar";
}
public String getName()
{
return myName;
}
public void setName(String name)
{
myName = name;
}
}
I've put JSP in j2sdkee1.3\public_html file and put bean in j2sdkee1.3\lib\classes
When i access it with http://localhost:8000/TestJSP.jsp, i get the following error:

org.apache.jasper.JasperException: Unable to compile class for JSPc:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:57: Class org.apache.jsp.JavaBean not found.
JavaBean name = null;
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:60: Class org.apache.jsp.JavaBean not found.
name= (JavaBean)
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:65: Class org.apache.jsp.JavaBean not found.
name = (JavaBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JavaBean");
^
Friends, plz let me know where i am wrong.
Thanks a ton in advance
pradi
Friends,
I left tomcat and now have installaed j2ee server.
I want to try a simple jsp with a java bean. here is the code for both
JSP/// TestJSP.jsp
<jsp:useBean id="name" class="JavaBean" />
<html>
<body>
<%= name.getName() %>
</body>
</html>
JavaBean// JavaBean.java
public class JavaBean
{
private String myName;
public JavaBean()
{
myName = "Pradeep Kanwar";
}
public String getName()
{
return myName;
}
public void setName(String name)
{
myName = name;
}
}
I've put JSP in j2sdkee1.3\public_html file and put bean in j2sdkee1.3\lib\classes
When i access it with http://localhost:8000/TestJSP.jsp, i get the following error:

org.apache.jasper.JasperException: Unable to compile class for JSPc:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:57: Class org.apache.jsp.JavaBean not found.
JavaBean name = null;
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:60: Class org.apache.jsp.JavaBean not found.
name= (JavaBean)
^
c:\j2sdkee1.3\repository\aravali\web\_0002fTestJSP_jsp.java:65: Class org.apache.jsp.JavaBean not found.
name = (JavaBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "JavaBean");
^
Friends, plz let me know where i am wrong.
Thanks a ton in advance
pradi
hi,
i have set the classpath as well..
still not able to test any jsp.. getting the same old error on running tomcat :
A nonfatal internal JIT (3.00.078(x)) error 'Relocation error: NULL relocation target' has occurred in :
'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method.
Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
Just to tell again i've win2000 OS.
plz help
regards
pradi
Hi,
As i told im able to run tomcat. I am stuck again.
Java webserver used to be soooo simple.
I want to run a simple JSP and servlet. I made the jsp file and put it in \webapps\mydev directory (mydev dir created by me). Now to execute it i typed http://localhost:8080/mydev/Test.jsp (my jsp file).
Do i need to make any change in server.xml. i tried adding context but it didnt work.
Similarly for server, what do i need to do?
It would be great if someone could plz tell me the simple steps for executing jsp and servlet along with java beans on tomcat.
Thanks a lot in advance
pradi
Friends,
Thanks for taking so much pain in helping me out.
I realized one of the mistakes in my configuration. The catalina_home should not be till bin directory, but till the parent directory of bin.
Also i have read that, on win2000, long names like program files give problems. Thus i have changed the path to c:\tomcat (which is not the catalina_home).
It has worked but i am getting an error
A nonfatal internal JIT (3.00.078(x)) error 'Relocation error: NULL relocation target' has occurred in :
'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method.
Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cg
I am not able to understand it. Is there any problem with my JDK?
Thanks once again for the help.
pradi
Carl,
Thanks for your prompt response.
On typing in DOS, it exits (DOS window gets disappeared)
Plz help
pradi
Friends,
I have installed the tomcat on my m/c (Win2000) and set the following variables:
JAVA_HOME= c:\jdk1.2
CATALINA_HOME=c:\progra~1\apache~1.0\bin
CLASSPATH= c:\progra~1\apache~1.0\lib
Now when i try to run the tomcat by double clicking startup.bat file (after going to the bin directory), nothing happens. Only momentary dos window.
I am not able to move ahead. Plz help me.
Also i have javawebserver2.0 installed.
Thanks
pradi
Great score jacob. Thanks for your valuable feedback.
best of luck for your carrier
pradi
Great Rajat,
What do you suggest for the last day, before the final day?
Thanks
pradi
I got the solution but its crude one. Would be great to find alternatives.
This is from one of the java tips and tricks site http://privat.schlund.de/b/bossung/prog/java/tips.html
Problem: Initially giving the focus to a specified component in the dialog.
Version: Swing 1.x
Suggested Solution: Swing will initially give the focus to the first component you add to the dialog. Thus you can just add the desired component first. If that does not work for you it seems you have to go through major pain.
There is of course a method in each component that requests the focus (therefore called requestFocus()) which works fine. However, if you call it during your initializing operations, Swing will late give the focus back to the first component you added. The only way around this, which I found working more than one system, is to write a class that will focus a component about 0.5 seconds after it is initialized:
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
public class FocusSetter implements ActionListener {
private JComponent component;
private javax.swing.Timer timer;
public FocusSetter(JComponent comp) {
this.component = comp;
this.timer = new javax.swing.Timer(500, this);
this.timer.start();
}
public void actionPerformed(ActionEvent evt) {
if ((evt != null) && (evt.getSource() == timer)) {
component.requestFocus();
}
}
}

22 years ago
Thanks but it still doesn't work.
Here is the code: i want the focus to be on the second text field (fibTextField2)

Thanks in advance!
regards
pradi
(edited by Cindy to format code)
[This message has been edited by Cindy Glass (edited September 12, 2001).]
22 years ago
hi,
i have 2 text field in a panel in a frame.
i want the focus (i should be able to type through key-board without getting focus thorugh mouse) to be on second (added later) textfield.
how can i do this? i have used requestFocus() method on textField, but it doesnt work.
plz help
thanks in advance.
pradi
22 years ago
hi,
i have 2 text field in a panel in a frame.
i want the focus (i should be able to type) to be on second (added later) textfield.
how can i do this? i have used requestFocus() method on textField, but it doesnt work.
plz help
thanks in advance.
pradi
22 years ago
hi,
i have 2 text field in a panel in a frame.
i want the focus (i should be able to type) to be on second (added later) textfield.
how can i do this? i have used requestFocus() method on textField, but it doesnt work.
plz help
thanks in advance.
pradi
22 years ago