SV: Struts, VAJ 3.5.3, and ApplicationResources.properties

2001-05-17 Thread Mikkel Bruun

place it in your test applications project_resources folder...

preferably under a folder structure reprenseting your package names...

should do the trick

Mikkel

-Oprindelig meddelelse-
Fra: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sendt: 17 May 2001 06:10
Til: [EMAIL PROTECTED]
Emne: Struts, VAJ 3.5.3, and ApplicationResources.properties


My test application cannot read my ApplicationResources.properties file.
I've tried placing it in either the web_app/WEB-INF/classes directory or
the web_app/WEB-INF/classes/package_name directory, and both result in
the Cannot find message resources under key
org.apache.struts.action.MESSAGE  error.

All testing is being done in the VAJ 3.5.3 Websphere Test Environment.

Do I need to add any extra paths from the WTE Test Control Center
(currently my classpath DOES NOT point to the web_app/WEB-INF/lib dir).

Any light that can be shed on this problem is greatly appreciated.

jeff




This message is for the designated recipient only and may contain
privileged or confidential information.  If you have received it in error,
please notify the sender immediately and delete the original.  Any other
use of the email by you is prohibited.




SV: Trouble setting properties of an ActionForm bean

2001-05-17 Thread Mikkel Bruun

HI Peter,

Well, your bean doenst conform to the bean standard.
boolean getShowInstructions() should return a String instead...

dont know if this is causing your problem, but I suspect so

Mikkel

-Oprindelig meddelelse-
Fra: Peter Smith [mailto:[EMAIL PROTECTED]]
Sendt: 16 May 2001 22:55
Til: [EMAIL PROTECTED]
Emne: Trouble setting properties of an ActionForm bean


I'm hoping this issue is me just not understanding the
JavaBeans spec!

When I make the getter method of my ActionForm
property
a non-String type, the 'set' method for that property
is not called when a request is made.  I traced this
to
BeanUtils.java which gets a 'null' returned by
'propertyDescriptorInstance'.getWriteMethod() for the
offending method.

The code for my ActionForm with the offending property
is shown below.  I changed the return type of
getShowInstructions() to boolean instead of String.

Thanks for any advice.

--Peter--

-

...
  private String showInstructions_;

  public void setShowInstructions( 
String showInstructions )
  {
showInstructions_ = showInstructions;
  }

  public boolean getShowInstructions()
  { 
return ( Boolean.valueOf( 
  showInstructions_ ) ).booleanValue();
  }
...



__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



SV: Trouble setting properties of an ActionForm bean

2001-05-17 Thread Mikkel Bruun

why not just return a boolean??? the .toString() representation of a boolean
is the strings true or false
Works for me...

Mikkel

-Oprindelig meddelelse-
Fra: Eric Rasmussen [mailto:[EMAIL PROTECTED]]
Sendt: 17 May 2001 00:14
Til: [EMAIL PROTECTED]
Emne: Re: Trouble setting properties of an ActionForm bean


As far as I know, the value passed into the setter method must match the
value returned by the getter method.  It will not work otherwise.

Could you return 'true' or 'false' as a String?  If you are setting a value
of a field, it should work.

- eric

