Re: What was the name of this application? [was] Re: Are there any IDE's that understand Struts tags?

2004-05-28 Thread bOOyah
Rick Reumann wrote:
Actually there was a struts application/IDE  that was for demo that was 
quite impressive but now I forgot the name. 
Was it NitroX from M7?  http://www.m7.com/
The pricetag isn't *that* hefty.
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Are there any IDE's that understand Struts tags?

2004-05-27 Thread bOOyah
Mike Duffy wrote:

I've looked at some of the current Struts design tools and they
appear to be over-glorified config file editors.  I think there is an
opportunity for some of these small companies who wish to play in the
IDE space to create a JSP editor plugin for Eclipse that supports
both Struts and JSTL. I'd pay real money for such a plugin.
Have you taken a look at this?
http://www.demosondemand.com/clients/m7/001/page/demo.asp
(Check out the long version).
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Selects

2004-05-14 Thread bOOyah
Jonathan Wright wrote:

Can anyone see anything wrong with the following select and option tags? I
cannot fathom out why I keep getting an exception thrown in the
BodyContent.clearBody method.
This does not work:
html:select property=location  html:option value=Select
OneSelect One/html:option  html:option
value=AucklandAuckland/html:option  html:option
value=ChristchurchChristchurch/html:option   html:option
value=DunedinDunedin/html:option  html:option
value=GisborneGisborne/html:option   html:option
value=HamiltonHamilton/html:option  html:option
value=HastingsHastings/html:option   html:option
value=InvercargillInvercargill/html:option  html:option
value=NapierNapier/html:option   html:option
value=NelsonNelson/html:option  html:option value=New
PlymouthNew Plymouth/html:option  html:option value=Palmerston
NorthPalmerston North/html:option   html:option
value=RotoruaRotorua/html:option  html:option
value=TaurangaTauranga/html:option   html:option
value=WanganuiWanganui/html:option  html:option
value=WellingtonWellington/html:option   html:option
value=WhangareiWhangarei/html:option  html:option
value=OtherOther/html:option/html:select
The only way I can get the page to work at runtime with the select tag
included is to do the following:
html:select property=location/html:select
Even a single white space in the body causes the page to fail, e.g.
html:select property=location /html:select
Any help would be most appreciated!
Hi Jonathan

I copied and pasted your non-working example into my JSP, and added a 
'location' property to my form bean (which I defaulted to Christchurch 
in struts-config.xml) and it worked a treat.  No exceptions.

I'm using vanilla Struts 1.1 and JBoss 3.2.3 + Tomcat 4.

Regards,
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] Any ideas for time-limiting demo web apps?

2004-05-11 Thread bOOyah
Jesse Alexander (KXT) wrote:
use a certificate. validation of valid-timerange is almost free.
And that's what I decided to do.

I get a cert from a keystore and check its validity.  I catch 
'CertificateExpiredException' and 'CertificateNotYetValidException' and 
output error messages accordingly.


hope this gives some ideas
Yes, it did.  Many thanks Jesse.  It was really easy in the end 
(especially since my requirements were lightweight).

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to use resource bundle in attributes

2004-05-03 Thread bOOyah
Ralf Schneider wrote:

how can a use internationalized text strings stored in a resource bundle as 
values of attributes?

html:text property=username title=login.tooltip.username/
Hi Ralf

Have you tried

html:text property=username titleKey=login.tooltip.username/

I use the 'titleKey' attribute like this on 'html:submit' buttons.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-23 Thread bOOyah
Takhar, Sandeep wrote:

Craig McLanahan wrote something about this recently.

I may be wrong since I haven't done this, but you may need '' quotes around the property since there are '.'s in it.
No Sandeep, wrapping single quotes around the property didn't seem to 
make any difference.  Not even wrapping the single quotes in double 
quotes ;-)  Niall's suggestion worked well though.

Thanks anyway.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to forward from one LookupDispatchAction to another LDA

