Re: Using static ints as values in html:submit

2001-10-20 Thread emmanuel.boudrant

 Am I only allowed to use bean variables that have
 get and set methods?
 

No, You must do:


html:submit property=submit value=%= (String)
ButtonNames.SEARCH %

   html:submit property=submit value=%=
 ButtonNames.SEARCH
 %
 
 Where ButtonNames is an interface and SEARCH is a
 public static final
 int.
 
 When I try to compile this jsp, I get:
 
   method setValue(int) not found in class
 org.apache.struts.taglib.html.SubmitTag at ...
 
 Am I only allowed to use bean variables that have
 get and set methods?
 
 Thanks,
 
 Tony
  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr



Help Need for Array Qn in FormBean

2001-10-20 Thread Tricia Ong Cheah Yen

I have an Array in a formBean. I want to update display information
about each object (of class bcSortiRecord) contained in the array list
and also that the user can modify some fields of the same object.

My problem is that, when I submit the form, I get nothing in the Array.
Anyone got any ideas?

here's my JSP:
logic:iterate id=titleField name=newsletterForm property=titles
TR VALIGN=top
TD CLASS=contentheader VALIGN=top WIDTH=7%bean:message
key=prompt.newsletter.title/ %=fieldCount%: /TD
TD WIDTH=25%html:textarea name=newsletterForm
property=titles cols=25 rows=4 indexed=true//TD
/TR
/logic:iterate

in the NewsletterFormBean
=
protected String[] titles = new String [8];
public String[] getTitles() {
return this.titles;
}

public void setTitles(String[] inTitles) {
this.titles = inTitles;
}

in the Action class
=
String tempArray[] = aNewsletterForm.getTitles();
ejbBean.setContent(tempArray);



How to Auto Reload Page on Client Side

2001-10-20 Thread L. Yeung

How can I force an auto reload on the client side when
I move my focus to another control? Mozilla and
Netscape 6.1 does not seem to refresh the values found
in my text fields, except that the progress bar does
animate. IE 5.x did just fine. Is this a bug?

SCRIPT LANGUAGE=JavaScript1.2
function query() {
history.go(0)
}
/SCRIPT

Thanks in advance.
L. Yeung

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



How to Auto Reload Page on Client Side

2001-10-20 Thread L. Yeung

How can I force an auto reload on the client side when
I move my focus to another control? Mozilla and
Netscape 6.1 does not seem to refresh the values found
in my text fields, except that the progress bar does
animate. IE 5.x did just fine. Is this a bug?

SCRIPT LANGUAGE=JavaScript1.2
function query() {
history.go(0)
}
/SCRIPT

Thanks in advance.
L. Yeung

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



errors not clearing when hitting BACK

2001-10-20 Thread Rob Breeds

Hi

I have a simple input form, an ActionForm, and validating set to true.

In the validate() method of ActionForm I check the length of the input
field (say max 5 chars) and if too long populate the errors collection.

The error message correctly displays if I enter a name longer than 5 chars.

If I then enter a valid length name, I get the forwarded page saying
Success - so far so good.

But if I now click the browser BACK button I get the input form displayed
(correct), with the input field containing the correct length input value
(correct) but with the error message saying name too long, which is wrong.

I have a reset() method in my ActionForm setting the name value to null but
this has no effect.

Any ideas please on how to prevent the error message(s) displaying when the
page is displayed after hitting back button?

Thank you

Rob Breeds





Problem populating form bean with multiple parameters of same name

2001-10-20 Thread Steven Valin

Does anybody know how Struts be made to populate an ActionForm bean with
a variable number of text input fields that all have the same name?

For instance, there may be 0, 1, 5, 10, or any other number of
html:text property=propertyName size=20/ tags in an html:form.

I want Struts to populate the ActionForm bean with all of the
propertyName values, either one at a time via multiple calls to the
ActionForm's setPropertyName(String propertyName) method, or all at once
in an array (or other data structure) much like would be accomplished
with the ServletRequest.getParameterValues(propertyName) method.

I have tried to accomplish this any number of ways but have been
unsuccessful and haven't seen anything in the documentation explaining
how this should be done.

TIA, Steve

--
Steven Valin
[EMAIL PROTECTED]





OT: Good secure-ID solution? (Key FOB)

2001-10-20 Thread Bryan Field-Elliot




Hi,



I apologize for this being off topic, but while this has nothing to do with Struts, still I think this is a list where I might find knowledgable people with good info.



I'm looking for a good, cheap secure ID card or ID KeyFob solution, which I can integrate with my Struts application.



