swapna Kadali

Greenhorn
+ Follow
since Oct 06, 2003
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 swapna Kadali

Hi,
In my J2EE course at my school, My professor suggested us ,
Beginning J2EE - Kevin Mukhar. I personally feel it's good book and helped me a lot in understanding the concept.
Below is the link which shows u that book at amazon.com, if ur interested.
http://www.amazon.com/exec/obidos/tg/detail/-/1861008333/102-8964743-9036163?v=glance
Swapna
14 years ago
Hi,
Actually I am new to java. But....
Did you try changing the scope object from session to request or application or page ? Sorry, dont mind if I am wrong, I just got a thought and just in case it works for u.
Swapna.
14 years ago
JSP
Hi Lasee and Eric,
Thanks to both of you for the reply.
Eric, Yes you are right, I should handle that error in my code.
Lasse, here is my xml file, can u see "&"(MN&O)in the last name element..?
right there..........
<?xml version="1.0"?>
<root>
<xsd:schema id="OrganizationType" targetNamespace="" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="OrganizationType">
<xsd:complexType>
<xsd:all>
<xsd:element name="Name" minOccurs="0" type="xsd:string" />
<xsd:element name="Abbreviation" minOccurs="0" type="xsd:string" />
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<OrganizationTypes>
<OrganizationType>
<Name>ABC</Name>
<Abbreviation>PT</Abbreviation>
</OrganizationType>
<OrganizationType>
<Name>DEF</Name>
<Abbreviation>CON</Abbreviation>
</OrganizationType>
<OrganizationType>
<Name>GHI</Name>
<Abbreviation>PT</Abbreviation>
</OrganizationType>
<OrganizationType>
<Name>JKL</Name>
<Abbreviation>PT</Abbreviation>
</OrganizationType>
<OrganizationType>
<Name>MN&O</Name>
<Abbreviation>PT</Abbreviation>
</OrganizationType>
</OrganizationTypes>
</root>
Hi,
I have data which has "&" operator in my xml file. When I was trying to populate data from xml file into a dropdownlistbox,
I have an error : "Error occured while parsing Entity Name from xml file"
Did anybody had this problem, If so how did you solve that?
Ofcourse I am doing this in ASP.NET web application, but I think parsing xml file is same in any language.
Thanks,
Swapna
Hi Joe,
Thanks for the reply. But as I told you in my earlier post, this is my first app and dont know much about hsqldb, so just typed in the code as is from the sample in Notepad and compiled as I dont have any IDE for java at my work but I shall go home and try it in NetBeans (which our professor recommended us) and find out the problem. But I think I can do upto establishing connection and doing rest everything with database results.
But my question is where to create table, in the application? I downloaded the zip file for hsqldb and extracted it to lib directory of my app. I shall get back to you again.
Thanks,
Swapna
Hi all,
I am trying to write a small application in which i an using HSQLDB as my database, connecting thru JDBC. This is my first app using HSQLDB. I read the complete java docs for HSQLDB from, http://hsqldb.sourceforge.net/web/hsqlDocsFrame.html
I also refered the sample code example they have in the site, ofcourse its good but i tried to use that and it didnt work for me. Can anybody pls give me some idea, if they have done this before.
Thanks in advance,
Swapna
OOPS, it is
String realPath = this.getServletContext().getRealPath("/");
String xmlFile = realpath + "WEB-INF/hello.xml";
Swapna
Hi Lasse, Thanks for your immediate reply, I tried your code in java class files first which worked fine. But as I told you before, I got to do xml parsing in servlet's init() method and when i tried to do that, I got an error:
javax.xml.parser.ParserConfigurationException must be caught or thrown exception.
My code in init() method of servlet is:
// This gets the real path of your xml file from the HardDisk
String realPath = this.getServletContext().getRealPath("/");String realPath = this.getServletContext().getRealPath("/");
//Create a handler
Handler handler = new Handler();
//Create a parser
SAXParserFactory spf = SAXParserFactory.newInstance();
XMLReader parser = null;
SAXParser saxParser = spf.newSAXParser();
//assign the handler to the parser
parser.setContentHandler(handler);
//parse the document
parser.parse("xmlFile");
Can you check if my code needs any correction.
Thanks,
Swapna
Hi Lasse and Steve, In my earlier post you both suggested me with 2 URL's on how to xml parsing using SAX, but I was struggling with that since a long time in so many ways but nothing really worked for me.
What exactly I want to do is Parse a simple xml document in servlet and populate a javabean with those values and finally show it through JSP.
I did rest everything except parsing the xml file, I also did that with JDOM and works fine for me. Pls... help me solving that problem as I have my deadline to submit that work on 19th,Nov.
I have extra credit points if I use SAX parser.
Thanks in advance.
Swapna
Hello Raj,
Ofcourse I am new to java, I had a similar problem while working with servlets with JSP. I think you have to uncomment the requestdispatcher code and then try. Hope it works, I am not sure. sorry
HttpSession session = request.getSession(true);
session.setAttribute("ssn",ssn);
String tt=(String)session.getAttribute("ssn");
System.out.println("**********"+tt);
response.sendRedirect(response.encodeURL("employee_option.html"));
// rd = getServletContext().getRequestDispatche("/employee_option.html");
//rd.forward(request,response);
// rd = getServletContext().getRequestDispatche("/employee_option.html");
14 years ago
Hi,
I am a Graduate student, did simple xml parsing using JDOM as one of my homework assignment and now i am interested to do the same using SAX Parser.
I heard pasrsing XML with SAX parser is bit difficult. Can anybody put me in right path how to do that, I have gone through the below website:
http://www.saxproject.org/
still couldn't start my work. Just give me an idea, basically a code snippet .
Thanx in advance
Swapna
Hi,
In general, it is suggested you to install tomcat in

C:/Jakarta/Tomcat4.0 ( according to my professor) without any blank spaces in the folder.
14 years ago
Hi, I had the same problem and even i am new to all those u mentioned.
But i solved that problem by making sure whether the tomcat installation is done properly, check the port where ur running the tomcat server first.
I use NetBeans IDE, so i exported a war file including all files and dropped in tomcat's webapp's folder and then browse.
http://localhost:8080/warfilename/path in URL mapping of web.xml file
It should work, hope it would help for you.
14 years ago