[rfc][icedtea-web-1.5]escape < and > in console (was Re: [rfc][icedtea-web] log jnlp file to console )
Jie Kang
jkang at redhat.com
Mon Nov 24 16:53:14 UTC 2014
----- Original Message -----
> I have just spotted interesting behavior for both 1.5 and head.
>
> When javaws appl forks (the behaviour which can be canceled by -Xnofork) and
> printing to streams is
> enabled then forked jvm is writing into stdout/err, which is then recognized
> by upper jvm as
> "custom input" and so is reprinted again also to old console.
>
> As it do not deadloc, then I would call it feature, not a bug :)
>
> However, - as jnlp is reprinted to stdout by foorked jvm in 1.5
>
> the
>
> --- a/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java Fri
> Nov 14 16:25:56 2014 +0100
> +++ b/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java Tue
> Nov 18 15:44:47 2014 +0100
> @@ -205,6 +205,8 @@
> }
> String line = (createLine(messageWithHeader));
> if (mark) {
> + line = line.replaceAll("<", "<");
> + line = line.replaceAll(">", ">");
> line = line.replaceAll("\n", "<br/>\n");
> line = line.replaceAll(" ", " ");//small trick, html
> is reducting row of
> spaces to single space. This handles it and stimm allow line wrap
> line = line.replaceAll("\t", " ");
>
>
> hunk is very valid also for 1.5 and if head is approved, then I would like to
> push this hunk to 1.5
> Well.. maybe more escaping is needed. But not sure how urgent those are...
>
Hello,
Okay.
Regards,
>
> J.
>
> On 11/18/2014 04:32 PM, Jiri Vanek wrote:
> > >
> >>
> >> ----- Original Message -----
> >>> On 10/21/2014 03:46 PM, Jiri Vanek wrote:
> >>>> hi!
> >>>>
> >>>> This is not just rfc, but RFC :) as I'm not sure which way to go. The
> >>>> only one I found suitbale -
> >>>> this oen - is not nice.
> >>>>
> >>>> Curently all the logs are going to logger, which determine if debug is
> >>>> on
> >>>> and what channels are
> >>>> enabled (stdout/err, file, console)
> >>>>
> >>>> According to those, it consume the message. This workflow had one
> >>>> exception, the reprinting of
> >>>> jnlpfiel, which went only to console, if debug was online.
> >>>> Most of the bugreports now contains whole console - and it is very good
> >>>> -
> >>>> but that measn the jnlp
> >>>> file is missing.
> >>>>
> >>>>
> >>>> The jnlpfile reprint was excluded, becasue console is using html
> >>>> formatting, to higlight outputs -
> >>>> for palintext the reprint is and willbe working fine, but it is not
> >>>> working
> >>>> with syntax higlighting
> >>>> from obvious reasons.
> >>>>
> >>>> I wont to avoid escaping of inpout - the message object is sahred
> >>>> between
> >>>> stdou/file/html
> >>>> console/plain console so to make special decoding for html console do
> >>>> need
> >>>> copy of it (and in case
> >>>> of console solid rework of console itself) and then proces via
> >>>> esapcping.
> >>>> Another issue is that html in java is terribly old, and hard to say what
> >>>> specification it supports
> >>>> (if any).
> >>>>
> >>>> To my surpise it support <plaintext> (yes nothing else do so...) So I
> >>>> have
> >>>> tryed to include the jnlp
> >>>> reprint wrapped by this tags. And it seems to be working fine wiht all
> >>>> supported outputs without any
> >>>> encodings or copying.
> >>>>
> >>>> There is drawback - eg firefox now have issues to show everything behind
> >>>> </plaintext> :( (note -
> >>>> <pre> do not work for jeeditorpane:( ))
> >>>>
> >>>> J.
> >>> ping, thoughts? I amde an attmept with <pre><plaintext></paintext></pre>
> >>> and
> >>> it did not helped.
> >>> Still the jnlp fiel should appear inconsole :(
> >>
> >> Hello,
> >>
> >> In user-testing, the JavaConsole now displays the entire jnlp file in one
> >> line, making it
> >> difficult to read. It seems the break tags do not get formatted when
> >> displayed in Java Console (at
> >> least for me).
> >>
> >> However if you copy and paste it into a text file, it becomes multiple
> >> lines:
> >>
> >> e.g.
> >>
> >> <br/>
> >> <?xml version="1.0" standalone="yes"?><br/>
> >> line: 2 <br/>
> >> line: 3 <jnlp spec="1.0" href="SimpleJNLP.jnlp"
> >> xmlns="http://www.w3.org/1999/xhtml"><br/>
> >> line: 4 <information><br/>
> >> line: 5 <title>simple application</title><br/>
> >> line: 6 <vendor>IcedTea</vendor><br/>
> >> line: 7 <homepage
> >> href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"></homepage><br/>
> >> line: 8 <description></description><br/>
> >> line: 9 <offline-allowed></offline-allowed><br/>
> >> line: 10 </information><br/>
> >> line: 11 <resources><br/>
> >> line: 12 <j2se version="1.4+"></j2se><br/>
> >> line: 13 <jar href="SimpleJNLP.jar"></jar><br/>
> >> line: 14 </resources><br/>
> >> line: 15 <applet-desc name="SimpleJNLP Applet"
> >> main-class="SimpleJNLP"><br/>
> >> line: 16 </applet-desc><br/>
> >> line: 17 <br/>
> >> line: 18 <br/>
> >> line: 19 <br/>
> >> line: 20 </jnlp><br/>
> >> line: 21 <br/>
> >> line: 22
> >>
> >> Also, I do not think it's useful to display the line numbers (e.g. line:
> >> 2, line: 3, ...). Could
> >> these be removed?
> >>
> >> I feel like sending multiple messages to the Java Console might be okay
> >> however I don't fully
> >> understand the concerns you have at the moment;;
> >>
> >> Personally, it would be most useful if there were no break tags or line
> >> numbers so I could copy
> >> and paste the output into a file and have it be pretty much the same as
> >> the original jnlp file. Is
> >> the Java Console limited and unable to do this? Maybe we can modify Java
> >> Console to support what
> >> we need;;
> >
> > Yes. It is deffinitly the right way. See new patch with your approach :)
> >
> > Thoughts?
> >
> >
> > J.
> >
> >
> >
>
>
--
Jie Kang
More information about the distro-pkg-dev
mailing list