2004-04-23 Thread bOOyah
Riyad Kalla wrote:

UPDATE:
Upgraded my Struts install to nightly build and now the code snippet 
below works. I'm still curious if anyone knows how one LDA can forward 
to another (or the same) LDA, even if it takes manually setting the 
parameter value (how?)
snip /

protected ActionForward unspecified(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception
  {
  return showList(mapping, form, request, response);
  }
I have also used this in the past, but without execution errors (I'm 
using Struts 1.1 stable).  But as you've rightly spotted, you are 
limited to only being able to forward to another method in the same Action.

I, too, felt this was an 'ugly' solution because the Struts Controller 
is bypassed and you cannot change your mind about unchaining those 
actions without editing Java.  I read somewhere authoritative that 
ActionForward was created for just this purpose; you chain the actions 
in the Struts config file instead.

However, chaining actions programmatically could be a perfectly valid 
thing to do though...I've only been using Struts for three months ;-)

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to forward from one LookupDispatchAction to another LDA

2004-04-23 Thread bOOyah
Riyad Kalla wrote:

booya I really appreciate the code snippets and explination! I hadn't gotten 
involved in ActionForwards and appreciate you shedding light on the situation 
for me.
No problems Riyad!  I'm glad to give back to this list after sucking it 
dry for three months ;-)

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[VERY OT] Wireless Mice...what gives??

2004-04-23 Thread bOOyah
It's Friday.

I need to buy a replacement for my borked Intellimouse Explorer.  It's 
starting to issue double-click events, which is pretty disconcerting. 
At least, I _hope_ it's my mouse, otherwise my RSI has taken a nasty 
turn for the worse.

I'm a fan of Microsoft's mice because the devices in its Explorer range 
are nice and big, just like my hands (Logitech's rodents tend to be 
smaller).  But nearly all the Microsoft mice available on Amazon.co.uk 
are wireless.  Ditto for my other favourite site, dabs.co.uk.  A quick 
excursion to Microsoft's corporate Mouse site reveals that, yes indeed, 
all the latest Explorer mice are wireless.

Despite finding the concept of an stationary, yet wireless device deeply 
crazy, I might just buy a wireless mouse and have done with it...life's 
just too short.  But I think having to replace batteries every 6 months 
would get right on my nerves.

Any opinions?  Does replacing the batteries in your wireless mouse or 
keyboard drive you nuts?  Are there real advantages to using a wireless 
input device that I just cannot see?

Trivially yours,
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread bOOyah
Barett McGavock wrote:

I agree with you 100% and share your concerns about the wireless mice. I am
shopping for a non-wireless mouse for myself, as well. I'm looking at
products in stores from both Microsoft and Logitech that are not wireless. I
presume that these are not the newest-out products.
Let me know how you go Barett.  At worst I could buy another 
Intellimouse Explorer, but I'd like to inflict something new on my 
carpal tunnel.

One time before, I opted for a flashy Logitech.  But it was so small I 
had to operate it using tweezers.  Amazon must have taken its picture 
with an electron microscope.

--
Sean
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread bOOyah
Riyad Kalla wrote:

Power User w.r.t. to mice gives me a mental image of someone grunting and 
sweating while muscling their mouse around their desk... 
That would be Steve Ballmer.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [VERY OT] Wireless Mice...what gives??

2004-04-23 Thread bOOyah
Neale, Bennett wrote:

I have the wireless bluetooth mouse from M$.
It's cool for me because I have it hooked up to my pc at work and on my 
laptop at home. The thing that sucks is exactly what you hit on, the 
batteries. I've never owned a wireless mouse before but if I could get 6
months out of the batteries I'd be happy. On average for me they run out
about every 6 weeks.
And bluetooth is generally pretty easy on power requirements.  Are you a 
gamer perchance?  I used to need a new mouse every few months when 
Tribes was de rigeur.
--
bOOyah

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