- Original Message -
From: Peter Smith [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 16, 2001 1:54 PM
Subject: Trouble setting properties of an ActionForm bean


 I'm hoping this issue is me just not understanding the
 JavaBeans spec!

 When I make the getter method of my ActionForm
 property
 a non-String type, the 'set' method for that property
 is not called when a request is made.  I traced this
 to
 BeanUtils.java which gets a 'null' returned by
 'propertyDescriptorInstance'.getWriteMethod() for the
 offending method.

 The code for my ActionForm with the offending property
 is shown below.  I changed the return type of
 getShowInstructions() to boolean instead of String.

 Thanks for any advice.

 --Peter--

 -

 ...
   private String showInstructions_;

   public void setShowInstructions(
 String showInstructions )
   {
 showInstructions_ = showInstructions;
   }

   public boolean getShowInstructions()
   {
 return ( Boolean.valueOf(
   showInstructions_ ) ).booleanValue();
   }
 ...



 __
 Do You Yahoo!?
 Yahoo! Auctions - buy the things you want at great prices
 http://auctions.yahoo.com/




Re: page flow control

2001-05-17 Thread Matthias Bauer

It was me, who posted the struts enhancement for flow control. The enhancement 
provides flow control and a pretty granular authentication feature. It is 
described in a mail with the subject Re: Struts questions for evaluation - 
Struts framework enhancement

For my needs the previous action path was enough, but I agree, that in some 
situations it might be good to also have the action result available.

Laurent,
you mentioned the other day that you enhanced my struts additions in order to 
support this. Can you please share this code?

Thanks,

--- Matthias


Matthias Bauer +++ [EMAIL PROTECTED] +++ LivingLogic AG +++ www.livinglogic.de


Laurent Delvaux wrote:

 Some one has ever post a set a class than enable a sort of flow control.
 You can find it on the malling list archive, the subject is Re: Struts
 questions for evaluation - Struts framework enhancement. He uses the
 previous action path, as a identifier...
 I personnaly think that previous action is not enought, and that we must
 consider the previous action result...
 
 Laurent
 
 -Message d'origine-
 De : Nathan Coast [mailto:[EMAIL PROTECTED]]
 Envoyé : mercredi 16 mai 2001 16:09
 À : struts-user
 Objet : page flow control
 
 
 Hi,
 
 In the site I'm developing, there are sections that have forms on
 consecutive 
 pages, I want to guarantee that pages are navigated: page1 - page2 -
 pageN. 
 At the same time allowing back and forward navigation to change values
 entered 
 on previous pages.  After the last submit, the only valid page in the
 sequence 
 is then page1.  I've had a look at the Struts Token functionality but I
 don't 
 think it can support this functionality.  Is it possible with Tokens or some
 
 other way?
 
 Thanks in advance
 Nathan
 
 
 = 
 Ce message et toutes les pièces jointes sont propriété de VALTECH et 
 susceptibles de contenir des informations confidentielles à l'intention 
 exclusive de ses destinataires. Si vous avez reçu ce message par erreur 
 ou si celui ci vous est parvenu incomplet ou altéré, merci d'en avertir 
 l'expéditeur par retour.Toute utilisation, diffusion ou publication non 
 expressément autorisée par nous par écrit est strictement interdite. 
  -- 
 This message and any attachments are Valtech property and may contain 
 iconfidential information intended solely for the addressees. If your are 
 not the intended recipient of this message or if you have received it 
 uncomplete or altered, please notify the author by replying to his e-mail 
 immediately. Any unauthorised use, diffusion or dissemination not 
 expressly authorised by us in writing is strictly prohibited. 
 = 
 Copyright Valtech 2000 
 
 






UN-subscribe me please!

2001-05-17 Thread Katarina Nelson



UN-subscribe me please!



Re: html:image bug?

2001-05-17 Thread Dan Miser

Yes, this is an existing bug. See #1399. It's fixed in the nightly build.
--
Dan Miser
http://www.distribucon.com


%@ taglib uri=/WEB-INF/tld/struts-html.tld prefix=html %
html:image alt=submit style=cursor:hand src=/img/but_submit.gif /

results in this html being generated:

input type=image name= src=/img/but_submit.gifalt=submit 
style=cursor:hand

obvious problems with name= and src=/img/but_submit.gifalt=submit

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




RE: html:image bug?

2001-05-17 Thread Dan Powell
Title: RE: html:image bug?





Ahh, sorry, this actually has already been corrected in cvs, so you could backport the change from there. 


http://nagoya.apache.org/bugzilla/show_bug.cgi?id=708


--
J. Daniel Powell
Sr. Systems Architect



-Original Message-
From: Nathan Coast [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 17, 2001 10:03 AM
To: struts-user
Subject: html:image bug?


Hi


%@ taglib uri=/WEB-INF/tld/struts-html.tld prefix=html %
html:image alt=submit style=cursor:hand src="/img/but_submit.gif" /


results in this html being generated:


input type=image name= src="/img/but_submit.gifalt=submit" style=cursor:hand


obvious problems with name= and src="/img/but_submit.gifalt=submit


Can anyone confirm if this is a bug? had a look at bugzilla but couldn't find 
any matching bugs.


Cheers
Nathan







RE: Suggestion:Taking the Servlet out of Action and ActionForm

2001-05-17 Thread Niall Pemberton

I don't agree - Actions are part of the controller in MVC and need access to
the servlet API to do thing such as retrieving and storing objects under the
appropriate context. Sounds to me like 1) Your using the wrong tool and 2)
You've put your Model in the Actions.