The device(s) are just cards or keychain devices, with an LCD display. The LCD display shows a 8-digit number, and this number changes to some other pseudo-random value every 60 seconds. It's a password, good for one minute. On the server side, you've got some code running which maps a username to a 60-second password (algorithmically), and authenticates the user thus.



RSA has great devices, and they're around $60 each which is fine with me. However, they want you to buy and run their server-side software as well. I'm not into that -- I'd just rather have a simple standardized algorithm and implement my own server-side checking (tied into my own database etc) within my Servlet classes, rather than run some 3rd party software on my server.



Does anyone know of such a thing?



Thanks,



Bryan












RE: Good secure-ID solution? (Key FOB)

2001-10-20 Thread David Bolsover



Hi

You 
might take a look at Microchip products www.microchip.com - secure data 
products

David

David 
BolsoverT:+44(0)1614276920F:+44(0)1614276922M:07773428118E:[EMAIL PROTECTED] 


  -Original Message-From: Bryan Field-Elliot 
  [mailto:[EMAIL PROTECTED]]Sent: 20 October 2001 
  15:07To: [EMAIL PROTECTED]Subject: OT: Good 
  secure-ID solution? (Key FOB)Hi, I apologize for 
  this being off topic, but while this has nothing to do with Struts, still I 
  think this is a list where I might find knowledgable people with good info. 
  I'm looking for a good, cheap secure ID card or ID KeyFob solution, 
  which I can integrate with my Struts application. The device(s) are 
  just cards or keychain devices, with an LCD display. The LCD display shows a 
  8-digit number, and this number changes to some other pseudo-random value 
  every 60 seconds. It's a password, good for one minute. On the server side, 
  you've got some code running which maps a username to a 60-second password 
  (algorithmically), and authenticates the user thus. RSA has great 
  devices, and they're around $60 each which is fine with me. However, they want 
  you to buy and run their server-side software as well. I'm not into that -- 
  I'd just rather have a simple standardized algorithm and implement my own 
  server-side checking (tied into my own database etc) within my Servlet 
  classes, rather than run some 3rd party software on my server. Does 
  anyone know of such a thing? Thanks, Bryan 



GLOBAL FORWARDS

2001-10-20 Thread chiji nwankwo



Hi,
Can anyone see what I am doing wrong?
forward name="viewClipStreamHigh" path="/do/search?action=ViewClipstreamMode=High" /
Application developer (ibm) seems to be complaining about the use of a delimiter. This is taken from within my strut-config file and I have an action called search.
Is it wrong to use more than one parameter. It doesn't seem to complain when I use just one parameter.
Please helpThanks
Chiji
Get your FREE download of MSN Explorer at http://explorer.msn.com

Hi,
Can anyone see what I am doing wrong?
forward name="viewClipStreamHigh" path="/do/search?action=ViewClipstreamMode=High" /
Application developer (ibm) seems to be complaining about the use of a delimiter. This is taken from within my strut-config file and I have an action called search.
Is it wrong to use more than one parameter. It doesn't seem to complain when I use just one parameter.
Please helpThanks
ChijiGet your FREE download of MSN Explorer at http://explorer.msn.com




Re: Tiles - Dynamic menu creation - logic problems

2001-10-20 Thread iT meDic

Hi Cedric

Thanks a million, code works like a charm, my logic was a little off, you 
have clarified it wonderfully.



From: Cedric Dumoulin [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Tiles - Dynamic menu creation - logic problems
Date: Fri, 19 Oct 2001 12:14:01 +0200


   Hello,

   There is some mismatch in your code ;-)

   First, in your insert, you put several time an attribute using the 
same name
(linknormal). Each addition overload previous value, so only the last value
remains.
   Second, in your submenu.jsp, you iterate on both lists, but you do logic 
on
external beans, not on bean resulting from iteration.
   Such external beans (novalue, linkbold, linknormal) exist because you 
have
imported them from tiles attribute list, and  put them in attribute list 
from
insert.

   Personally, I would create a third list, holding flags like bold, link,
separator, ... Such flags indicate what I would like to do with an item.
   In submenu.jsp, I would iterate also on third list to check flag values, 
and
do appropriate output.
 I have put the proposed code at the end. I haven't check it, so some 
typo
error may remain. Let us know if it works for you.

   I am currently working on a new Tiles feature that will simplify such
construct. The idea is to allow to put or add a bean. You specify bean
class, and properties values. In your case, there will be 3 properties 
(item,
link, flag). For other menus, there could  also have (img, tooltips, ...).
Menu.jsp will be also simplified because you will iterate on only one list.
Logic will apply on each iterated bean properties.


 Cedric

   Proposed code for insert looks like :

