I think this code would work for you. If you put this code into a bean and
store all the lines to the database. You then could make it a session
variable and print it out. I got this code from two different sites, and it
works great.
If you have any problems email me directly.
Daniel Jaffa
Computer GOD who Created the Stars and Moon
"If you are not happy, I am not happy"
<%
BufferedReader br = null;
HttpURLConnection urlc = null;
URL u = null;
urlString = "http://yoururl.com"
String line = "";
try {
u = new URL (urlString);
}
catch (MalformedURLException mfurle) {
System.out.println ("URL: " + urlString + "\t\tMalformed URL " +
mfurle.getMessage());
}
try {
urlc = (HttpURLConnection)u.openConnection ();
}
catch (UnknownHostException uhe) {
System.out.println (urlString + "\tUnknown Host " + uhe.getMessage());
}
catch (NoRouteToHostException nrthe) {
System.out.println (urlString + "\tNo Route to Host " +
nrthe.getMessage());
}
catch (Exception e) {
System.err.println (urlString + "\tException " + e.getMessage());
}
// Now we can connect and start loading the page
try {
urlc.connect ();
}
catch (IOException ioe) {
System.out.println ("Connection Failure " + urlString + "\tException:
" +
ioe.getMessage());
}
catch (Exception e) {
System.err.println (urlString + "\tException " + e.getMessage());
}
br = new BufferedReader (new InputStreamReader (urlc.getInputStream ()));
while ( (line = br.readLine ()) != null ) {
%><%=line%><%="\n"%><%
}
br.close ();
urlc.disconnect ();
}
%>
----Original Message Follows----
Thanks for that, Jan. I don't think it is what I am looking for, although
it might be my only solution.
I am trying to find a pure JSP way of accessing the HTML. For instance, my
JSP might look something like this...
<jsp:useBean id="usethisbean" class="package.JavaBean" />
<jsp:setProperty name="usethisbean" property="*" />
<HTML>
<HEAD>
</HEAD>
<BODY>
The result of the database query is <jsp:getProperty name="usethisbean"
property="value"/>
</BODY>
</HTML>
The HTML source at the browser would look like this:
<HTML>
<HEAD>
</HEAD>
<BODY>
The result of the database query is MyValue
</BODY>
</HTML>
When I detach it using the JavaScript button function, I don't want to call
the JSP again or re-submit the database query. All I want to do is send
the actual HTML source to the browser again by retrieving it using servlet
APIs or something. I don't even know if this is possible.
David
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com