Sitemap

Amicuk Programming Answers

Prolem with usage of Document in jsp

-0001-11-30   Views:0

Advertisement

Hi Ppl, Following is a part of my code in jsp.. <% try{ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); String filename = "D:\\integral\\1.0\\Resources\\ApacheTomcat4.0\\webapps\\examples\\jsp\\cal\\input1.xml"; Documen

Hi Ppl,
Following is a part of my code in jsp..
<%
try{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
String filename = "D:\\integral\\1.0\\Resources\\ApacheTomcat4.0\\webapps\\examples\\jsp\\cal\\input1.xml";
Document doc = factory.newDocumentBuilder().parse(new File(filename));
out.println(doc);
%>
The problem is doc is getting null after this expression. The file is present in that location. I have imported org.w3c.dom.* as well. Is there any other configuration required...
Thanks in advance.
-- Ashish

The replay answer
Advertisement
Hi,
After executing your code I get the following output:
[#document: null]
I guess it does not mean that document object is null because when I
add the following statement to your code it gives the expected output.
Element element = doc.getDocumentElement();
System.out.print("Document elelment = " +element);
Just add the above lines and check if you get the document element.
-Amol

Go to See the other 3 answers

Prolem with usage of Document in jsp

Category:DefaultRelease time:-0001-11-30Views:130

Hi Ppl, Following is a part of my code in jsp.. <% try{ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); String filename = "D:\\integral\\1.0\\Resources\\ApacheTomcat4.0\\webapps\\examples\\jsp\\cal\\input1.xml"; Documen[More]

Open/save word document in jsp

Category:DefaultRelease time:2015-10-11Views:130

I can open a word document in jsp but i don't know how to save and close it to where i want again inside same jsp. I find a code that do thing i want to do but it was written in vb script. How can i convert vb code below to java / jsp? Dim wrdApp As[More]

Usage of Documents vs. Public Documents folders

Category:DefaultRelease time:2015-10-11Views:130

Can someone please explain the usage of Documents vs. Public Documents folders in BOL? I understand that if someone is registered in a Group, but not added as a participant to a specific Workspace, he/she will be able to access Team Collaboration but[More]

Please help; how to write XML document with JSP?

Category:DefaultRelease time:-0001-11-30Views:130

I try to write XML document with JSP... But I got wrong results everytime. The result is not XML file displayed in the browser, but HTML file. I even tried to use HTML special code for <, >, " but still display as HTML file not XML file. How to[More]

Where can find documents of  JSP tags of Portal 9.2?

Category:DefaultRelease time:-0001-11-30Views:130

Where I can get documents of JSP tags of Portal 9.2? I tried to understand the tag <render>, but cannot find the documents. Any input would be helpful.Yes, you are right with NetUI tags. I can find documents for NetUI on beehive site. However, the &[More]

Printing document in jsp

Category:DefaultRelease time:2015-10-11Views:130

Hello, I'm developing a web app which deals with invoices, delivery notes and that sort of things and i need to print the documents i create and show in the screen but just a part of the jsp page as i don't want the menu of the app to appear in the d[More]

Adobe document from JSP

Category:DefaultRelease time:-0001-11-30Views:130

Hi all Can anybody be able to help me to create an Adobe Document from a JSP. That is, I want the JSP to generate an Adobe Document instead of the HTML. Timely help is appreciated greatly. RajYou will have to use XSL-FO (formatting objects) to genera[More]

How to generate Word document from JSP ?

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I want to generate Word documnet from JSP. I am using Neva objects to generate Word document. Now my problem is Word doc generation code works alright as a Java application but when I place that piece of code in a JSP bean it throws an exception.[More]

Printing document from jsp

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I am trying to print a document(For example .doc file) from local system using JSP/Servlet. Please note that I dont want to print the current window and I dont want to use applet also. My requirement is that I have to use only JSP/Servlet or[More]

View a document from jsp through a link

Category:DefaultRelease time:-0001-11-30Views:130

Hi! Is it possibile open a document(any kind of document) simply by clicking on a link in a jsp? How can I do that? Thnks!If you document is accesable through the application server you could. You must create an Click here text tag. This works only i[More]

Open word document in jsp

Category:DefaultRelease time:-0001-11-30Views:130

I have a jsp file and i open a new page(word document) with a link in this jsp page. Text messages are viewed correctly in WS-Word but there is a problem for images... 1 _ How can i solve this problem? 2 _ After opening word document, if opened word[More]

Hot
My I tunes show all my music, but its not available, when I go to play it pops up locate and about 12 files of past dates of Itunes show up, but no music. In front of my music that is missing there is an astrick designating that there isn't anything [More]
Is there a way to make the Dashboard only calculate after the prompt values are selected? Thanks in advanceHow to stop the searching on dashboard when one opens the dashboard... If you search, there are more threads on this topic in this forum.Read o [More]
Hi Friends,                 I'm trying to implement fiori with some mock.json data. i'm able get my orders in master page but unable to see the details in Detail View. If i give some static data to my controls they are visible else they are not appea [More]
Hi We have installed OCS 10.1.2 on Win2003 (single box) and the mail appln was running OK after the installation. On rebooting the server, we found some components that were not started (eg Internet directory for Infra) which we started manually via [More]
Hi, I'm new to the world of JDeveloper, I'm trying to follow this tutorial http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ejb/ejb.html Firstly when I create an entity from a table I get the following error; Starting Offline Database Synchroni [More]
I have Oracle Net 9.2.0.1.0 cd and trying to install ODBC alongwith Net drivers. Though the installation message shows successful installation, the ODBC driver is not installed. I check this via Control Panel -> Data Sources. I have tried both Runtim [More]
After installing Lion, Pages always open with the last document I worked on. I've been to System Preference / General and unchecked the box about this new feature. But Pages still does it. And only Pages. Not Keynote, not Numbers. I seriously don't k [More]
I have been playing with reflection answers to the question of how to handle ActionEvent events in Swing... like using a single instance of one member class as a reflection switch: private class Listener implements ActionListener {      public void a [More]
Might be a repititive question, but my problem is not quite similar to others. I took my notebook 2 uni yesterday (it was on sleep mode). It had been working in the morning and no problem ever before. I got to uni and found that the apple sign was il [More]
Hello, I'm trying to deploy a larger wireless lan installation using a WCS 7.0 with current controller versions. Further I created configuration templates for deployment using a Config-Group. The problem of the deployment with Config-Groups are appar [More]