1) Cactus is a simple test framework for unit testing server-side java code.
It uses JUnit and extends it. It's primary goal is to be able to unit test
server side java methods which use Servlet objects such as
HttpServletRequest, HttpServletResponse, HttpSession etc.
   http://jakarta.apache.org/commons/cactus/

HttpUnit is a Java library for the automatic stimulation and testing of web
applications - which is supposed to be complimentary to Cactus.
   http://sourceforge.net/projects/httpunit

I haven't used these tools, but I'm about to download them and try them out.
Also I know Struts is in the process of setting up Cactus test suites so it
sounds like is more appropriate than JUnit for this environment.


2) If you succeed in separating your Model from the controller then you
should end up with a set of small Action classes. Testing your model outside
of the servlet enviornment should then be pretty straight forward. This is
what we've done and it works well.

Niall


 -Original Message-
 From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
 Sent: 17 May 2001 10:02
 To: '[EMAIL PROTECTED]'
 Subject: Suggestion:Taking the Servlet out of Action and ActionForm


 Hi guys,

 Here's a little design suggestion. I don't know if you have already
 discussed this.

 As we all know Action and ActionForm makes use of parts of the Servlet API
 (HttpRequest).
 This ties the execution of Action and ActionForm to a servlet enviroment.
 This is not bad, but (imho) it isn't good either...

 * We are not able to test our Actions in other enviroments (JUNIT for
 instance)
 * It's not possible to port our Action and ActionForm implementations to
 other types of applications (applet,  console)

 A couple of month ago I implemented my own Model2 framework that
 worked with
 a socalled RequestContext.
 The RequestContext contained three HashSet's, representing
 request-, session
 and applicationattributes
 In the Servlet's service (post/get) method we would populate the
 RequestContext with all request, session and applications attributes and
 pass it along the our viewvalidator (in this case an ActionForm object),
 that would extract the needed parameters and react to them (this
 could still
 be done with reflection as in struts).
 Any output from the validation would then be placed in the
 RequestContext's
 Collection (as a proxy to the *real* HttpRequest, HttpSession, etc,
 objects).
 If the validation was succesful the Servlet would then pass the
 RequestContext to a Command (or Action). The command would then extract it
 needed parameters and work on them.
 Once again, output would be place in the RequestContext's
 representation of
 Request, Session and Application.
 When the Command (or Action) was completed, the Servlet would iterate
 through the RequestContext and place all the attributes into their
 respective scope.

 The important point here is that the RequestContext wasn't tied to the
 Servlet API, although it could be initialized with HTTPRequest as
 parameter.

 By doing the above we were able to create validations and actions that we
 could easily test and reuse.
 What we usually did was that we created JUNIT testcases where we created
 instances of RequestContext and passed it to our Actions and eveluated the
 return values...These JUNIT cases could then be run from anywhere.
 We actually had our deployment done by Ant, and our deployment
 scripts would
 run all our testcases before deploying...
 We could actually test all of our application from the commandline...

 Just my two cents...

 Mikkel Bruun






RE: Problem with dynamic form elements

2001-05-17 Thread Niall Pemberton

There are quite a few messages in the archive about this:

   http://www.mail-archive.com/struts-user%40jakarta.apache.org/