%@ taglib uri=/WEB-INF/tiles.tld prefix=comp %
comp:insert page=/hfa/common/submenu.jsp flush=true

comp:put name=title value=submenu /

comp:putList name=items 
comp:add value=Create /
comp:add value=Search /
comp:add value=Requests: /
comp:add value=Drafts /
comp:add value=In Process /
/comp:putList

comp:putList name=links 
   comp:add value=create.jsp /
   comp:add value=search.jsp /
   comp:add value= /
   comp:add value=drafts.jsp /
   comp:add value=inprocess.jsp /
/comp:putList

comp:putList name=flags 
   comp:add value=linkbold /
   comp:add value=linknormal /
   comp:add value=nolink /
   comp:add value=linknormal /
   comp:add value=linknormal /
/comp:putList

/comp:insert

Tile submenu.jsp will be :

%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/tiles.tld prefix=comp %
%@ page import=java.util.Iterator %

%-- Push Tiles attributes in page context --%
comp:importAttribute /

bean:define id=links  name=links type=java.util.List scope=page /
bean:define id=items name=items type=java.util.List scope=page /
% Iterator linksIterator = links.iterator(); %
% Iterator itemsIterator = items.iterator(); %

logic:iterate id=flag name=flags type=java.lang.String  
scope=page

% // Compute link value
 String link = (String)linksIterator.next();
 String item = (String)itemsIterator.next();
 %

logic:equal name=flag value=nolink
%=item%
/logic:equal

logic:equal name=flag value=linkbold
Ba href=%=link%%=item%/a/B
/logic:equal

logic:equal name=flag value=linknormal
a href=%=link%%=item%/a
/logic:equal

/logic:iterate



iT meDic wrote:

  Hello all , i have a problem on which i have been stuck for 3 days, i 
have
  asked numerous developers and worked on this problem for days but to no
  avail, i would be extremely grateful if you could advise me on how to
  overcome this monstrous beast!
 
  I am using the struts framework components to create a componentized
  submenu. I used the struts example(tiles) to build upon the submenu 
which is
  being generated dynamically using this file:-
 
  %@ taglib uri=/WEB-INF/tiles.tld prefix=comp %
  comp:insert page=/hfa/common/submenu.jsp flush=true
 
  comp:put name=title value=submenu /
 
  comp:putList name=items 
  comp:add value=Create /
  comp:add value=Search /
  comp:add value=Requests: /
  comp:add value=Drafts /
  comp:add value=In Process /
  /comp:putList
 
  comp:putList name=links 
  comp:add value=create.jsp /
  comp:add value=search.jsp /
  comp:add value=nolink /
  comp:add value=drafts.jsp /
  comp:add value=inprocess.jsp /
  /comp:putList
 
  comp:put name=novalue value=nolink /
  comp:put name=linkbold value=Create /
  comp:put name=linknormal value=Search /
  comp:put name=linknormal value=Drafts /
  comp:put name=linknormal value=In Process /
  /comp:insert
 
  The two lists are straight forward(one item and the other links), the 
issues
  i have are the following
 
  Basically i need to do three states. The first is to have a link which 
is
  bold(eg. create) the second state is to have nolink(eg Requests), and 
the
  third state is to have a normal link. I would like to represent all 
three
  states in one page. When i execute the page, for some reason i can get 

Re: GLOBAL FORWARDS

2001-10-20 Thread Renaud Waldura

Try using amp; instead of  in your path.

forward
name=viewClipStreamHigh
path=/do/search?action=ViewClipamp;streamMode=High /



- Original Message -
From: chiji nwankwo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 20, 2001 8:17 AM
Subject: GLOBAL FORWARDS


 Hi,

 Can anyone see what I am doing wrong?

 forward name=viewClipStreamHigh
path=/do/search?action=ViewClipstreamMode=High /

 Application developer (ibm) seems to be complaining about the use of a
delimiter.  This is taken from within my strut-config file and I have an
action called search.

 Is it wrong to use more than one parameter.  It doesn't seem to complain
when I use just one parameter.

 Please help

 Thanks

 Chiji






 --
--
 Get your FREE download of MSN Explorer at http://explorer.msn.com






Re: Problem populating form bean with multiple parameters of same name

2001-10-20 Thread Renaud Waldura

Have you tried declaring your property as an array of strings?

private String propertyName[];
public String[] getPropertyName() { ... }
public void setPropertyName(String[] propertyName) { ... }


