Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > quotes in Applet params

Reply
Thread Tools

quotes in Applet params

 
 
Roedy Green
Guest
Posts: n/a
 
      05-22-2004
It is up to you as programmer to cook up some scheme to embed quotes
in Applet param tag values, or in there some accepted convention or
even builtin convention that handles them automatically?

--
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
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      05-22-2004
On Sat, 22 May 2004 16:40:21 GMT, Roedy Green
<look-> wrote or quoted :

>It is up to you as programmer to cook up some scheme to embed quotes
>in Applet param tag values, or in there some accepted convention or
>even builtin convention that handles them automatically?


Similarly for other naughty characters like \n.
--
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
 
 
 
 
Liz
Guest
Posts: n/a
 
      05-22-2004

"Roedy Green" <look-> wrote in message
news:...
> On Sat, 22 May 2004 16:40:21 GMT, Roedy Green
> <look-> wrote or quoted :
>
> >It is up to you as programmer to cook up some scheme to embed quotes
> >in Applet param tag values, or in there some accepted convention or
> >even builtin convention that handles them automatically?

>
> Similarly for other naughty characters like \n.
>

java.net.URLEncoder
Has a method that you can use that will convert any string
into one that uses the %20 type encodings (and + for space).
Then on the other end use URLDecoder


 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      05-22-2004
On Sat, 22 May 2004 23:16:55 GMT, "Liz" <> wrote or
quoted :

>java.net.URLEncoder
>Has a method that you can use that will convert any string
>into one that uses the %20 type encodings (and + for space).
>Then on the other end use URLDecoder


But Java does not do this automatically, right?

--
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-22-2004
On Sat, 22 May 2004 16:42:21 GMT, Roedy Green wrote:

> On Sat, 22 May 2004 16:40:21 GMT, Roedy Green
> <look-> wrote or quoted :
>
>>It is up to you as programmer to cook up some scheme to embed quotes
>>in Applet param tag values, ...


Special?
<http://www.physci.org/test/param/>

Nothing special in that.

If you like, I'll whip up a .jsp that
try any ole crap param you throw at it
...should be mildly interesting.

--
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-23-2004
On Sat, 22 May 2004 23:44:20 GMT, Andrew Thompson wrote:

>> On Sat, 22 May 2004 16:40:21 GMT, Roedy Green
>>>It is up to you as programmer to cook up some scheme to embed quotes
>>>in Applet param tag values, ...

>
> Special?
> <http://www.physci.org/test/param/>


Perhaps I should have been a little more
rigoruous and mentioned that the tag..

<param name=param1 value=1.'4"xx1>

...shows [ 1.'4"xx1 ] on..
XP Pro, with
1.4.2 JVM in both..
Moz 1.3 and
IE 6. As well as..
1.1.4 MSVM in..
IE 6

...there. (page updated as well)

--
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
 
Pedro
Guest
Posts: n/a
 
      05-23-2004
On 22-5-2004 18:40, Roedy Green wrote:
> It is up to you as programmer to cook up some scheme to embed quotes
> in Applet param tag values, or in there some accepted convention or
> even builtin convention that handles them automatically?
>

Plain HTML character entities maybe?
<PARAM NAME="QuoteYourParameters" VALUE="&quot; or even "">

Regards,
Pedro
 
Reply With Quote
 
Pedro
Guest
Posts: n/a
 
      05-23-2004
On 22-5-2004 18:42, Roedy Green wrote:

> On Sat, 22 May 2004 16:40:21 GMT, Roedy Green
> <look-> wrote or quoted :
>
>
>>It is up to you as programmer to cook up some scheme to embed quotes
>>in Applet param tag values, or in there some accepted convention or
>>even builtin convention that handles them automatically?

>
>
> Similarly for other naughty characters like \n.


<PARAM NAME="MultipleLines" VALUE="line 1 line2 etc.">

Should work in most of the modern browsers. Don't know if appletviewer understands it, though.

Regards,
Pedro
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      05-23-2004
On Sun, 23 May 2004 07:05:49 +0200, Pedro wrote:
> On 22-5-2004 18:40, Roedy Green wrote:
>> It is up to you as programmer to cook up some scheme to embed quotes
>> in Applet param tag values, or in there some accepted convention or
>> even builtin convention that handles them automatically?
>>

> Plain HTML character entities maybe?
> <PARAM NAME="QuoteYourParameters" VALUE="&quot; or even "">


After further investigation, that seems safest..
<http://www.physci.org/test/param/index.jsp>

Pedro's example works for either single or double quotes
<http://www.physci.org/test/param/index.jsp?num=3>

Whereas my initial example _only_ works with *no* quotes..
<http://www.physci.org/test/param/index.jsp?num=0>

There are some other examples and a form
on the page..

HTH

--
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-23-2004
On Sat, 22 May 2004 23:44:20 GMT, Andrew Thompson
<> wrote or quoted :

><http://www.physci.org/test/param/>


Parms are supposed to be enclosed in quotes, and these are not part of
the param. If you run code though HTMLValidator it will complain if
you leave out the quotes, but it will work.

You can't therefore pass as a parameter

"I think therefore I am" including the quotes.

I wrote this up as requiring URLEncoding.

--
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
PHP double quotes inside double quotes MSB Computer Support 11 10-21-2006 01:09 PM
Asp.NET Javascript string, want to pass '(single quotes' within '(single quotes) Chris ASP .Net 1 03-24-2006 09:03 PM
params v.s. @params in rails? Barry Ruby 9 09-15-2005 03:12 AM
Quotes/Double Quotes in Image Control Chris White ASP .Net 1 09-22-2004 06:22 AM
Multiline quotes - escaping quotes - et al Lawrence Tierney Java 3 12-24-2003 05:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57