A couple of messages from a recent thread:

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07656.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg07767.html

Niall

 -Original Message-
 From: Prior, Simon [mailto:[EMAIL PROTECTED]]
 Sent: 17 May 2001 12:50
 To: '[EMAIL PROTECTED]'
 Subject: Problem with dynamic form elements
 Importance: High


 Hi Guys,

 I have a question about dynamic form elements that I was hoping someone
 could answer.

 Basically, I have a page I populate with elements from a database
 where the
 number of entries is unknown.

 For each of the rows retrieved, I extract some information and create an
 entry in a table on the page.  Each of the rows has a text box associated
 with it - also generated dynamically.  An Iterator tag is used to
 create the
 rows in the table and hence an index for each of the text box elements.

 My question is this, when I enter information into the text boxes, I would
 like this reflected onto my actionform automatically by Struts.  However,
 because I don't know how many text boxes will be present on the page, I
 can't provide set methods for each one.

 So how is it done?

 Thanks in advance,

 Simon.





RE: html:image bug?

2001-05-17 Thread Niall Pemberton

You can look at the history of changes to Struts throug CVS Web, for
ImageTag:

http://jakarta.apache.org/cvsweb/index.cgi/jakarta-struts/src/share/org/apac
he/struts/taglib/html/ImageTag.java

According to the entries this bug was fixed on 27/02/2001, so you need a
nightly build after that to correct your problem.

Niall

 -Original Message-
 From: Nathan Coast [mailto:[EMAIL PROTECTED]]
 Sent: 17 May 2001 15:03
 To: struts-user
 Subject: html:image bug?


 Hi

 %@ taglib uri=/WEB-INF/tld/struts-html.tld prefix=html %
 html:image alt=submit style=cursor:hand src=/img/but_submit.gif /

 results in this html being generated:

 input type=image name= src=/img/but_submit.gifalt=submit
 style=cursor:hand

 obvious problems with name= and src=/img/but_submit.gifalt=submit

 Can anyone confirm if this is a bug? had a look at bugzilla but
 couldn't find
 any matching bugs.

 Cheers
 Nathan








Form Processing

2001-05-17 Thread Niall Pemberton

Perhaps there are some ideas here that could be used in Struts?

Facilitate form processing with the Form Processing API:

   http://www.javaworld.com/jjw/javtut_nl/jw-04-2001/jw-0427-forms.html

Opinions?

Niall

 winmail.dat


Re: JSR 127

2001-05-17 Thread Mark Simms

I noticed the mention of the Swing architect working on Barracuda
wellSwing hasn't really been a real bright spot in Java and I believe
JDK 1.4 is addressing many Swing issues.

- Original Message -
From: Christian Cryder [EMAIL PROTECTED]
To: Struts-User [EMAIL PROTECTED]
Sent: Wednesday, May 16, 2001 3:31 PM
Subject: JSR 127


 Notice JSR 127 too: GUI Component architecture, that's described here:
 http://www.theserverside.com/home/thread.jsp?thread_id=6532#20876

 
 Christian Cryder [[EMAIL PROTECTED]]
 Barracuda - MVC Component Framework for Webapps
 http://barracuda.enhydra.org
 
 What a great time to be a Geek




Possible to capture 'imageName.x' property?

2001-05-17 Thread Peter Smith

I saw a thread talking about how to find out which
'input' image was clicked by doing the following in
your Action class:

