bharadwaja kambhammettu

+ Follow
since Apr 07, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bharadwaja kambhammettu

Hi everybody,

I purchased a SCJD voucher during Aug 2005 and i did`nt work on the solution till now. I now want to start actively working towards it. Can i still work on the same assignment ? Or do i need to purchase a new voucher ?

Thanx & regards,
Bharadwaja K
hi all,

Without considering the file extension, i am trying to determine the file type by reading the file contents. Is that possible ?

I`ve observed that every .pdf file has "%PDF-1.3" or "%PDF-1.4" etc as the very first chars. If i try removing them, the file `ll still be a .pdf but can not be opened by the Acrobat Reader. I think that `ll help me determine whether a file is a .pdf.

My actual trouble is in reading a ".doc" file. Is there any way, i can read the bytes from a .doc file and determine whether it is actually a .doc file ? Can we identify other MS - Office files also in this manner ?

thanks in advance.
18 years ago
hi all,

I am trying to write a JApplet, which will let me select a directory on the clients machine enabling me to upload all the files in that dir and send them to a servlet.

I tried signing the applet using the "keytool" (actually followed some article from the Sun`s site), attempted to create a Policy file and finally used the "HTMLConverter" to convert the applet.

But the Sun Java Console in Internet Explorer shows a big exception stack trace. It goes like this -- >

Exception in thread "AWT-EventQueue-11" access denied (java.util.PropertyPermission user.dir read)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at Source)
at Source)
at Source)
at<init>(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at javax.swing.plaf.metal.MetalFileChooserUI.updateUseShellFolder(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at javax.swing.JFileChooser.<init>(Unknown Source)
at FileUploadApplet.actionPerformed(
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at Source)

I actually could`nt figure out certain things right.
-- > Does the policy file created have any relevance to the Browser`s JRE ?(i`ve Java Plug-in 1.5.0_03
Using JRE version 1.5.0_03 Java HotSpot(TM) Client VM)

--> "HTMLConverter" converts the original html containing the <APPLET> into a way that the Java Plug-in for the browser understands. Is this right ?

Incidentally, the applet did`nt run even i used "appletviewer" and it showed the same exception trace.

my policy file goes like this -->

grant codebase "http://localhost:7001/FileUploadApp/~"
permission "<<ALLFILES>>","read";
permission "*","accept,connect,listen,resolve";
permission java.util.PropertyPermission "*","read";
permission java.lang.RuntimePermission "readFileDescriptor";

plz clarify my doubts. Thanks in advance.
18 years ago
hi all,

What is the difference between getContextPath() and getRealPath() in HttpServletRequest ? Can anybody throw some light on this ?
I intend to call them from the JSP implicit object, request.
18 years ago

I am in a dilemma as to which certification to pursue, either SCWCD or SCBCD.

What makes me ask such a question ???
Actually, as far as i see, there are so many projects (in many companies in India) involving Servlets & JSP`s and little EJB (Stateless Session Beans only). Incidentally, my team decided against EJB`s and choose Hibernate.
Also, many development teams are begining to switch over to some sort of a framework i.e Struts or Java Server Faces etc instead of Servlets & JSP`s alone.

So, can any one guide me as to which certification `ll help me, SCWCD or SCBCD or nothing at all !!!