RE: non-ascii characters

2004-03-16 Thread Daniel Lipofsky
> I have a database with ISO 3166 country > names and codes that I use to populate an html:select. There > is one country in the list that contains a non-ascii > character and I want to make sure it shows up properly. That > country is listed in HTML as ÅLAND ISLANDS > > I have two questions re

RE: a security framework!

2004-03-11 Thread Daniel Lipofsky
I did something similar. I extended each struts HTML tag to take a rule and evaluate it in doStartTag. It then returns SKIP_BODY to hide it or super.doStartTag() to show it. Similarly doEndTag() returns EVAL_PAGE to hide it or super.doEndTag() to show it. I actually have 3 security levels and I

expanding <%=...%>

2004-02-24 Thread Daniel Lipofsky
In the JSP below, <%=p1%> will expand the way I expect. But <%=p2> does not. Does anyone know why and how to fix it? Using HTML-EL is not a good option because my real case uses custom tags that extend the HTML taglib. <%@ taglib uri="struts-html" prefix="html" %> <% String foobar = "FooBar",

RE: Mroe then one resource message file

2004-02-19 Thread Daniel Lipofsky
See http://www.systemmobile.com/articles/strutsMessageResources.html > Does anybody know of a way to define more than one default > message resources in struts 1.1. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

iterate over list of maps

