mathew Jackson

Greenhorn
+ Follow
since Jun 15, 2001
Merit badge: grant badges
For More
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 mathew Jackson

I wish my problem were that simple. I need to basically pass one document through an xslt. In the xslt is a call to document(). what I need is to make that call to document() to a doc in memory rather than to one at a uri.
Instead of:
<xsl:variable name="myDoc" select="http://www.document.com"/>
I need:
<xsl:variable name="myDoc" select="SOME DOC VARIABLE IN THE APP"/>
Any one?
This may be a simple question or it may be a really tough one.
I have two xml documents that have been created and sent via servlets to another java app. I need to merge data from one document into the other without storing either to disk.
I know how to use the document() function if the document called is saved somewhere but how can I do it if they are both in memory?
Any help would be appriciated.
If my servlet engine and my database reside on the same machine, and I am using OCI connections, do I have to do anything to specify that they should be bequeath connections or do they default to using Net8 TCP/IP connections?
CallableStatement stmt = con.prepareCall(
"{call pkg.proc(?,?)}");
stmt.setInt(1,myInt);
stmt.registerOutParameter(1,OracleTypes.CURSOR);
stmt.execute();
ResultSet rs = (ResultSet)stmt.getObject(2);

This is a fairly basic example. It assumes that you are connected and that the username used to get the connection has permissions to execute the stored procedure. Also, I assumed that you are using oracle. A good reference is
http://www.csee.umbc.edu/help/oracle8/java.815/a64685/basic5.htm

Hope it helps
First, if this is the wrong forum, my appologies.
I have a servlet that executes a C++ program on Solaris. The problem I'm having comes in streaming the output from the servlet to the client app. The client is also a Java client.
The code looks like this (but a bit more complex)
OutputStream = (OutputStream)response.getOutputStream;

Runtime rt = Runtime.getRuntime();
Process pro = rt.exec(cmd);
InputStream is = pro.getInputStream();
byte[] buffer = new byte[266];
while(true){
int bytes = in.read(buffer);
if(bytes == -1) break;
out.write(buffer,0,bytes);
}// end while
Regardless of the size of output (and it is usally quite large) I get one of two errors. either an OutOfMemoryError from the servlet or Unexpected EOF Exception from the client.
Does anybody have any ideas? Would I have the same trouble if I used JNI?
thanks in advance
22 years ago
Also, Filters in the new 2.3 spec may be of some use. I haven't yet worked with them but who knows.
22 years ago
OK, I understand why you are doing this the way you are. I too had a similar problem. The way I solved it was to leave the mapping in place but to set an attribute in the first servlet, then check for that attribute in the second. If the attribute wasn't set or was not what I set it to I returned a 403.
So in servlet a add:
req.setAttribute("MY_ATT", "SOME_VALUE");
and in servlet b:
if(req.getAttribute("MY_ATT") == null){
res.sendError(res.SC_FORBIDDEN);
}
Hope that helps some
22 years ago
Here is what I need to do. Inside a servlet I have an InputStream that is the result of calling getInputStream on a Process. This is stdout from a C program that I call. I also have an OutputStream. This comes from Response.getOutputStream. What I need to do is pipe the stream from the InputStream through the OutputStream.
Any ideas?
22 years ago
I hope this is the right forum for this question. I am using JDK1.2.2 and Tomcat as my servlet engine. I'm trying to write a servlet that acts a an xml-rpc server but the only thing I can get it to do is return the initial vector of parameters. I have searched the documentation and tried the simple servlet example given with the package but it still doesn't work. Has anyone else tried this?
Matt
22 years ago
xml-rpc as far as I know doesn't support namespace and schemas. For that you will need to use SOAP.
I personally would vote against the applet approach. If you are popping up applets all over the place your users could easily be lost. I believe in limiting the choices available to a user on the gui and thus reducing the chance for errors and complaints. go for the JSP approach and put your logic in servlets and other java classes.
22 years ago