java bean

how Java bean allows you to proceed get/post requests to the specified host, can anybody give me the example
[122 byte] By [plotinc] at [2007-9-26 1:46:06]
# 1
I would also like to find out too
cheehwa at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
try using URL class.. get a stream and do write/read
sribk at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hi plotinc,

Here iam giving you the some related code.

<html>

<b>Quote page</b>

<%@ page language="java" import="Request" %>

<jsp:useBean id="quote" class="Request" scope="page" />

<%

String s="";

java.util.Vector v;

quote.setHost("http://finance.yahoo.com/q?s=SUNW");

quote.setMethod("get");

s=quote.action();

quote.setTemplate("SUNW</a>,*T,%1,*T,%2,*T,%3,*T,%4,*T,%5,*T");

v=quote.parse(s);

if (v.size()>=6)

s=v.elementAt(2)+" "+v.elementAt(3)+v.elementAt(4)+v.elementAt(5);

else

s="can not get quote";

%>

Quote for SUNW: <%= s %>

</html>

I hope this will help you out.

Regards,

Developer Technical Support,

Sun Microsystems,India.

rao_indts at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
You must past the request interface to the bean class.
fayefun at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
You must past the request interface to the bean class.
fayefun at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
You must past the request interface to the bean class.
fayefun at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Hi, the example looks pretty cool but what about the Request class/interface. where can it be found. Please be more specific for thatThanks Tarak
tarakpurani at 2007-6-29 2:43:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...