Ashish Agarwal

Ranch Hand
+ Follow
since Dec 02, 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 Ashish Agarwal

HI!
I'm having a peculiar problem. I'm taking date as an input from a JSP and converting it into Oracle Date Format(dd-MMM-yyyy) using the following code.
I'm using this date in the where clause of a query.
Now if I run this on windows it's working perfect. It converts date into 21-Apr-2003 as required by Oracle. But if I run it on unix, the is not converting in dd-MMM-yyyy. It gives 21-04-2003. I don't understand why same code is working differently.
Can anybody help. It's very urgent.

String exceptionDate = "21/4/2003";
try{
date = DateFormat.getDateInstance( DateFormat.SHORT ).parse( exceptionDate ) ;
}catch( ParseException pe ) {
throw pe ;
}
try{
exceptionDate = new SimpleDateFormat( "dd-MMM-yyyy" ).format( date ) ;
}catch( Exception e ) {
throw e ;
}
18 years ago
Hi!
I want to know that is it possible to embed an object in XML file.
TIA
Ashish
Hi!
Please tell me what all files are needed to run a EJB in a production environment in weblogic 6.1 and how to package them.
TIA
Ashish
19 years ago
Hi friends,
I'm going to attend a very important interview mainly on ejb, within 24 hrs. Can anybody tell me where can i get questions asked in interview on ejb.
TIA
Ashish Agarwal
Hi all,
I want to let a user upload a file onto the server.I used ORClasses.zip file from Oreilly.com but it works only on JWS2.0 .I want to use any other class that is available and lets uploading the files from client to the server..I want to use it on Tomcat4.0.
Plz suggest some classes available for the operation.
ITS URGENT
tnx
19 years ago
JSP
Thanx for ur reply.
I tried that way, but still the same problem.
Let me explain u in detail what I have done.
creating jar:
I have 3 class files as following:
Square.class - Bean class which implements SessionBean. It has a method square() which returns the square of the passed integer.
SquareHome.class - Home interface
SquareRemote.class - Remote interface.
I created a temporary folder named "a". Inside this I created a folder "META-INF". I put these 3 classes inside "a". Then on command prompt I went to the folder "a" ("d:\a>"). I ran the tool
"java weblogic.ant.taskdefs.ejb20.DDInit ." to generate ejb-jar.xml and weblogic-ejb-jar.xml. Then I created the jar file by running
"jar -cvf sqjar.jar .".
creating war:
I created a temporary folder named "aa". Inside this I created a folder "WEB-INF". Inside WEB-INF I created a folder "classes". I put SquareHome.class and SquareRemote.class inside classes folder. I put the jsp file "sqr.jsp" inside "aa". Then on command prompt I went to the folder "a" ("d:\aa>"). I ran the tool
"java weblogic.ant.taskdefs.war.DDInit ." to generate web.xml and weblogic.xml. Then I created the war file by running
"jar -cvf sqwar.war .".
creating ear:
I created a temporary folder named "aaa". Inside this I created a folder "META-INF". I put the "sqjar.jar" and "sqwar.war" inside "aaa". Then on command prompt I went to the folder "a" ("d:\aaa>"). I ran the tool
"java weblogic.ant.taskdefs.ear.DDInit ." to generate application.xml. Then I created the ear file by running
"jar -cvf sqear.ear .".
sqr.jsp content:

