Re: [Aimmath-developers] RE: AiM Community: Re: Works with all browsers
Brought to you by:
gustav_delius,
npstrick
|
From: Manolis M. <ma...@ma...> - 2003-07-18 09:58:53
|
> * Alice.java is supposed to grab the value of "Browser" and pass it down
> to subsequent webpages that the student visits, like the various
> "Command"s are.
> The java script browser detection part works; the java code compiles, but
> subsequent webpages visited don't get the value of "Browser" passed down.
> Can anyone see what I might be doing wrong?
Subsequent calls to Alice servlet do not contain the hidden vbariable that
you passed the first time
>Any hints about how to get the
> java code to write out info. as it's going would be helpful too. My main
> problem is I don't know enough java ... I'm better at C etc.
One solution is to keep on passing a hidden parameter broswer to every page
but I don't like solutions like these. A better solution is to use the
session functionality that Tomcat has. I am sorry I can't demonstrate since
I am away but I tried it on my laptop's AIM and seems it works :
initially we can do the following somewhere before the maple.exec:
Session session = request.getSession();
session.setAttribute("browser", alicereq.browser);
that sets the browser attribute of the user session (we need to conduct some
tests to test if session exists with request.getSession(true) etc. but this
is trivial) and then
maple.exec("`aim/Main`(" + commandargs + "):\n",
// "",
" -u",
((String)session.getAttribute("browser").equals("IE") ?
"" : " -u"),
webOutput);
> Also, if someone can see a way of doing it without having two separate
> index.html variants that would be good too.
the two pages are OK to have ... but if it is a matter of only setting the
hidden variable Broswer then you can do it programmatically with JavaScript.
For this you can set a function onSubmit that is called before actually
submitting and sets the hidden value (I can do this at the end of the month
if you want so stick with the two pages for the moment)
> ... and we can detect for Netscape 4 on windows and make it use symbol
> font, and warn that Netscape 4 on UNIX requires some special
> configuration, and then we can look at other browsers like safari, opera
> and konqueror and decide if the Unicode option is the correct one etc.
and hopefully later by detecting Mozilla we can finally use MathML and
Mozilla's native rendering which is great !!
Manolis
|