ActionErrors in my JSP: how can I rewrite this RT snippet as EL?

2004-04-21 Thread bOOyah
Hi

I'm displaying validate() ActionErrors in my JSP using the RT 
html:errors tag.  But I can't seem to be able to successfully rewrite my 
snippet of Struts RT in EL.

This works:

  %@ page import=org.apache.struts.Globals%
  %@ page import=org.apache.struts.action.ActionMessages%
  ...
  logic-rt:present name=%=Globals.ERROR_KEY%
html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/
  /logic-rt:present
But this doesn't work (using the logic  html EL taglibs):

  %@ page import=org.apache.struts.Globals%
  %@ page import=org.apache.struts.action.ActionMessages%
  ...
  logic:present name=org.apache.struts.Globals.ERROR_KEY
html:errors
property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/
  /logic:present


Can anyone help?

Thanks
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


html:error and quotation marks...

2004-04-20 Thread bOOyah
Howdy all

I'm using html:error to put an error message next to a form field that 
must not be blank.  But the message is rendered with quotation marks 
around it.  I don't want quotation marks.  Am I doing something I 
shouldn't, or is there any way to turn this behavior off?

My JSP looks like this:

thead
  thhtml:text name=myName property=name size=40//th
  thhtml:errors property=myName //th
/thead
The resulting HTML looks like this:

thead
  thinput type=text name=name size=40 value=/th
  thThe 'Name' field is required/th
