achayya matta

Ranch Hand
+ Follow
since Oct 27, 2005
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 achayya matta

Thanks for your reply sir.
I will try to do the same.
12 years ago
Hi,

I am facing problem while getting PDF object in servlet.i am not able to see this object in the request.

Problem Description.
-----------------------
I have JSP page which renders a PDF file inside a DIV tag.

<object id="pdf" border="0" width="100%" height="100%" type="application/pdf" data="<c ut value="${fullURL}"/>" standby="Loading pdf..."/>

Now user can fill the PDF form and submit it to server.

It will be highly appreciated if somebody can tell me how to get this PDF OBJECT in servlet.
12 years ago
Hi,

I am facing problem while getting PDF object in servlet.i am not able to see this object in the request.

Problem Description.
-----------------------
I have JSP page which renders a PDF file inside a DIV tag.

<object id="pdf" border="0" width="100%" height="100%" type="application/pdf" data="<c:out value="${fullURL}"/>" standby="Loading pdf..."/>

Now user can fill the PDF form and submit it to server.

It will be highly appreciated if somebody can tell me how to get this PDF OBJECT in servlet.
12 years ago
JSP
Hi Amol,
Its not a problem of UPLOADING..the other servlet gets this XML file and converts it into a PDF file and returns it to my servlet...

Thanks.
13 years ago
Hi,
I have two applications(WebApplications) running on two different servers.

I want one of my servlet in my application send an xml file to a servlet in other application(running on a different machine).

i can achieve this thing with a POJO having main(String args[]), using some
URL()...stuff..Its working perfectly.

Now i want to connect to that servlet from my servlet. (remember both servlets belong to different applications running on different systems)

I will be very grateful if someone can tell me how to achieve this thing.

Thanks&Regards
Ashok
13 years ago
Hello manju,
Have you tried the following snippet.
<%pageContext.setAttribute("name", "ashok");%>
my name is ${name}
it works..
Yes, it prints hello for the first request and "1 hello" for the next request.
hello all,
i am using tomcat 5.5.12 and java 1.5. One of my jsp uses some "generic" stuff from java 1.5 .When i ran my application , the jsp file in which the generic stuff is included,showing error.
Then i did add the following lines to my web.xml which is somewhere in tomcat installation directory.
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>
But its showing the same error. Can anyone clarify me please? What to do?

Regards
ashok
14 years ago
hello ranchers,

i am doing some online examination project using AJAX.In this project i have "next" and "previous"
buttons.Suppose user answered some 5 questions and when he clicks "previous" button ,it is showing the question with all
checkboxes unchecked.What i need here in this project is it should remeber what i have clicked.Is there any mechanism in javascript to
remember user clicked checkboxes.I only want to achieve this with javascript. Is this possible and how?

with Regards,
ash
Thank you so much sir.you saved my life
hello ranchers,

i have one servlet which returns some piece of xml.

response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache"); 0ut.write("<message><mes1>ashok</mes1><mes2>koti</mes2></message>");

The code i wrote in javascript is as follows

var message = req.responseXML.getElementsByTagName("message")[0];

alert(message.nodeName); <--ouput is : message -->
alert(message.nodeValue); <--output is : null -->
alert(message.hasChildNodes()); <--output is : true -->
alert(message.childNodes.length); <--output is : 2 -->

document.write(message.childNodes[0].nodeValue) <--output is : null -->

Can anyone help me , why i am getting null value when i print "message.childNodes[0].nodeValue"

Regards
Thanks in advance
hello ranchers,
Can you people help me ?
my problem is..........

i am going to do some online examination project.I want to implement AJAX model for my project.
i have created one servlet which fetches " Questions and answers" from Database and makes one XML document in the memory.
I want to retrieve this XML document in my java script code.


Can you people suggest me how to retrieve the DOM in my java Script code???


....................................Following is the code which generates XML document..........................

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.DOMWriter;



public class DocGen
{

private org.dom4j.Document doc;
Element root;
Element child;
Element Ichild;

public org.w3c.dom.Document generateDoc() throws Exception{
doc = DocumentHelper.createDocument();

root=doc.addElement("Questions");
child= root.addElement("Question").addAttribute("id","1").addAttribute("text","Which of the following are valid java keywords?");
Ichild= child.addElement("Option").addText("while");
Ichild= child.addElement("Option").addText("if");
Ichild= child.addElement("Option").addText("goto");
Ichild= child.addElement("Option").addText("friend");

child= root.addElement("Question").addAttribute("id","2").addAttribute("text","which of the following are valid java access specifiers?");
Ichild= child.addElement("Option").addText("public");
Ichild= child.addElement("Option").addText("private");
Ichild= child.addElement("Option").addText("default");
Ichild= child.addElement("Option").addText("none");

DOMWriter writer = new DOMWriter(); /* this line is used to create W3C DOM object out of DOM4J DOM object */
return writer.write(this.doc);

}


}



..............................Following is the code which makes W3c DOM........................................................
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import com.valueshore.xml.DocGen;

import org.dom4j.Document;

/**
*
* @author GSI
* @version
*/
public class EvaluationServlet extends HttpServlet {


protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException,Exception {

DocGen dg=new DocGen();
org.w3c.dom.Document doc=dg.generateDoc();
response.setContentType("text/xml");
PrintWriter out = response.getWriter();
out.close();
}


}
hello ranchers,
Can you people help me ?
my problem is..........

i am going to do some online examination project.I want to implement AJAX model for my project.
i have created one servlet which fetches " Questions and answers" from Database and makes one XML document in the memory.
I want to retrieve this XML document in my java script code.


Can you people suggest me how to retrieve the DOM in my java Script code???


....................................Following is the code which generates XML document..........................

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.DOMWriter;



public class DocGen
{

private org.dom4j.Document doc;
Element root;
Element child;
Element Ichild;

public org.w3c.dom.Document generateDoc() throws Exception{
doc = DocumentHelper.createDocument();

root=doc.addElement("Questions");
child= root.addElement("Question").addAttribute("id","1").addAttribute("text","Which of the following are valid java keywords?");
Ichild= child.addElement("Option").addText("while");
Ichild= child.addElement("Option").addText("if");
Ichild= child.addElement("Option").addText("goto");
Ichild= child.addElement("Option").addText("friend");

child= root.addElement("Question").addAttribute("id","2").addAttribute("text","which of the following are valid java access specifiers?");
Ichild= child.addElement("Option").addText("public");
Ichild= child.addElement("Option").addText("private");
Ichild= child.addElement("Option").addText("default");
Ichild= child.addElement("Option").addText("none");

DOMWriter writer = new DOMWriter(); /* this line is used to create W3C DOM object out of DOM4J DOM object */
return writer.write(this.doc);

}


}



..............................Following is the code which makes W3c DOM........................................................
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import com.valueshore.xml.DocGen;

import org.dom4j.Document;

/**
*
* @author GSI
* @version
*/
public class EvaluationServlet extends HttpServlet {


protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException,Exception {

DocGen dg=new DocGen();
org.w3c.dom.Document doc=dg.generateDoc();
response.setContentType("text/xml");
PrintWriter out = response.getWriter();
out.close();
}


}