From: Dario L. <lib...@in...> - 2003-03-04 20:56:35
|
RE: [Webmacro-devel] special charactersKeats , thank you a lot for your = help. the special characters work fine now. as of point 2), "session is invalid"... I managed to overcome it by = asking the WebContext the HttpServletRequest, and then asking it the = session instead of taking it directly. It seems to be working now. I = guess that the WebContext beheaves differently, or something, perhaps it = does not create a new one if there isnt one. The only problem I am facing now, is the error handling. Before, there was a silent <!-- error description --> pattern. Now I get the whole page thown away and instead I get an error page. = even with simple errors. I know I should correct them, but I would like them to behave quietly, = and also get them appended in a log file. Is it posible? =20 ----- Original Message -----=20 From: kea...@na...=20 To: lib...@in... ; web...@li...=20 Cc: ar...@ci...=20 Sent: Tuesday, March 04, 2003 13:59 Subject: RE: [Webmacro-devel] special characters Dario,=20 Finally getting around to upgrading, huh? I can barely remember back = that far but I think I may be able to help you out. 1) WM now uses UTF-8 as its default input file encoding. This was a = controversial decision, since most Westerners use ISO8859_1 (aka = Latin-1). Most likely your files are stored using Latin-1, so you = should set the TemplateEncoding in your WebMacro.properties: TemplateEncoding: ISO8859_1=20 Alternatively you could set this as a parameter in your templates:=20 #param $TemplateEncoding=3D"ISO8859_1"=20 2) I'm not sure about this one, but I'm guessing that your $Session = tool is not getting loaded properly. Crank your logging up do DEBUG and = check your log to see if this is the case. Usually these kinds of = problems are due to old WebMacro.properties files. Most of the settings = have been moved into the jar file now (in WebMacro.defaults) so you = should need few if any settings in the properties file. Hope this helps.=20 Keats=20 > Hello,=20 >=20 > I am moving from a previous webmacro version. One that had the = sintax=20 > "implements Handler" instead of the new "extends WMServlet".=20 > I moved to jsdk1.3 and changed the class name from=20 > "org.webmacro.servlet.Reactor" to my servlet name in the=20 > servlets definition=20 > of my Jrun 3.1=20 >=20 > And I am having 2 problems now that do not let me make the full = move:=20 >=20 > 1) acentuated characters seem to make the parser crash:=20 > -- secondary stack trace --=20 > sun.io.MalformedInputException=20 > at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:152)=20 > at=20 > java.io.InputStreamReader.convertInto(InputStreamReader.java:137)=20 > at = java.io.InputStreamReader.fill(InputStreamReader.java:186)=20 > at = java.io.InputStreamReader.read(InputStreamReader.java:249)=20 > at java.io.BufferedReader.fill(BufferedReader.java:139)=20 > at java.io.BufferedReader.read1(BufferedReader.java:187)=20 > at java.io.BufferedReader.read(BufferedReader.java:261)=20 > at=20 > org.webmacro.parser.BackupCharStream.FillBuff(BackupCharStream=20 > .java:95)=20 >=20 > Here is somebody with a similar problem, but I havent found=20 > there any answer=20 > to the problem.=20 > = http://spitfire.velocet.net/pipermail/webmacro/2001-April/005210.html=20 >=20 > 2) I get a "session is invalid" exception whenever I want to use the = > httpsession, a code that run for years with no problem with=20 > the previous=20 > webmacro.=20 > Does anybody have a clue to what this may be?=20 >=20 > The stack trace:=20 >=20 > :Exception!!!=20 > java.lang.IllegalStateException: Session is invalid=20 > at=20 > allaire.jrun.session.JRunSession.checkSessionValidity(../sessi=20 > on/JRunSession=20 > .java:318)=20 > at=20 > allaire.jrun.session.JRunSession.removeValue(../session/JRunSe=20 > ssion.java:251=20 > )=20 > at=20 > com.ineba_servletframework.CServletApp.handle(CServletApp.java:543)=20 > at=20 > org.webmacro.servlet.WMServlet.doRequest(WMServlet.java:255)=20 >=20 >=20 > The code is:=20 >=20 > // Get the user session if it exists. If it doesn't, = this=20 > creates a new one.=20 > HttpSession session =3D c.getSession();=20 >=20 > // if the "userinfo" key exits, that means the=20 > user should be=20 > logged=20 > CUserDataInSession userdata =3D=20 > (CUserDataInSession)retValues.get("userinfo");=20 > if(userdata !=3D null) {=20 >=20 > session.putValue(getSessionPrefix()+CUserDataInSession.ID_STRI=20 > NG, userdata);=20 > }else {=20 > // Ensure the user is not logged=20 > // NOTE: We do NOT detroy the session.=20 > Instead, we remove=20 > the CUserDataInSession object=20 > // from the session.=20 >=20 > = session.removeValue(getSessionPrefix()+CUserDataInSession.ID_STRING);=20 > }=20 > if(session.isNew()) {=20 > int maxInactiveInterval =3D=20 > CUtils.parseInt(getProperty("user.sessionMaxInactiveInterval")=20 > ,600000);=20 > session.setMaxInactiveInterval(maxInactiveInterval); = > }=20 >=20 >=20 >=20 > Please Help!!!=20 >=20 > Best regards,=20 > Dario Liberman.=20 >=20 |