/thead
My Form.validate()
==
ActionErrors errors = new ActionErrors();
if (getMyName() == null || getMyName().length  1) {
errors.add(myName, new ActionError(err.name.required, Name);
}
return errors;
My Application.Properties file
==
err.name.required=The '{0}' field is required
Thanks
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:error and quotation marks...

2004-04-20 Thread bOOyah
Henrique VIECILI wrote:

have you tried changing your ApplicationResources to
err.name.required=The {0} field is required (whitout the quotes') ?
Sorry Henrique...it was my own stupidity all along.  My app was using an 
old Application.properties file that had my message enclosed in 
quotation marks, but I was editing a new one by mistake.  DOH!

Thanks anyway.  And those single quote marks don't cause any problems. 
They work as expected so I left them in.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


How can I concatenate bean properties in html:optionsCollection output?

2004-04-13 Thread bOOyah
Hi again

I'm doing this:

  html:select property=selectedIdHubChannel
html:optionsCollection property=myProps
value=propId
label=propValue/
  /html:select
I'd like the label string to be a concatenation of the value plus the 
label attribute.  Sort of like this:

html:optionsCollection property=myProp
value=propId
label=propId:propValue/
Is there a Struts tag I can use, or do I have to doctor the beans in the 
underlying options collection?

Thanks.
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Q: Translating i18n keys in Struts?

2004-04-12 Thread bOOyah
Hi

I want to use 'html:select' and 'html:optionsCollection' to draw menus 
on my page.

I'm thinking of filling my collection of menu strings with i18n keys 
that correspond to string properties in my various resource bundles.  So

menuList[0] = menu.item.search
menuList[1] = menu.item.about
...
and so on.
Is there a neat Struts way of translating these keys to actual 
locale-specific strings on their way to the JSP, or even in the JSP 
itself?  Or do I have to write my own helper methods in my Action classes?

Thanks.
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-10 Thread bOOyah
Joe Hertz wrote:
The old 'alternating-table-row-color' trick.
No doubt there's a better way of doing that too.


Thought about using the one minus 1|0 trick? 

Initialize some int to 1 or 0:

int index = 0;

Then in your loop do:

index = 1 - index;

And set the color based upon some two element array based on index:

color = colorArray[index];
I like that.  Nice.

Thanks for the reply Joe.
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [slightly OT] Any advice for 'jsp.error.useBean.duplicate' ?

2004-04-09 Thread bOOyah
Curtis Taylor wrote:

You're creating the bean status in the varStatus declaration in your 
c:forEach action. It's in scope in the loop as status already, so you 
don't need to re-initialize it. You can access its attributes inside 
your loop:

c:out value=$status.begin /
c:out value=$status.count /
c:out value=$status.index /
...etc.
*sigh*  You are, of course, correct.  I could have sworn I tried that. 
I certainly swore.

Just curious; what're you trying to do inside the loop?
The old 'alternating-table-row-color' trick.

c:forEach items=${ScheduleDetailsForm.eventsList}
var=event
varStatus=status
  c:choose
c:when test=${status.count%2 == 0}
  %-- set style for EVEN rows --%
  c:otherwise
  %-- set style for ODD rows --%
  /c:choose
/c:forEach

No doubt there's a better way of doing that too.

Many thanks Curtis.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How can I display a table in two columns?

2004-04-07 Thread bOOyah
Daniel Perry wrote:
This works ok for that scenario, but what about if you need each item out of
the list? eg, to iterate through a list of names:
logic:iterate name=names id=name
trtdbean:write name=name//td/tr
/logic:iterate
Gives one column

trtdname1/td/tr
trtdname2/td/tr
trtdname3/td/tr
trtdname4/td/tr
Is there an easy way to get:

trtdname1/tdtdname2/td/tr
trtdname3/tdtdname4/td/tr
The best I can come up with (shooting from the hip) is to create an 
intermediate bean which contains two properties, the column-1 value and 
the column-2 value.  Populate each bean, put them in a list, then 
iterate over that list.  Something like this:


List names = new ArrayList();
int i = 1;
while (i=numItems) {
TwoColBean b = new TwoColBean();
b.setCol1(name + i++);
b.setCol1(name + i++);
this.names.add(b);
}
...
c:forEach items=${names} var=name 
  tr
tdc:out value=${name.col1}//td
tdc:out value=${name.col2}//td
  /tr
/c:forEach

Surely there must be a tag lib somewhere that offers this?

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AW: Field types in ActionForm/DynaForm

2004-04-07 Thread bOOyah
Andreas Solarik wrote:

Hi Stjepan,

From what I understand, you will have a much easier time implementing
validation for your forms if you use only strings. For example, receiving an
integer value ABCDEFG might cause unexpected results.
This is just my understanding. If theres more to it, them I'm happy to learn
:)
That is my understanding too.

A simple example:

Imagine your form models a personnel record.

You have a field to hold an employee's Age.  Being a clever Struts 
designer you add a String (not an Integer) property to the Struts form 
bean to hold the employee's Age.

You have Struts Validation enabled.

If someone types QWERTY into that Age field on the HTML form, your 
Struts validation checks can trap it and the form will be forwarded back 
to the user with (perhaps) the Age field showing QWERTY, highlighted 
with a QWERTY is not a valid Age error message.

But: if that property had been modeled originally as an Integer, then 
QWERTY would never make it into the form bean (because QWERTY cannot 
be converted to an Integer).  Which in turn means that when the form is 
re-displayed to show the user's error, the string QWERTY will not be 
seen in the Age field; the field would be empty.

Read-write Integer properties on form beans will work great until users 
enter bad data.  Read-only properties are unaffected of course.

I think I got that about right.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


How can I display a table in two columns?

2004-04-06 Thread bOOyah
Hi all

I have a 2-column table containing 16 row items, each with an associated 
checkbox.  Right now I'm iterating over a List to render each row of the 
table.  Column 1 contains the checkboxes; column 2 contains the items.

So my table currently looks like this (x == a checkbox):

x item-1
x item-2
. . .
x item-16
Is there a straightforward way to iterate my List so as to render my 
table as two columns (four columns really) of 8 rows each?   Like this:

x item-1x item-9
x item-2x item-10
. . .   . . .
x item-8x item-16
Thanks!
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How can I display a table in two columns?

2004-04-06 Thread bOOyah
Axel Stahlhut wrote:

snip/

Is there a straightforward way to iterate my List so as to render my 
table as two columns (four columns really) of 8 rows each?   Like this:

x item-1x item-9
x item-2x item-10
. . .   . . .
x item-8x item-16
There are a lot of ways to reach what you need, but the following is the 
nicest, I think:

table
logic:iterate: name=myBean property=listProperty index=id
trtd
   html:checkbox name=... value=%=whateverValue%/
/tdtd
   html:checkbox name=... value =%=whateverValue+8% /
/td/tr
/logic:iterate
table
Thanks Axel.  That would probably work fine.  My list is always a fixed 
size, but with variable content.

By the way, what is the submitted value of the cb? Is it the index or 
some other kind of id?
The multibox values are actually IDs; database primary keys as it happens.

Thanks again!
--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem with custom ActionMapping and set-property ... /

2004-04-06 Thread bOOyah
chris wrote:

snip-o-la /

MUST NOT

implement a public boolean is{ParamName}() method
- doing so will prohibit the set{ParamName} method's invocation via the 
set-property ...
Worked that out the hard way myself two days ago. I thought the 
convention was to name the getter for a boolean 'isFlag()'.  But not on 
Planet Struts.  After blubbing like a stuck pig for an hour I finally 
stabbed in the dark and named my getter 'getFlag()'.  Presto-hey!  It 
all worked.

Frameworks...you gotta love 'em.

--
bOOyah
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Losing my mind: why can't my JSP use the getter on my form bean??

2004-03-29 Thread bOOyah
Hi guys

I've got a simple form bean and a simpler JSP.  I can get the JSP to 
pull some values from the form bean but not others, and I cannot figure 
out why.

I want to display Select menus in a variable number of rows.  I managed 
to figure out indexed properties (at loong last) and so the 
html:select tags are working.  It's just the html:optionsCollection tag 
that I can't figure out.

Here's the Form (trimmed for brevity; the two private members are 
populated okay by other methods):
8-
public class MyForm extends ActionForm
{
  private Integer selectedIdTvSystem[];
  private List picklistTvSystem;