It may just work. In general I've found Struts to be amazingly flexible with
properties and their types. Kudos to the Struts developers!

--Renaud




- Original Message -
From: Steven Valin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 20, 2001 6:01 AM
Subject: Problem populating form bean with multiple parameters of same name


 Does anybody know how Struts be made to populate an ActionForm bean with
 a variable number of text input fields that all have the same name?

 For instance, there may be 0, 1, 5, 10, or any other number of
 html:text property=propertyName size=20/ tags in an html:form.

 I want Struts to populate the ActionForm bean with all of the
 propertyName values, either one at a time via multiple calls to the
 ActionForm's setPropertyName(String propertyName) method, or all at once
 in an array (or other data structure) much like would be accomplished
 with the ServletRequest.getParameterValues(propertyName) method.

 I have tried to accomplish this any number of ways but have been
 unsuccessful and haven't seen anything in the documentation explaining
 how this should be done.

 TIA, Steve

 --
 Steven Valin
 [EMAIL PROTECTED]







Re: incrementing a number

2001-10-20 Thread Renaud Waldura

If the only thing you need to do is increment a variable, I think your way
is still the best way. But usually people increment counters to access
arrays or lists. In that case, if you have a list, an array, or any
collection of objects you need to access and display in the page,
logic:iterate is your friend.

See
http://jakarta.apache.org/struts/struts-logic.html#iterate


- Original Message -
From: Dua, Amit [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, October 19, 2001 2:15 PM
Subject: incrementing a number




 how to increment a variable using struts in jsp pages


 equivalent of

 % for(i=0;i10;i++){ %

 tr
 td
 =%i%

 /td
 /tr

 %}
 %





Re: XML include hack to split struts-config.xml + Struts Digester

2001-10-20 Thread Renaud Waldura

Hey guys,

Very interested in this also. In the meanwhile I'll patch my ActionServlet
with James' patch and give that a shot. Keep us posted on how far you get
with this.

--Renaud



- Original Message -
From: Vaughan Jackson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, October 19, 2001 1:01 PM
Subject: RE: XML include hack to split struts-config.xml + Struts Digester


 James,

 Thanks! I'll give this a try.

 BTW, does anyone know what the general consensus is on
 being able to use these XML external entity references
 within a WAR?

 Is it reasonable to expect that the Struts Digester will
 ever be able to handle this?

 Vaughan.


  -Original Message-
  From: James Holmes [mailto:[EMAIL PROTECTED]]
  Sent: Friday, October 19, 2001 12:32 PM
  To: [EMAIL PROTECTED]
  Subject: RE: XML include hack to split struts-config.xml
 
 
  I have the fix for multiple config files almost
  done.  I need to create the patch and send out an
  email, but in the mean time you can use:
 
  http://www.ejcenter.com/struts/ActionServlet.java
 
  Just recompile the 1.0 source with the above file and
  then in your web.xml file you can use a comma (,)
  delimited list of config files for the config
  init-param.  If you have any questions let me know.
 
  -james
  [EMAIL PROTECTED]
  http://www.ejcenter.com/struts/
 
 
  --- Vaughan Jackson [EMAIL PROTECTED]
  wrote:
   Hi,
  
   A while ago (Sept 10), Renaud Waldura posted this
   issue, saying that the
   only way he
   could get this to work was to hardwire the path to
   an included XML file like
   this:
  
   !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts
   Configuration 1.0//EN
  
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
  
   [ !ENTITY downloadClientActions SYSTEM
  
  
  file:./WEB-INF/config/struts/actions-downloadClient.xml
   ]
   
  
   I have found the same thing. This is not going to
   work in general.
  
   It seems to me that the reason this is the only way
   we can get it
   to work is because Digester, in implementing
   resolveEntity( ),
   refuses to resolve the path to a file like this,
   unless it is a
   pre-registered entity. Registration seems to require
   Java code calls prior
   to parsing.
  
   When Digester refuses to resolve the path, the web
   servers XmlParser seems
   to try to work out the path - and resolves it its
   current directory?
  
   My guess is that for this to work properly, Digester
   would have
   to be able to resolve the path within the WAR file?
  
   Any feedback welcome.
  
   Thanks,
   Vaughan.
  
  
   ___
   Vaughan Jackson
   Development
   Tumbleweed Communications
   [EMAIL PROTECTED] / +1 (650) 216 2532
   ___
  
  
 
 
  __
  Do You Yahoo!?
  Make a great connection at Yahoo! Personals.
  http://personals.yahoo.com