String image1 = request.getParameter(imgName1.x);
if ( image1!=null ) {
  // then this image was clicked!

I would like this info to be available from my
ActionForm via something like:

if ( myFormInstance.getImgName() ) {
  // then this image was clicked!

The '.x' (or '.y') seem to present a problem to
whatever reflection/bean-type stuff goes on inside
Struts - i.e. Struts can't find an appropriate method
to call when presented with the field name
'imgName.x'.

I've tried several method names like 
'setImgName_X()', 'setImgName()', etc.  Am I doing
something stupid?  Is there a way I can get around
this using a BeanInfo class for my ActionForm?

I've also thought about writing a 'HTTP request
parameter preprocessor' to hack-off the '.x' and '.y'
from any parameter that has them (all done before my
action class is passed the HttpRequest object, of
course).  Bad idea?

Thanks much!

--Peter--




__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Disable JSP ?

2001-05-17 Thread David Winterfeldt

Some people put JSP files in their WEB-INF directory. 
No direct access is allowed by a user to anything
under the WEB-INF directory, but you can forward a
user there and do includes from there.  I've done this
to hide JSP template pages.

David

--- Hicks, James [EMAIL PROTECTED] wrote:
 You can use the security-constraint/ and
 security-role/ tags in your
 deployment description to block access to a JSP
 page.  The only problem with
 this is you have to list every single jsp file you
 want to protect.  You
 cant use the '*.jsp' expression to hide all jsp
 files. 
 
 --- start web.xml ---
 web-app
 
   security-role
 role-namehiddenrole/role-name
   /security-role
   security-constraint
 web-resource-collection
  
 web-resource-namenoaccess/web-resource-name
   url-pattern/myFile.jsp/url-pattern
   url-pattern/myOtherFile.jsp/url-pattern
 /web-resource-collection
 auth-constraint
   role-namehiddenrole/role-name
 /auth-constraint
   /security-constraint
 /web-app
 --- end web.xml ---
 
 James Hicks
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, May 14, 2001 8:19 AM
 To: [EMAIL PROTECTED]
 Subject: Disable JSP ?
 
 Hello struts users,
 I just have a little question about application
 server 
 configuration. Well, i never use direct link between
 JSP, 
 i always use Action even if there is nothing to do,
 then 
 I can control the path of users into my site.
 That's why I don't want user be able to call
 directly a 
 JSP. I tried to disable JSP access in my web.xml
 file but 
 it works too good. Indeed, even Action forwarding
 (JSP) 
 are concerned about this rule, so I can't visualize
 any 
 JSP.
 Here is the concerned code in (web.xml):  
 servlet
   servlet-namecontrolFlowException/servlet-name
   jsp-filecontrolFlowException.jsp/jsp-file
 /servlet
 
 !-- Control Flow Mapping --
 servlet-mapping
   servlet-namecontrolFlowException/servlet-name
   url-pattern*.jsp/url-pattern
 /servlet-mapping
 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Disable JSP ?

2001-05-17 Thread John Raley

But you can do:

url-pattern/view/*/url-pattern

Just put your protected pages under a protected directory.

Hicks, James wrote:

You can use the security-constraint/ and security-role/ tags in your
deployment description to block access to a JSP page.  The only problem with
this is you have to list every single jsp file you want to protect.  You
cant use the '*.jsp' expression to hide all jsp files. 






What commercial software uses Struts?

2001-05-17 Thread Craig . A . Macha

I'd like to know what commercial software vendors are using Struts
internally in their products.  Anyone know?

Thanks,
Craig




Can an Action forward to another Action?

2001-05-17 Thread Seth Ladd

Hello,

I thought I saw this functionality added into Struts recently, and went to
search the mailing list archives, but couldn't find it.  I'm not sure if I
made this up or not. :)

Can an Action forward right to another action?  If not, is there a good way
to accomplish this?

Thanks for your hints and tips,
Seth




RE: Suggestion:Taking the Servlet out of Action and ActionForm

2001-05-17 Thread Niall Pemberton

Mikkel

OK I agree, its never so black  white and your user example looks fine to
me.

I'm wondering about your inner controller - sounds like some great
integrated framework, in which case I agree its probably a level of
abstraction I wouldn't want to go to. But what about lots of small
controllers which tie together your logic outside the action.

Anyway, I was probably misleading in saying thats what we've done. What I
have actually done is this:

We have sub-classed Action and created some abstract standard classes, our
database action does something like this:

1) Get a database connection
2) Create a Transport object and store the ActionMapping,
HttpServletRequest, HttpServletResponse  Connection.
3) Set the default nextAction to success

4) call a processForm(ActionForm, Transport) method (implemented as an
abstract method) catching and handling exceptions.

5) Check the Transport object for error messages. If there are errors create
ActionErrors and save and if a nextAction returned by the Transport object
use it otherwise set the nextAction to failure.
6) Close the Connection
7) Find the mapping for nextAction and forward to it.

All out actions then inherit from this ActionFramework class overriding the
processForm(ActionForm, Transport) method. This means that our Action
classes have no references to the servlet world, meaning we can test them
independantly.

Now I know straight away you are going to say that I am storing the
ActionMapping, HttpServletRequest  HttpServletResponse in my Transport
object - so far I haven't used them anywhere, it was just in case I ever
needed to. Also if I ever do I will try to hide this in a new method in the
Transport object.

What do you think?

Niall

 -Original Message-
 From: Mikkel Bruun [mailto:[EMAIL PROTECTED]]
 Sent: 17 May 2001 20:58
 To: 'Niall Pemberton '; '[EMAIL PROTECTED] '
 Subject: RE: Suggestion:Taking the Servlet out of Action and ActionForm


 Hi Niall,

  I not sure I agree with you, although you have som good points.

 When looking at the MVC pattern we can easily identify two of the
 elements,
 namely the view (jsp) and the model (usually persistent object)...
 However, where is our controller??? As you point out, in the
 struts context
 the controller would be (partly) the Action, and probably some kind of
 Facade pattern towards the Model...

 However, in the classic sense of the MVC, the Controller should
 be reusable
 between many applications, and the Action dependence to the Servlet API
 doesn't (strictly speaking) make this possible.

 The solution to this is ofcourse to build a inner Controller, with close
 ties to the Model, such as an Facade or a (none Servlet specific) Command.
 However, I Feel that this just introduces another level of
 abstraction, and
 this abstraction should/could be made by the Action

 To give you a clue of the granularity of my Actions I give you
 the following
 example, please comment and tell if you think I have to much Model in it,
 and if, how to avoid it.
 This is probably not the best example, but here it comes...

 My Current Project deals with financing...Users has to LogOn to the System

 Model : User
 Controller: LogOnAction

 The Action makes use of an UserModelFacade. The UserModelFacade has a
 getUser(String uname, String pw) method...

 Pseudocode:

 User theUser= UserModelFacade.getInstance().getUser(name,pw);
 if(theUser==null)
 return(mappings.findMapping(failure)
 request.getSession().setAttrubute(myUser, theUser);
 return(mappings.findMapping(succes)

 This is the basic architecture and strategy we will be using in the
 development.
 When I said that this was a bad example, its because it only access the
 Model once...
 But some of our processes is more complicated than that...
 Sometimes we need to

 get the CurrentUser
 get other possible customers in the household
 get number of cars in the household
 get the new car
 make a finance calculation based on the above

 The following will result is 20-30 lines of code in the Action. LOC's I
 would like to be able to reuse...

 I haven't heard of Cactus or HttpUnit before this thread, and I
 will surely
 look into them (souds like great tools)

 nice thread btw ;-)

 regards Mikkel









 -Original Message-
 From: Niall Pemberton
 To: [EMAIL PROTECTED]
 Sent: 17-05-2001 17:11
 Subject: RE: Suggestion:Taking the Servlet out of Action and ActionForm

 I don't agree - Actions are part of the controller in MVC and need
 access to
 the servlet API to do thing such as retrieving and storing objects under
 the
 appropriate context. Sounds to me like 1) Your using the wrong tool and
 2)
 You've put your Model in the Actions.

 1) Cactus is a simple test framework for unit testing server-side java
 code.
 It uses JUnit and extends it. It's primary goal is to be able to unit
 test
 server side java methods which use Servlet objects such as
 HttpServletRequest, HttpServletResponse, HttpSession etc.

Re: What commercial software uses Struts?

2001-05-17 Thread Bill Pfeiffer

SilverStream 3.7 ships with its flagship example application SilverBooks
written using jsp/struts.

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 17, 2001 4:45 PM
Subject: What commercial software uses Struts?


 I'd like to know what commercial software vendors are using Struts
 internally in their products.  Anyone know?

 Thanks,
 Craig






RE: Can an Action forward to another Action?

2001-05-17 Thread Niall Pemberton

I don't think its a new feature we do this, just specifiy
path=something.do in the forward for your action.

Niall

 -Original Message-
 From: Seth Ladd [mailto:[EMAIL PROTECTED]]
 Sent: 17 May 2001 22:07
 To: [EMAIL PROTECTED]
 Subject: Can an Action forward to another Action?


 Hello,

 I thought I saw this functionality added into Struts recently, and went to
 search the mailing list archives, but couldn't find it.  I'm not sure if I
 made this up or not. :)

 Can an Action forward right to another action?  If not, is there
 a good way
 to accomplish this?

 Thanks for your hints and tips,
 Seth






Re: Indexed Grid Representation on a Form

2001-05-17 Thread Jeff Trent



I ended up getting it to work thru this hack 
below. I'd be curious if someone was able to do this dynamic grid entry 
gracefully using struts!!!


 % int i = 0; 
% logic:iterate id="customerContact" 
name="adminUpdateProfileForm" 
property="customerContacts" 
tr tdinput 
type='text' name="customerContact[%= i++ %].contactName" value="%= 
((com.mydomain.project.CustomerContact)customerContact).getContactName() 
%"/td 
/tr /logic:iterate

  - Original Message - 
  From: 
  Jeff 
  Trent 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, May 17, 2001 10:12 
  PM
  Subject: Re: Indexed Grid Representation 
  on a Form
  
  No, this still generates an exception. If I 
  substitute i for 0 in your below example it works but that doesn't help me for 
  the iteration. Thanks, jeff.
  
  
- Original Message - 
From: 
Nanduri, Amarnath 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, May 17, 2001 5:39 
PM
Subject: RE: Indexed Grid 
Representation on a Form

 % int i = 0; 
% logic:iterate id="list" 
name="adminUpdateProfileForm" 
property="customerContacts" 
tr % i++ ; 
% 
tdhtml:text property="customerContact[i].contactName"//td 
/tr /logic:iterate



  -Original Message-From: Jeff Trent [mailto:[EMAIL PROTECTED]]Sent: 
  Thursday, May 17, 2001 3:58 PMTo: 
  [EMAIL PROTECTED]Subject: Indexed Grid 
  Representation on a Form
  I think this should work (but obviously it 
  doesn't). Can anyone tell me why?
  
   % int i = 0; 
  % logic:iterate id="list" 
  name="adminUpdateProfileForm" 
  property="customerContacts" 
  tr 
  tdhtml:text 
  property="customerContact[%=i++%].contactName"//td 
  /tr /logic:iterate
  
  Where getCustomerContacts() returns a vector 
  of CustomerContact objects 
   getCustomerConact(int 
  offset) returns an CustomerContact element from that vector.
  
  thanks,
  jeff
  


Unsubscribe me please

2001-05-17 Thread josephhakim

Unsubscribe me please

_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Re: Indexed Grid Representation on a Form

2001-05-17 Thread Jeff Trent

What really is needed is a new html tag called grid or something that
handles this more gracefully.  Using the iterate tag seems to be a waste
since I'm not really using it for anything other than a counter placeholder.
I know its a departure from standard HTML form types but who the hell cares.
This would be really useful addition instead of mixing html tags in with
iterate tag to accomplish something that should be simple.  Maybe I'll write
a taglib for this...

So reading your comments, Jim, it sounds like your using code analagous to
this but your implementation uses a map instead (?)

BTW, now that I'm using html field names like customerContactName[0].title,
I find that conventional javascript to set focus doesn't work - I get
javascript errors.  Any ideas how to reference these fields?

thanks,
jeff

- Original Message -
From: Jim Richards [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 17, 2001 10:24 PM
Subject: Re: Indexed Grid Representation on a Form



 It should be:

  % int i = 0; %
  logic:iterate id=list name=adminUpdateProfileForm
property=customerContacts
 tr % i++ ; %
  tdhtml:text property=%= \customerContact[\ + i
\].contactName\ %//td
 /tr
  /logic:iterate

 You need to replace the whole string. The exception would have been from
 the BeanUtils not able to understand what the [i] would have meant. If you
 have an iterator in a scriptlet, then you need to always use a scriptlet
 to access it. Usually. Mostly.

 I had a feeling there was a change made to iterate recently to give you
 an index value, but I can't remember what it was.

 I usually use a Map and have the key as the integer value in the index
 for the entry. Works well when you don't have liner numbering in the
 list of key/value pairs.





Re: Iterate and Radio tags

2001-05-17 Thread B Manikandan

Hi Amar,
I have a problem in implementing this solution.
I have a situation similar to the user and subscription class scenarion of
struts-example.

I have a DomainHolder object which has a collection of
DomainDomainRelationHolder object as a Hashtable.

In my Domain.jsp I have to display the list of DomainDomainRelation objects.

I have the following iterate tag.

   logic:iterate id=domainDomainRelationHolder name=domainHolder
property=domainDomainRels
tr
  td width=6%
 html:radio name=domainHolder property=childGroupOID
value=%=domainDomainRelationHolder.getChildGroupOID()%/
  /td
  td width='32%'
  bean:write name=domainDomainRelationHolder property=childGroupName
filter=true/
 /td
  td width=52%bean:write name=domainDomainRelationHolder
property=childGroupDesc filter=true//td
  /tr
   /logic:iterate


Iam  getting an exception saying that getChildGroupOID() is not found in
java.lang.Object.

In my DomainHolder object I have a property corresponding to childGroupOID.But I
am not sure where to have a collection that returns the childGroupOID.
This is a problem since childGroupOID is a user entered value in my
DomainDomainRelationHolder and I need this value to retrieve the corresponding
object from DomainHolder for Edit action.

This is the same situation as struts-example with one exception being that I
have to use radio buttons instead of links as in the example.

Mani

Nanduri, Amarnath wrote:

 Hi Mani,

   Try this. It works for meIt is a hack i need to implement in my
 ActionForm also.

   logic:iterate id=groupsList name=statesBean property=states
 html:radio name=statesBean property=selectedIndex value=%=
 statesBean.getIndexedValue() % /

   /logic:iterate

 public class StatesBeanForm extends ActionForm
 {

   // this has the corresponding getter and setter
   private ArrayList  states = null ;


   // a variable which has to store the value of the radio button selected by
 the user. This also has a getter and setter

   private  String selectedIndex  = null ;

   // setters and getters
   private  ArrayList indexedValue = null ;

 }

 -Original Message-
 From: B Manikandan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 16, 2001 3:05 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Iterate and Radio tags
 Importance: High

 Hi,
   I have posted the same question,but did not get any reply.I need to set
 the
 value of radio button to a property from my bean.
   And I need to do this in a iterate.

 Mani

 Nanduri, Amarnath wrote:

  Hi All,
 
  I am using a Radio Button in an Iterate Tag. I would like to give a
  unique id value to each and every radio button. The name of the button
 will
  be the same but the value will be different. So if a user clicks ona
  particular radio button, i will know which value is he looking for ? Is
 this
  possible using the struts html:radio tag ? or do i need to use a different
  tag ?
 
  cheers,
  Amar..




Websphere 3.5.3??

2001-05-17 Thread Mikkel Bruun

Hi There!

In the instructions for installation on WebSphere
(http://jakarta.apache.org/struts/installation-was352.html), it says that
many of the problems encountered using 3.5.2 would be removed when 3.5.3
arríves...3.5.3 is heredid it solve the problems and is there anybody
who has instructions on installing on 3.5.3???


thanks!

Mikkel