  // return the user's previously selected TV system
  public Integer getSelectedIdTvSystem(int loopIndex) {
...
  }
  // set the user's newly selected TV system
  public void setSelectedIdTvSystem(int loopIndex, Integer selectedId) {
...
  }
  // get the drop-down list of TV choices for the user
  public List getPicklistTvSystem() {
return this.picklistTvSystem;
  }
  // set the list of possible TV choices for the user
  public void setPicklistTvSystem(List picklistTvSystem) {
this.picklistTvSystem = picklistTvSystem;
  }
}
8-
Here's the JSP tester.  It's a Mickey Mouse loop to display two 
drop-down picklists.  The indexed property referenced in the 
'html:select' seems to work fine.  But the 'html:optionsCollection' tag 
isn't finding the 'picklistTvSystem' property on the form.

8-
c:forEach begin=0 end=1 varStatus=status
  jsp:useBean id=status
   type=javax.servlet.jsp.jstl.core.LoopTagStatus/
  html:select property=selectedIdTvSystem[${status.count - 1}] 

html:optionsCollection name=picklistTvSystem
value=id
label=value /
  /html:select
/c:forEach
8-
Tomcat throws this exception:
javax.servlet.jsp.JspException: Cannot find bean picklistTvSystem in
any scope
at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
Any help will be gratefully received.
--
Sean.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Losing my mind: why can't my JSP use the getter on my form bean??

2004-03-29 Thread bOOyah
bOOyah wrote:

html:optionsCollection name=picklistTvSystem
value=id
label=value /
For crying out loud.  No sooner had I clicked the 'Send' button on my 
mailer when I spotted the bug.  For those few of you still wiping the 
tears from your eyes, the 'name' attribute above should, of course, have 
been 'property'.

I've been staring at that little time sink all day.

--
Sean.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]