<%@ page language="java" import="java.sql.*,java.util.*,javax.naming.*;" session="true" isThreadSafe="true" contentType="text/html" %>
<HTML>
<HEAD>
<title>Squaring a number</title>
</HEAD>
<BODY bgcolor=#ddeeff>
<%
try{
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context initial = new InitialContext(h);
Object objref = initial.lookup("SQ2");
SquareHome home =(SquareHome)PortableRemoteObject.narrow(objref,SquareHome.class);
SquareRemote s = home.create();
System.out.println("After squaring : "+s.square(Integer.parseInt(4));


}catch(Exception e){out.println("Exception ::"+e.toString());}
%>
</BODY>
</HTML>
In the lookup method I have passed the JNDI-NAME that is provided in the tag <jndi-name> in weblogic-ejb-jar.xml.
In application.xml the <context-root> tag contains the value "sqwar".
When I run the jsp by the url "http://localhost:7001/sqwar/sqr.jsp" it gives "cannot resolve symbol" for SquareHome and SquareRemote.
Please tell me what is wrong in the above deployment process. I tried the other way by not putting SquareHome.class and SquareRemote.class inside classes folder while creating the war file. Still the same problem.
Waiting for reply.
regards
Rajesh
19 years ago
I m having a JSP file which calls a method of a session bean. How do I create the .ear file. Please give the detail procedure from the scratch. I tried this according to the doc. But still I m not able to deploy it. Any help is most welcome. Waiting for reply.
regards
Rajesh
19 years ago
This might be a typical question....<br>
I want to connect to an database using applet, the code is ready using an OracleType 4 Driver.<br>The problem that I am facing is that the <b>.jar</b> file that we are supposed to send to the client thru the ARCHIVE attribute needs to contain some certificate a manifest file etc....<p>
I want to know the steps by which I can create that jar file & successfully run the applet..I have downloaded a document that specifies <i>how to sign using the <b>javakey</b></i> but the problem is that <i>javakey</i> doesnt seem to run on my machine..and so was advised to use <i>keytool</i> instead of javakey.. to generate the certificates ...<p>
I am using windows NT 4.0 & jdk1.3.Java plugin is installed on my machine.
<br>
<i>plz help URGENTLY</i>
thanx
19 years ago
Dear friends,
Thanks for your replies,I have written some code where I'm disabling right mouse click and hiding the MenuBar altogether. I know there are ways to get around it but for novice users it will work. My problem now is that this is working for Netscape6.0 but not for IE5.5. For IE5.5 it show error that window.menubar is not an object. Can anybody help on this.
I have changed onClick to oClick in my code as Javaranch does not allow onClick to be posted. Plese make it onClick when u copy and paste the code.
--------------------------------------------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<script language="JavaScript">
window.menubar.visible=false;

function disableMenu(){
window.menubar.visible=false;

}
function enableMenu(){
window.menubar.visible=true;

}

</script>
</head>
<body bgcolor="#FFFFFF">
<script language="JavaScript">
document.oncontextmenu = function(){return false}
if(document.layers) {
window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = function(e){
if(e.target==document)return false;
}
}
else {
document.onmousedown = function(){return false}
}
</script>
<form name=frm>
<input type=button name=btn value="Hide menubar" oclick='disableMenu()'/>
<input type=button name=btn value="Show menubar" oclick='enableMenu()'/>
</form>
</body>
</html>
--------------------------------------------------
Thanks
Ashish
I want to disable right click, Save as and view source in Netscape 6 and IE 5.5. Can anybody tell me how to do it.
TIA
Ashish Agarwal
I have developed an application in swings with lot of components and Text on Windows NT platform. That application has to run on various platforms including Linux.
Though the Swing components are rendering well on both platforms but the problem is with Fonts. Fonts gets change on both platforms and due to it they are not showing in Buttons etc as they should be.
How to make fonts platform independent. I'm not able to solve this problem for a long time. Please help.
TIA
Ashish Agarwal
19 years ago
I want to Right Align Text in JTextArea. Can anybody tell how to do it.
TIA
Ashish
19 years ago
How to set Right Alignment in JTextArea
19 years ago
Dear friends,
I'm appearing for SCJP on 16th.
Can anybody tell me where can I find mock exams which have GUI similar to actual SCJP GUI so that I can accustom myself to it.
Thanx.
Ashish
Happy New Year to all JavaRanch members and all the best for the future.
Ashish Agarwal