Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > URLConnection tricks

Reply
Thread Tools

URLConnection tricks

 
 
Roedy Green
Guest
Posts: n/a
 
      05-04-2004
On Tue, 04 May 2004 18:03:27 GMT, Andrew Thompson
<(E-Mail Removed)> wrote or quoted :

>Neat! Would you consider adding some JS(!)
>to allow configuring it by URL?


You want to invoke the applet, and give it a parameter with just an
URL.

e.g. http://mindprod.com/mimecheck.html?h...e.org/app.jnlp

JavaScript on that page takes the parameter, and feeds it to MimeCheck
as an Applet tag, which then starts up and displays the URL, and
auto-presses TEST. The browser then views the completed applet page.

I don't know enough JavaScript to do that, but I do know how to add a
tag called URL to the Applet. If you want to cook up the javascript
part, MimeCheck version 1.2 now has an optional

<param name="URL" value="http://mindprod.com/esper.jnlp">



--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      05-04-2004
On Tue, 04 May 2004 18:55:47 GMT, Roedy Green wrote:

> On Tue, 04 May 2004 18:03:27 GMT, Andrew Thompson
>>Neat! Would you consider adding some JS(!)
>>to allow configuring it by URL?

>
> You want to invoke the applet, and give it a parameter with just an
> URL.


Yep.

> If you want to cook up the javascript part,


Done.

> MimeCheck version 1.2 now has an optional
>
> <param name="URL" value="http://mindprod.com/esper.jnlp">


Cool. Check your email.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      05-04-2004
On Tue, 04 May 2004 20:01:57 GMT, Andrew Thompson
<(E-Mail Removed)> wrote or quoted :

>> <param name="URL" value="http://mindprod.com/esper.jnlp">

>
>Cool. Check your email.


no sign of anything. try my first name, my last initial @ my website.
e.g. http://mindprod.com/images/mailto.gif

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-05-2004
On Tue, 04 May 2004 23:26:51 GMT, Roedy Green wrote:

> On Tue, 04 May 2004 20:01:57 GMT, Andrew Thompson

...
>>...Check your email.

>
> no sign of anything. try my first name, my last initial @ my website.
> e.g. http://mindprod.com/images/mailto.gif


D'Oh! I was misspelling 'mindprod'.
Let's try a different route..

For the files..
<http://www.physci.org/test/002mimetype/>

And just to see it work..
<http://www.physci.org/test/002mimetype/mimetype.html?url=http://www.physci.org/jnlp/PhySci.jnlp>

[ I have also updated you address in my mail program ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-05-2004
On Wed, 05 May 2004 06:10:10 GMT, Andrew Thompson wrote:

> For the files..
> <http://www.physci.org/test/002mimetype/>


Let me know when you have them and I'll
delete them from my server.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-05-2004
On Wed, 05 May 2004 06:10:10 GMT, Andrew Thompson
<(E-Mail Removed)> wrote or quoted :

>
>For the files..
><http://www.physci.org/test/002mimetype/>


Your code is now hooked up. You can now test a url all on the command
line.

For example to test the MIME types being sent by
http://java.sun.com/index.jsp you would type into your browser's
command line:
http://mindprod.com/urlcheck.html?ur....com/index.jsp

or as a tinyurl:
http://tinyurl.com/ysbrz
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-06-2004
On Wed, 05 May 2004 21:29:51 GMT, Roedy Green wrote:

>>For the files..

...
> Your code is now hooked up. You can now test a url all on the command
> line.


Excellent, I checked it worked from here
and removed the files from my server.

> For example to test the MIME types being sent by
> http://java.sun.com/index.jsp you would type into your browser's
> command line:
> http://mindprod.com/urlcheck.html?ur....com/index.jsp


Not that you can _also_ use..

http://mindprod.com/urlcheck.html?=h....com/index.jsp
or
<http://mindprod.com/urlcheck.html?thisisaverylongandsillyparametername thatthejavascriptwillutterlyignore=http://java.sun.com/index.jsp>



(shrugs) The 'url' bit seemed logical,
but the JS will work without it. [All
it needs is '?=' before the actual URL ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-06-2004
On Thu, 06 May 2004 03:03:57 GMT, Andrew Thompson
<(E-Mail Removed)> wrote or quoted :

>Not that you can _also_ use..


Not really. that is not the documented interface. I reserve the
right to create new optional parameters, and if you used something
other than url, it could stop working.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OutputStream from a URLConnection produces an OutOfMemory OutputStream from a URLConnection produces an OutOfMemory WinstonSmith_101@hotmail.com Java 2 10-25-2006 04:45 PM
write a string from URLConnection to a servlet dave Java 0 12-03-2003 07:47 PM
Problems encoding in utf8 with urlconnection response Bronwyn Howard Java 0 10-01-2003 06:10 AM
URLConnection to WebService gets FileNotFoundException Brock Jones Java 0 09-04-2003 12:10 AM
URLConnection and proxy Kristoffel Java 0 07-27-2003 08:27 PM



Advertisments