2004-02-06 Thread Daniel Lipofsky
I want to iterate over a list where each object in the list is a map, and print values from the map. The problem, of course, is Map is not a bean - no getters and setters. Do I have to wrap each map in a bean, or is there a more clever approach. (I am pretty much stuck with list:iterate, not c:fo

RE: bean:write question

2004-01-26 Thread Daniel Lipofsky
Or replacing all newlines with "". Either should work, but might look nicer. This is not a struts issue ... just a basic fact of how HTML works. - Dan > -Original Message- > From: Hien Q Nguyen [mailto:[EMAIL PROTECTED] > Sent: Saturday, January 24, 2004 4:30 PM > To: Struts Users Mailin

RE: bean:write and apostrophes

2004-01-22 Thread Daniel Lipofsky
iling List' > Subject: RE: bean:write and apostrophes > > > Dan, > Try using the filter="false" attribute of the bean:write tag. > That will > disable the encoding of characters that are sensitive to HTML. > > > -Richard > > -Origi

bean:write and apostrophes

2004-01-22 Thread Daniel Lipofsky
If I use to write out the value "Dan's Test" I get "Dan's". But this is giving me problems with Javascript. THIS FAILS: Dan's Test BUT THIS WORKS: Dan's Test But I don't know how to get the second form. I can reverse the single quotes and double quotes in javascript - then it works for the tes

RE: How to retreive ApplicationResources properties ?

2004-01-22 Thread Daniel Lipofsky
See http://www.systemmobile.com/articles/strutsMessageResources.html In an Actions you can get the resource bundle like getResources(HttpServletRequest request) Inside taglib code you can do RequestUtils.message(pageContext, bundle, locale, key); - Dan > -Original Message- > From: AMI

RE: editor

2004-01-22 Thread Daniel Lipofsky
Maybe you want a beautifier rtaher than an editor? Like tidy: http://tidy.sourceforge.net/ It works for HTML and XML. I haven't tried using it for JSPs but I see some mention of it in the discussion group. - Dan > -Original Message- > From: dirk [mailto:[EMAIL PROTECTED] > Sent: Thursday,

RE: Handling Missing Message Key

2004-01-07 Thread Daniel Lipofsky
I would suggest you extend PropertyMessageResources. Overide constructor so that returnNull=true always. Override getMessage to call super.getMessage(), check for null, if null return key. Very simple. You probably have to extend the factory too. - Dan > -Original Message- > From: Brian

RE: html:select example

2003-12-30 Thread Daniel Lipofsky
> Would someone show me a very simple example of the use of an > html:select tag? I did not understand its use. > > I'd appreciate any simple example. The select tag can contain a list of option tags, or an options or optionsCollection tag or any combination. Here I use 1 option tag to

RE: Easy question: iterate

2003-12-24 Thread Daniel Lipofsky
<% LabelValueBean[] lvArray = new LabelValueBean[] { new LabelValueBean("label1", "value1"), new LabelValueBean("label2", "value2"), new LabelValueBean("label3", "value3"), new LabelValueBean("label4", "value4") }; request.setAttribute("lvArray", lvArray); %>

RE: Select without selected value

2003-12-24 Thread Daniel Lipofsky
Or you can override the form value like this If the value you set doesn't exist then nothing will be selected. Which means the first item will be selected, because something always is (if we are talking about a dropdown and not a multiselect). But you can always add a blank first item like this

RE: problem

2003-12-24 Thread Daniel Lipofsky
If I am understanding correctly you just want which will pull the value from the "name" property of the bean. If you specify a value in the tag it oiverrides what is in the bean. - Dan > I want to use an update user details page in my application > which uses a > form to display the current user

RE: [OT] Date Problem

2003-12-19 Thread Daniel Lipofsky
Try java.sql.Timestamp. RTFM for the differences between Date, Time, and Timestamp. - Dan > -Original Message- > From: Raj Yadav [mailto:[EMAIL PROTECTED] > Sent: Friday, December 19, 2003 3:42 PM > To: [EMAIL PROTECTED] > Subject: [OT] Date Problem > > > Hi All, > > I have date

RE: [OT] HTML Select box

2003-12-19 Thread Daniel Lipofsky
I agree. I think it would be bizarre and confusing to the user to try and select many things from a dropdown. Nobody does this. Maybe you want to use a popup (DHTML or separate window) if you really need to save real estate. Otherwise use a multiselect with multiple lines. - Dan > From a GUI

RE: Drop Down - Code and Description

2003-12-11 Thread Daniel Lipofsky
In the setDescription pass a string which includes both code and description call. Or if you don't want to change that object just create a list of LabelValueBean objects which has the right content. or use TEXT TO BE DISPLAYED HERE ... ... - Dan > Wit, > > My baseAbstractVO

RE: getting the form name

2003-12-09 Thread Daniel Lipofsky
There are 2 ways, and I did both, just to be anal and because I didn't know which was best. FormTag form = (FormTag) pageContext. getAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE); if (form == null) form = (FormTag) findAncestorWithClass(this, FormTag.class); if (form

RE: using ApplicationResources in jsp...

2003-12-05 Thread Daniel Lipofsky
Struts has a class called RequestUtils and you can call RequestUtils.message(pageContext, bundle, locale, key); But maybe you should be creating your array in the Action and passing storing it in the Form for the JSP to grab. Then you can get messages in an action like this: // default bundle

RE: Log4j with Struts

2003-12-05 Thread Daniel Lipofsky
> > String str = new String(LogonAction.class.getName()); > This is completely off-topic, but using new String(String) is almost always wasteful. Strings are immutable, so there is no need to copy them. - Dan - T

RE: optionsCollection with another default value

2003-11-24 Thread Daniel Lipofsky
Use one tag followed by the tag. - Dan > -Original Message- > From: Frank Schaare [mailto:[EMAIL PROTECTED] > Sent: Monday, November 24, 2003 3:15 AM > > Hallo, > > i´ve made a select from an optionsCollection Tag. The values are read > from a hashmap like > value1 = one > value2 = t

RE: Generate a Drop-Down ???

2003-11-14 Thread Daniel Lipofsky
If I understand your question you are just looking for - Dan > I put the bean on the method execute on myAction > > ArrayList formatosArquivos = new ArrayList(); > > formatosArquivos.add("CSV"); > > formatosArquivos.add("XML"); > > formatosArquivos.add("Algorithmics"); > > ProdutoView pr

tag body output

2003-11-13 Thread Daniel Lipofsky
(this is really a taglib question, not struts, so my apology for being off-topic) I am designing a security tag which shows or nukes its body depending on the user. I got it to work, although I have a question as to why the simplier code didn't work. I am just learning and I want to understand.

RE: Need a RegExp mask for: all charactors except for "\", "/" and "?"

2003-11-12 Thread Daniel Lipofsky
Do this [^\\/?] (one char) [^\\/?]* (zero or more chars) Also if in a java string don't forget to escape the backslashes again like "[^/?]*" - Dan > From: Saul Q Yuan [mailto:[EMAIL PROTECTED] > > Try this, > > ^[\\|\/|\?] > > or (^[\\|\/|\?])* for 0 or more matches > > From: Kevin W

logging MessageResource requests by page

2003-11-11 Thread Daniel Lipofsky
I am wanting to do some special logging of MessageResource requests based on what page the user makes the request from. I looked at subclassing MessageResources and MessageResourcesFactory - but it looks like that won't work because in the MessageResources class you don't have a way to access Page