RE: message masks

2001-07-06 Thread Ben Flaumenhaft


Renzo,

Doesn't html:message do something like this? It allows you to specify
parametric arguments for subsitution. See

http://jakarta.apache.org/struts/struts-bean.html#message

Regards,
Ben Flaumenhaft
Principal, Sidelight Consulting
http://www.sidelight.com


 -Original Message-
 From: Renzo Toma [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 06, 2001 5:30 AM
 To: [EMAIL PROTECTED]
 Subject: message masks
 
 
 
 Hi there,
 
 First of all, I want to thank all Struts developers  contributors for
 creating such a nifty  framework. After working with it for 
 some time now, I
 really miss message masks, like 'Hi {0}, welcome back'. Ok, I 
 _could_ use a
 pre and suffix, but that's not very proper.
 
 Now I have found a thread (url below) on the user 
 mailinglist, but I cant
 seem to find any resolution on the subject.
 
 http://marc.theaimsgroup.com/?l=struts-userm=99400475317567w=2
 
 So I hope you can answer my question. Do you know by any 
 chance if someone's
 working on it, or should I consider this a do-it-yourself?
 
 
 
 Cheers,
 
 Renzo
 
 
 ps. have also posted this to the devlist, but I figure more 
 people read this
 list.
 
 




Encodings on form submits?

2001-07-05 Thread Ben Flaumenhaft


Folks,

I'm struggling with how to handle form submissions with non-Latin character
encodings using a Struts action and form beans.

As I understand it, browsers use the character encoding of the form's page
(hex-encoded) for submitting form parameters. I've seen plenty of code to
convert request parameters by hand, e.g.

try
{
return new String(inParam.getBytes(8859_1), encoding);
}
catch (UnsupportedEncodingException e) 
{
return inParam;
}

... but this implies that you know the character encoding. Until Servlet 2.3
is standard, you can't just say request.setEncoding ().

So: how to do this in Struts? Ultimately, what I need is my form beans to
have their Strings set properly.

I can think of a few ways.

(1) Let the form bean handle it on set () methods for Strings. Every form
class could extend a base class with a decodeString (), and every form class
could call this method.

I'm not thrilled about this, since it'd be easy to forget and it's a lot of
extra coding on every set call.

(2) Modify Struts to do this automatically. This isn't trivial, since the
calls to populate beans 
are buried pretty deeply in ActionServlet, RequestUtils, and BeanUtils. 

In either case, the handler (whether Struts utils or the beans themselves)
would need to know the encoding to use! The best I can come up with is that
every form would embed a hidden parameter encoding -- this is how iPlanet
handles this, they have a j_encoding parameter on forms which tells the
handler how to decode params. (I could modify html:form to do this
automatically, too ...)

Thoughts?

Thanks,
Ben




RE: OFFTOPIC: Solaris and Tomcat problems!

2001-07-02 Thread Ben Flaumenhaft


Mikkel,

Here's a bit of a hack solution, but ... have you tried to use Jikes as your
JSP compiler?

Regards,
Ben Flaumenhaft - [EMAIL PROTECTED]
Principal, Sidelight Consulting
http://www.sidelight.com

 -Original Message-
 From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 02, 2001 12:10 PM
 To: '[EMAIL PROTECTED] '
 Subject: OFFTOPIC: Solaris and Tomcat problems!
 
 
 This has nothing to do with struts, but I know this list has 
 a couple of
 guru's and demigods lurking...
 
 I have just installed solaris 8 on an intel machine.
 I installed tomcat 3.2.2 and it runs the servlets examples without any
 problems...BUT
 There seems to be a problem running the jsp files...
 Whenever i request a jsp file it just freezes, and i get no respond...
 Looking into the matter I saw that the jsp was succesfully 
 compiled to a
 .java file...BUT
 The jsp compiler seems to be endlessly looping in the 
 translation, because
 it keeps writing the same line over and over again (until im 
 out of disk
 space)...
 I looked into the tomcat mailling archives and saw that somebod had
 experienced this problem before, but I wasnt able to find a 
 solution...
 
 Any suggestions
 
 thanks in advance...
 
 Mikkel