R: Struts and PL/SQL

2004-06-25 Thread Grassi Fabio
Yes, what you ask is possible, here is a minimal but working example:

create or replace function test(obj_name in varchar2) return sys_refcursor is
  result sys_refcursor;
  sql_string varchar2(2000);
begin
  sql_string := 'select * from user_objects';
  if obj_name is not null then
sql_string := sql_string || ' where object_name like ''' || obj_name || '%''';
  end if;
  open result for sql_string;
  return result;
end test;

Please note that main reason I use stored procedure is to decouple the physical data 
structure from the application. In order to keep this separation clean in your 
scenario I would in some way abstract the dynamic filters (i.e. I would not use 
column or table names as parameters).

Note also that dynamic sql is not as performant as precompiled pl/sql code (but not 
less performant than a client-built query) and more error-prone, so unless the logic 
gets *very* complicated I prefer using if/elsif/else/end blocks and have some code 
duplicated.

Bye, Fabio.


 -Messaggio originale-
 Da: Chris Cranford [mailto:[EMAIL PROTECTED] 
 Inviato: giovedì 24 giugno 2004 13:27
 A: Struts Users Mailing List
 Oggetto: Re: Struts and PL/SQL
 
 
 You done any type of experimentation with dynamic SQL in your 
 procedures?
 
 We have a form that accepts tons of input values from the web 
 user which
 eventually get translated into 1 SQL query to pull back the 
 data-set the
 user is looking for.  The problem is that nesting select 
 statements slows
 done the query, so in some cases, we create a 
 callablestatement, generate
 the list of IDs on the java side and simply make those part 
 of the query
 itself inline causing the query to run much faster.  There 
 are other form
 values that would reqiure we either append or not append additional
 constraints to our SQL.
 
 In my procedure, I could easily include all this logic and 
 have a multitude
 of IF/ELSIF/ENDIF statements which describe the logic but then I have
 multiple copies of the SQL query to maintain on each 
 IF-structure branch
 which I would prefer not to do.  Is there a way where the 
 string-append
 approach can be used in Oracle so that after all the 
 conditions have been
 met, I simply open my cursor once to retreive the data in a PL/SQL
 procedure?
 
 Thanks
 Chris
 
 - Original Message -
 From: Grassi Fabio [EMAIL PROTECTED]
 To: Lucas Gonzalez [EMAIL PROTECTED]; Struts Users
 Mailing List [EMAIL PROTECTED]
 Sent: Thursday, June 24, 2004 5:31 AM
 Subject: R: Struts and PL/SQL
 
 
 Hi, in my application all DB access goes through PL/SQL 
 stored procedures. I
 use Oracle JPublisher to generate the Java classes that map 
 PL/SQL packages.
 It works fine enough.
 
 Bye, Fabio.
 
  -Messaggio originale-
  Da: Lucas Gonzalez [mailto:[EMAIL PROTECTED]
  Inviato: mercoledì 23 giugno 2004 20:07
  A: Struts Users Mailing List
  Oggetto: Struts and PL/SQL
 
 
  Hi all!
 
  I´ve been using Struts a lot with EJB and Hibernate with no 
 problems.
 
  But I always wondered if it´s possible to use an architecture
  that uses
  STRUTS and goes directly to PL/SQL for the database layer. I
  know it is
  possible in many way, but I would like to know if there is 
 any special
  product or package that integrates with PL ( the only one I found is
  http://portalstudio.oracle.com/servlet/page?_pageid=473_dad=o
 ps_schema=OPSTUDIO ) ... any pointers?
 
 Thanks a lot
 Lucas
 
 Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni 
 contenute in
 questo messaggio sono riservate ed a uso esclusivo del 
 destinatario. Qualora
 il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad
 eliminarlo senza copiarlo e a non inoltrarlo a terzi, 
 dandocene gentilmente
 comunicazione. Grazie.BRBRPursuant to Legislative Decree 
 No. 196/2003,
 you are hereby informed that this message contains 
 confidential information
 intended only for the use of the addressee. If you are not 
 the addressee,
 and have received this message by mistake, please delete it 
 and immediately
 notify us. You may not copy or disseminate this message to 
 anyone. Thank
 you.
 
 
 
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo 
messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in 
parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a 
non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.BRBRPursuant 
to Legislative Decree No. 196/2003, you are hereby informed that this message contains 
confidential information intended only for the use of the addressee. If you are not 
the addressee, and have received this message by mistake, please delete it and 
immediately notify us. You may not copy or disseminate this message to anyone. Thank 
you.

Re: 2 deep nested forms (solution to 2 dimensional arrays with struts html tags)

2004-06-25 Thread Mark Lowe
No i was wrong works as i thought it would
Need to iterate through the values of the dishes map
public Object[] getDishes() {
return map.values().toArray();
}
%-- var could be anything the index us the important bit --%
c:forEach var=dish items=${course.dishes} varStatus=index
%-- get the correctly indexed key from the getKeys array-%
c:set var=key value=${course.keys[index.count - 1]} /
html:text name=course property=dish(${key}.name indexed=true /
/c:forEach
renders to
input type=text name=course[0].dish(key1).name value=Fish
input type=text name=course[0].dish(key2).name value=More Fish
On 25 Jun 2004, at 01:09, Mark Lowe wrote:
No needs a rethink .
indexed=true uses whatever iteration tags that its between.. Arses,, 
drat and double drat.


On 25 Jun 2004, at 00:27, Mark Lowe wrote:
Not quite.. hang on.

On 25 Jun 2004, at 00:14, Mark Lowe wrote:
A question came up the other week/month where someone nesting 2 deep 
and was trying to use a 2 dimesional array. I had the some problem 
today and had my chance to combine indexed and mapped properties to 
solve the problem.

I want to create a Restaurant Menu editor. So a menu has a few 
properties like title and start and end dates for seasonal menus.

So I have 3 action form or nested pojo's
MenuForm
CourseForm
DishBean
I used lazyMap and lazyList to save scoping to session.
MenuForm - has a lazyList or nested courses.
CourseForm - has a lazyMap of dishes and a getKeys() method that 
returns map.keySet().toArray()

and dishes are just plain string properties.
public DishBean getDish(String key)
public void setDish(String key,DishBean dish)
The jsp stuff looks something like this.
html:text property=title /
c:forEach var=course items=${menuForm.courses}
	html:text name=course property=title indexed=true /
	
	c:forEach var=key items=${course.keys}
		html:text name=course property=dish(${key}).name 
indexed=true /
	/c:forEach

/c:forEach
its not quite as tidy as 2 dimensional array support, but it pretty 
clean looking.


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

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

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

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


RE: [OT] File upload design question

2004-06-25 Thread Paul McCulloch
I implement this as follows:

On session creation I create a directory in an 'uploads' directory using
session id for the name

Uploading a file copies the file into the session upload directory and adds
the filename (as a String) to a collection on my session scoped form bean.

On submission of the form the full paths to the files, in the session upload
directory, are passed to my business layer which processes them.

On session destruction the session upload directory is removed.

Paul

 -Original Message-
 From: Jim Collins [mailto:[EMAIL PROTECTED]
 Sent: 24 June 2004 23:19
 To: Struts Users Mailing List
 Subject: [OT] File upload design question
 
 
 Hi,
 
 Appologies for the off topic posting. I am writing an 
 application where a
 user fills in a form, can attach some files and when they 
 submit the form it
 kicks off a workflow and saves any attached files to a 
 content management
 system.
 
 This works fine using the struts file upload tools. What I 
 would like to do
 though is have it work in a similar fasion to Yahoo mail when 
 you send an
 email with attachments. The user when filling the form out 
 attaches some
 files, these are then uploaded to the server. When the user 
 then submits the
 form the workflow is kicked up and the files that were 
 uploaded are moved to
 the content management system.
 
 The files are only copied across if the user submits the 
 form. If the user
 uploads some files and then decide not to submit the form the 
 files should
 be deleted.from the server.
 
 Does anyone have any ideas on a design for this so that I 
 don't end up with
 lots of orphan files on the server and when the user submits 
 a form the
 correct files are copied to the content management system?
 
 Thanks
 
 Jim
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



RE: How to implements Role Based Access Control in Struts ?

2004-06-25 Thread Lesaint Sébastien
Hi,

I was just looking into Pow2ACL, I wonder if this solution is up to date,
looks like the last release came out in 2002. It is said it is integrated
with Struts, but if it is that old, I wonder if it does work with the last
releases of Struts.

Anybody using Pow2ACL with struts around here? I would really appreciate
opinions about this product.

Thanks

-Message d'origine-
De : David Friedman [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 25 juin 2004 03:51
À : Struts Users Mailing List
Objet : RE: How to implements Role Based Access Control in Struts ?

From a database?  Pow2ACL.
http://pow2acl.sourceforge.net

-Original Message-
From: javen fang [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 9:41 PM
To: Struts Users Mailing List
Subject: Re: How to implements Role Based Access Control in Struts ?


Thank you, bill.

I have seen the SecurityFilter project. It seems that
it is replacer to Container Management Security, and
it is based securityfilter-config.xml file. But I need
to obtain roles information from database, my customer
can insert a role, and determine which permission the
role has.

thanks all the same.

Can you give me another advice? 

 - javen fang

--- Bill Siggelkow [EMAIL PROTECTED] wrote:
 If container-managed security is to limiting for you
 but you still want 
 to use the logic:present role=... tag then you
 might want to look 
 into SecurityFilter
 (http://securityfilter.sourceforge.net). There are a
 
 lot of pros and cons when choosing a security
 mechanism. SecurityFilter 
 allows many conveniences offered by
 container-managed security (like 
 being able to use request.isUserInRole(...) etc.
 yet still allow a 
 custom solution.
 
 shameless-plug
 I provided the initial draft for the Struts Security
 chapter of Struts: 
 The Complete Reference (Osborne) by James Holmes. I
 cover a lot of these 
details in this chapter.
 /shameless-plug
 
 Let me know if you have more specific questions: I
 will be glad to help :)
 
 Bill Siggelkow
 
 javen fang wrote:
 
  Hi , all:
  
  I have queried this mailing list, and I get some
  discusses about RBAC ( Role Based Access Control )
 in
  struts. I understand that logic:present
 role=...
  in JSP page and role attribute in ActionMapping
 are
  all prepared with Container Management Access
 Control,
  etc, JDBCRealm.
  
  But it seems that what I need is not Container
  Management Access Control,because CMAC is
 configured
  in config file(etc, server.xml,web.xml) , but I
 want
  to let customer config user roles in dynamic
 way,and
  the user roles infomation is read from database. 
  
  So,how can I implements RBAC with struts. can you
 give
  me some advice?
  
  thanks, javen
  
  
  
  __
  Do you Yahoo!?
  Yahoo! Mail - 50x more storage than other
 providers!
  http://promotions.yahoo.com/new_mail
 
 

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




__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


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


Re: How to implements Role Based Access Control in Struts ?

2004-06-25 Thread Navjot Singh
you may better try securityfilter.sf.net or jGurad
Lesaint Sébastien wrote:
Hi,
I was just looking into Pow2ACL, I wonder if this solution is up to date,
looks like the last release came out in 2002. It is said it is integrated
with Struts, but if it is that old, I wonder if it does work with the last
releases of Struts.
Anybody using Pow2ACL with struts around here? I would really appreciate
opinions about this product.
Thanks
-Message d'origine-
De : David Friedman [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 25 juin 2004 03:51
À : Struts Users Mailing List
Objet : RE: How to implements Role Based Access Control in Struts ?

From a database?  Pow2ACL.
http://pow2acl.sourceforge.net
-Original Message-
From: javen fang [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 9:41 PM
To: Struts Users Mailing List
Subject: Re: How to implements Role Based Access Control in Struts ?
Thank you, bill.
I have seen the SecurityFilter project. It seems that
it is replacer to Container Management Security, and
it is based securityfilter-config.xml file. But I need
to obtain roles information from database, my customer
can insert a role, and determine which permission the
role has.
thanks all the same.
Can you give me another advice? 

 - javen fang
--- Bill Siggelkow [EMAIL PROTECTED] wrote:
If container-managed security is to limiting for you
but you still want 
to use the logic:present role=... tag then you
might want to look 
into SecurityFilter
(http://securityfilter.sourceforge.net). There are a

lot of pros and cons when choosing a security
mechanism. SecurityFilter 
allows many conveniences offered by
container-managed security (like 
being able to use request.isUserInRole(...) etc.
yet still allow a 
custom solution.

shameless-plug
I provided the initial draft for the Struts Security
chapter of Struts: 
The Complete Reference (Osborne) by James Holmes. I
cover a lot of these 
  details in this chapter.
/shameless-plug

Let me know if you have more specific questions: I
will be glad to help :)
Bill Siggelkow
javen fang wrote:

Hi , all:
I have queried this mailing list, and I get some
discusses about RBAC ( Role Based Access Control )
in
struts. I understand that logic:present
role=...
in JSP page and role attribute in ActionMapping
are
all prepared with Container Management Access
Control,
etc, JDBCRealm.
But it seems that what I need is not Container
Management Access Control,because CMAC is
configured
in config file(etc, server.xml,web.xml) , but I
want
to let customer config user roles in dynamic
way,and
the user roles infomation is read from database. 

So,how can I implements RBAC with struts. can you
give
me some advice?
thanks, javen

__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other
providers!
http://promotions.yahoo.com/new_mail


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


		
__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


SV: How to implements Role Based Access Control in Struts ?

2004-06-25 Thread hermod . opstvedt
Hi

There is database support in SecurityFilter

Hermod

-Opprinnelig melding-
Fra: Lesaint Sébastien [mailto:[EMAIL PROTECTED]
Sendt: 25. juni 2004 11:05
Til: Struts Users Mailing List
Emne: RE: How to implements Role Based Access Control in Struts ?


Hi,

I was just looking into Pow2ACL, I wonder if this solution is up to
date,
looks like the last release came out in 2002. It is said it is
integrated
with Struts, but if it is that old, I wonder if it does work with the
last
releases of Struts.

Anybody using Pow2ACL with struts around here? I would really appreciate
opinions about this product.

Thanks

-Message d'origine-
De : David Friedman [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 25 juin 2004 03:51
À : Struts Users Mailing List
Objet : RE: How to implements Role Based Access Control in Struts ?

From a database?  Pow2ACL.
http://pow2acl.sourceforge.net

-Original Message-
From: javen fang [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 24, 2004 9:41 PM
To: Struts Users Mailing List
Subject: Re: How to implements Role Based Access Control in Struts ?


Thank you, bill.

I have seen the SecurityFilter project. It seems that
it is replacer to Container Management Security, and
it is based securityfilter-config.xml file. But I need
to obtain roles information from database, my customer
can insert a role, and determine which permission the
role has.

thanks all the same.

Can you give me another advice? 

 - javen fang

--- Bill Siggelkow [EMAIL PROTECTED] wrote:
 If container-managed security is to limiting for you
 but you still want 
 to use the logic:present role=... tag then you
 might want to look 
 into SecurityFilter
 (http://securityfilter.sourceforge.net). There are a
 
 lot of pros and cons when choosing a security
 mechanism. SecurityFilter 
 allows many conveniences offered by
 container-managed security (like 
 being able to use request.isUserInRole(...) etc.
 yet still allow a 
 custom solution.
 
 shameless-plug
 I provided the initial draft for the Struts Security
 chapter of Struts: 
 The Complete Reference (Osborne) by James Holmes. I
 cover a lot of these 
details in this chapter.
 /shameless-plug
 
 Let me know if you have more specific questions: I
 will be glad to help :)
 
 Bill Siggelkow
 
 javen fang wrote:
 
  Hi , all:
  
  I have queried this mailing list, and I get some
  discusses about RBAC ( Role Based Access Control )
 in
  struts. I understand that logic:present
 role=...
  in JSP page and role attribute in ActionMapping
 are
  all prepared with Container Management Access
 Control,
  etc, JDBCRealm.
  
  But it seems that what I need is not Container
  Management Access Control,because CMAC is
 configured
  in config file(etc, server.xml,web.xml) , but I
 want
  to let customer config user roles in dynamic
 way,and
  the user roles infomation is read from database. 
  
  So,how can I implements RBAC with struts. can you
 give
  me some advice?
  
  thanks, javen
  
  
  
  __
  Do you Yahoo!?
  Yahoo! Mail - 50x more storage than other
 providers!
  http://promotions.yahoo.com/new_mail
 
 

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




__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


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


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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



How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread John Antonakos
I want to do something like the following:
html:hidden property=firstname value=bean name=member property=firstname//

is this possible ?
The above statement produces an error.
Can i use another statement to do this thing ?
Give a dynamic value, coming from another bean,
to an html:hidden field ?

Regards, John

RE: How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread Vaclavik Radek
Hi John,

this kind of nesting is not possible in Struts. It has been discussed many
times in many forums already.
The solution is to define a scripting variable and assign it then:

bean:define id=someId name=member property=firstname/

html:hidden property=firstname value=%= someId%/

Radek


 -Original Message-
 From: John Antonakos [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 12:17 PM
 To: [EMAIL PROTECTED]
 Subject: How can i put a dynamic value to an html:hidden ?
 
 
 I want to do something like the following:
 html:hidden property=firstname value=bean name=member 
 property=firstname//
 
 is this possible ?
 The above statement produces an error.
 Can i use another statement to do this thing ?
 Give a dynamic value, coming from another bean,
 to an html:hidden field ?
 
 Regards, John
 


Re: How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread John Antonakos
just out of curiosity, what is html-el ?
i use JSTL, but even in that, i cannot do this:
html:hidden property=firstname value=c:out value=${member.firstname}//

John

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 25, 2004 1:26 PM
Subject: SV: How can i put a dynamic value to an html:hidden ?


Hi

use html-el and then : html:hidden property=firstname
value=${member.firstname}/

-Opprinnelig melding-
Fra: John Antonakos [mailto:[EMAIL PROTECTED]
Sendt: 25. juni 2004 12:17
Til: [EMAIL PROTECTED]
Emne: How can i put a dynamic value to an html:hidden ?


I want to do something like the following:
html:hidden property=firstname value=bean name=member
property=firstname//

is this possible ?
The above statement produces an error.
Can i use another statement to do this thing ?
Give a dynamic value, coming from another bean,
to an html:hidden field ?

Regards, John


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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




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



RE: How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread Paul McCulloch
As other posters have said, you can't use a jsp tag to provide the value of
an attribute in another tag. Ever.

However, what you are doing is (probably) redundant. The purpose of the
html:hidden tag is to *automatically* create an input type=hidden/
element in your form with the value already set according to the value in
your form bean. 

If you just want to create a hidden input with a value from something other
than your form bean just use the html tag directly. As this is not a jsp tag
you can use a jsp tag as an attribute:

input type=hidden name=firstname value=bean:write name=member
property=firstname//

Paul

 -Original Message-
 From: John Antonakos [mailto:[EMAIL PROTECTED]
 Sent: 25 June 2004 11:17
 To: [EMAIL PROTECTED]
 Subject: How can i put a dynamic value to an html:hidden ?
 
 
 I want to do something like the following:
 html:hidden property=firstname value=bean name=member 
 property=firstname//
 
 is this possible ?
 The above statement produces an error.
 Can i use another statement to do this thing ?
 Give a dynamic value, coming from another bean,
 to an html:hidden field ?
 
 Regards, John
 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



Re: How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread John Antonakos
Dear Paul,

i know all that, thanks for the remarks though.
I was using that anyway.
I just decided to change them all to html: tags and realized that i cannot.
do it in this specific case. Only for those tags i will keep the old ones.

Thanks, anyway John

- Original Message - 
From: Paul McCulloch [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, June 25, 2004 1:37 PM
Subject: RE: How can i put a dynamic value to an html:hidden ?


As other posters have said, you can't use a jsp tag to provide the value of
an attribute in another tag. Ever.

However, what you are doing is (probably) redundant. The purpose of the
html:hidden tag is to *automatically* create an input type=hidden/
element in your form with the value already set according to the value in
your form bean.

If you just want to create a hidden input with a value from something other
than your form bean just use the html tag directly. As this is not a jsp tag
you can use a jsp tag as an attribute:

input type=hidden name=firstname value=bean:write name=member
property=firstname//

Paul

 -Original Message-
 From: John Antonakos [mailto:[EMAIL PROTECTED]
 Sent: 25 June 2004 11:17
 To: [EMAIL PROTECTED]
 Subject: How can i put a dynamic value to an html:hidden ?


 I want to do something like the following:
 html:hidden property=firstname value=bean name=member
 property=firstname//

 is this possible ?
 The above statement produces an error.
 Can i use another statement to do this thing ?
 Give a dynamic value, coming from another bean,
 to an html:hidden field ?

 Regards, John



**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee
indicated in this message (or responsible for delivery of the message to such person), 
you may not
copy or deliver this message to anyone. In such case, you should destroy this message, 
and notify us
immediately. If you or your employer does not consent to Internet email messages of 
this kind,
please advise us immediately. Opinions, conclusions and other information expressed in 
this message
are not given or endorsed by my Company or employer unless otherwise indicated by an 
authorised
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via
electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.
You are therefore strongly advised to undertake anti virus checks prior to accessing 
the attachment
to this electronic mail.  Axios Systems Ltd grants no warranties regarding performance 
use or
quality of any attachment and undertakes no liability for loss or damage howsoever 
caused.
**


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



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



SV: How can i put a dynamic value to an html:hidden ?

2004-06-25 Thread hermod . opstvedt
Hi

import the struts-el tag library and the tld for it - Then you can ust
jstl syntax. Right now you are using the standard struts tag library

Hermod

-Opprinnelig melding-
Fra: John Antonakos [mailto:[EMAIL PROTECTED]
Sendt: 25. juni 2004 12:30
Til: Struts Users Mailing List
Emne: Re: How can i put a dynamic value to an html:hidden ?


just out of curiosity, what is html-el ?
i use JSTL, but even in that, i cannot do this:
html:hidden property=firstname value=c:out
value=${member.firstname}//

John

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 25, 2004 1:26 PM
Subject: SV: How can i put a dynamic value to an html:hidden ?


Hi

use html-el and then : html:hidden property=firstname
value=${member.firstname}/

-Opprinnelig melding-
Fra: John Antonakos [mailto:[EMAIL PROTECTED]
Sendt: 25. juni 2004 12:17
Til: [EMAIL PROTECTED]
Emne: How can i put a dynamic value to an html:hidden ?


I want to do something like the following:
html:hidden property=firstname value=bean name=member
property=firstname//

is this possible ?
The above statement produces an error.
Can i use another statement to do this thing ?
Give a dynamic value, coming from another bean,
to an html:hidden field ?

Regards, John


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *


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




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

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



AW: 2 deep nested forms (solution to 2 dimensional arrays with struts html tags)

2004-06-25 Thread René Zbinden
I'm not sure if i got the problem correctly. But have a look at the nested taglib too. 
Could make your jsp easier but renders to the same as below. 
http://jakarta.apache.org/struts/userGuide/struts-nested.html

http://www.keyboardmonkey.com/next/index.jsp

Hope it's of any use to you
René


-Ursprüngliche Nachricht-
Von: Mark Lowe [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 25. Juni 2004 09:33
An: Struts Users Mailing List
Betreff: Re: 2 deep nested forms (solution to 2 dimensional arrays with struts html 
tags)

No i was wrong works as i thought it would

Need to iterate through the values of the dishes map

public Object[] getDishes() {
return map.values().toArray();
}


%-- var could be anything the index us the important bit --% c:forEach var=dish 
items=${course.dishes} varStatus=index
%-- get the correctly indexed key from the getKeys array-% c:set var=key 
value=${course.keys[index.count - 1]} / html:text name=course 
property=dish(${key}.name indexed=true / /c:forEach

renders to


input type=text name=course[0].dish(key1).name value=Fish

input type=text name=course[0].dish(key2).name value=More Fish

On 25 Jun 2004, at 01:09, Mark Lowe wrote:

 No needs a rethink .

 indexed=true uses whatever iteration tags that its between.. Arses,, 
 drat and double drat.



 On 25 Jun 2004, at 00:27, Mark Lowe wrote:

 Not quite.. hang on.



 On 25 Jun 2004, at 00:14, Mark Lowe wrote:

 A question came up the other week/month where someone nesting 2 deep 
 and was trying to use a 2 dimesional array. I had the some problem 
 today and had my chance to combine indexed and mapped properties to 
 solve the problem.

 I want to create a Restaurant Menu editor. So a menu has a few 
 properties like title and start and end dates for seasonal menus.

 So I have 3 action form or nested pojo's


 MenuForm
 CourseForm
 DishBean

 I used lazyMap and lazyList to save scoping to session.


 MenuForm - has a lazyList or nested courses.
 CourseForm - has a lazyMap of dishes and a getKeys() method that 
 returns map.keySet().toArray()

 and dishes are just plain string properties.

 public DishBean getDish(String key)

 public void setDish(String key,DishBean dish)

 The jsp stuff looks something like this.

 html:text property=title /

 c:forEach var=course items=${menuForm.courses}
 html:text name=course property=title indexed=true /
 
 c:forEach var=key items=${course.keys}
 html:text name=course property=dish(${key}).name 
 indexed=true /
 /c:forEach

 /c:forEach

 its not quite as tidy as 2 dimensional array support, but it pretty 
 clean looking.



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



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



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



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



parameterized html:link problem

2004-06-25 Thread Navjot Singh
hi list,
I am not good in jsp views. Can someone tell me the way to accomplish 
the below?

I wish to generate is link a href=/myapp/View.do?CODE=ABCView/a
and i am doing this.
=
c:forEach items=${PRODS} var=prod
trtd
c:out value=${prod.productVo.name}/
html:link page='/View.do?CODE=c:out value=${prod.productVo.code}/' 
View /html:link

/td/tr
/c:forEach
=
but it generates a href=/myapp/View.do?CODE=c:out 
value=${prod.productVo.code}/'View/a

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


Re: parameterized html:link problem

2004-06-25 Thread Nicolas De Loof

c:forEach items=${PRODS} var=prod
 trtd
 
 c:out value=${prod.productVo.name}/
 
 html:link action=/View paramId=Name paramName=prod 
paramProperty=productVo.code
 View /html:link
 
 /td/tr
/c:forEach

http://jakarta.apache.org/struts/userGuide/struts-html.html#link

Nico.


 hi list,
 
 I am not good in jsp views. Can someone tell me the way to accomplish 
 the below?
 
 I wish to generate is link a href=/myapp/View.do?CODE=ABCView/a
 and i am doing this.
 
 =
 c:forEach items=${PRODS} var=prod
 trtd
 
 c:out value=${prod.productVo.name}/
 
 html:link page='/View.do?CODE=c:out value=${prod.productVo.code}/' 
 View /html:link
 
 /td/tr
 /c:forEach
 =
 
 but it generates a href=/myapp/View.do?CODE=c:out 
 value=${prod.productVo.code}/'View/a
 
 TIA
 Navjot Singh
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Our name has changed.  Please update your address book to the following format: 
[EMAIL PROTECTED].

This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized to read, 
print, retain, copy, disseminate,  distribute, or use this message or any part 
thereof. If you receive this  message in error, please notify the sender immediately 
and delete all  copies of this message.


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



Re: AW: 2 deep nested forms (solution to 2 dimensional arrays with struts html tags)

2004-06-25 Thread Mark Lowe
I haven't played with netsted tags for a while, I always preferred 
seeing where in indexed properties were. I have to confess it 
completely escaped my attention.

Mark
On 25 Jun 2004, at 13:55, René Zbinden wrote:
I'm not sure if i got the problem correctly. But have a look at the 
nested taglib too. Could make your jsp easier but renders to the same 
as below.
http://jakarta.apache.org/struts/userGuide/struts-nested.html

http://www.keyboardmonkey.com/next/index.jsp
Hope it's of any use to you
René
-Ursprüngliche Nachricht-
Von: Mark Lowe [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 25. Juni 2004 09:33
An: Struts Users Mailing List
Betreff: Re: 2 deep nested forms (solution to 2 dimensional arrays 
with struts html tags)

No i was wrong works as i thought it would
Need to iterate through the values of the dishes map
public Object[] getDishes() {
return map.values().toArray();
}
%-- var could be anything the index us the important bit --% 
c:forEach var=dish items=${course.dishes} varStatus=index
%-- get the correctly indexed key from the getKeys array-% c:set 
var=key value=${course.keys[index.count - 1]} / html:text 
name=course property=dish(${key}.name indexed=true / 
/c:forEach

renders to
input type=text name=course[0].dish(key1).name value=Fish
input type=text name=course[0].dish(key2).name value=More Fish
On 25 Jun 2004, at 01:09, Mark Lowe wrote:
No needs a rethink .
indexed=true uses whatever iteration tags that its between.. Arses,,
drat and double drat.

On 25 Jun 2004, at 00:27, Mark Lowe wrote:
Not quite.. hang on.

On 25 Jun 2004, at 00:14, Mark Lowe wrote:
A question came up the other week/month where someone nesting 2 deep
and was trying to use a 2 dimesional array. I had the some problem
today and had my chance to combine indexed and mapped properties to
solve the problem.
I want to create a Restaurant Menu editor. So a menu has a few
properties like title and start and end dates for seasonal menus.
So I have 3 action form or nested pojo's
MenuForm
CourseForm
DishBean
I used lazyMap and lazyList to save scoping to session.
MenuForm - has a lazyList or nested courses.
CourseForm - has a lazyMap of dishes and a getKeys() method that
returns map.keySet().toArray()
and dishes are just plain string properties.
public DishBean getDish(String key)
public void setDish(String key,DishBean dish)
The jsp stuff looks something like this.
html:text property=title /
c:forEach var=course items=${menuForm.courses}
html:text name=course property=title indexed=true /

c:forEach var=key items=${course.keys}
html:text name=course property=dish(${key}).name
indexed=true /
/c:forEach
/c:forEach
its not quite as tidy as 2 dimensional array support, but it pretty
clean looking.


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

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

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

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


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


Re: AW: 2 deep nested forms (solution to 2 dimensional arrays with struts html tags)

2004-06-25 Thread Mark Lowe
Sat under my nose all the time :o)

On 25 Jun 2004, at 15:06, Mark Lowe wrote:
I haven't played with netsted tags for a while, I always preferred  
seeing where in indexed properties were. I have to confess it  
completely escaped my attention.

Mark
On 25 Jun 2004, at 13:55, René Zbinden wrote:
I'm not sure if i got the problem correctly. But have a look at the  
nested taglib too. Could make your jsp easier but renders to the same  
as below.
http://jakarta.apache.org/struts/userGuide/struts-nested.html

http://www.keyboardmonkey.com/next/index.jsp
Hope it's of any use to you
René
-Ursprüngliche Nachricht-
Von: Mark Lowe [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 25. Juni 2004 09:33
An: Struts Users Mailing List
Betreff: Re: 2 deep nested forms (solution to 2 dimensional arrays  
with struts html tags)

No i was wrong works as i thought it would
Need to iterate through the values of the dishes map
public Object[] getDishes() {
return map.values().toArray();
}
%-- var could be anything the index us the important bit --%  
c:forEach var=dish items=${course.dishes} varStatus=index
%-- get the correctly indexed key from the getKeys array-% c:set  
var=key value=${course.keys[index.count - 1]} / html:text  
name=course property=dish(${key}.name indexed=true /  
/c:forEach

renders to
input type=text name=course[0].dish(key1).name value=Fish
input type=text name=course[0].dish(key2).name value=More Fish
On 25 Jun 2004, at 01:09, Mark Lowe wrote:
No needs a rethink .
indexed=true uses whatever iteration tags that its between..  
Arses,,
drat and double drat.


On 25 Jun 2004, at 00:27, Mark Lowe wrote:
Not quite.. hang on.

On 25 Jun 2004, at 00:14, Mark Lowe wrote:
A question came up the other week/month where someone nesting 2  
deep
and was trying to use a 2 dimesional array. I had the some problem
today and had my chance to combine indexed and mapped properties to
solve the problem.

I want to create a Restaurant Menu editor. So a menu has a few
properties like title and start and end dates for seasonal menus.
So I have 3 action form or nested pojo's
MenuForm
CourseForm
DishBean
I used lazyMap and lazyList to save scoping to session.
MenuForm - has a lazyList or nested courses.
CourseForm - has a lazyMap of dishes and a getKeys() method that
returns map.keySet().toArray()
and dishes are just plain string properties.
public DishBean getDish(String key)
public void setDish(String key,DishBean dish)
The jsp stuff looks something like this.
html:text property=title /
c:forEach var=course items=${menuForm.courses}
html:text name=course property=title indexed=true /

c:forEach var=key items=${course.keys}
html:text name=course property=dish(${key}).name
indexed=true /
/c:forEach
/c:forEach
its not quite as tidy as 2 dimensional array support, but it pretty
clean looking.

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


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


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

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


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


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


RE: Role based filter with struts

2004-06-25 Thread Pingili, Madhupal

If the web container supports servlet 2.2 only, then options are to 
either subclass request processor or creating abstract base 
action class to check the roles. 
Of course, you can always check the roles in any action's execute method
or in any JSP because you have access to ActionMapping 
and HttpServletRequest.

If the web container supports servlet 2.3, I just want to know if there is
any better
option i.e. can we create a servlet filter to check roles? In other words,
can a filter
access ActionMapping and HttpServletRequest of a particular request.  

---
Reddy Pingili

 -Original Message-
 From: Shilpa Vaidya [SMTP:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 6:29 AM
 To:   [EMAIL PROTECTED]
 Subject:  Role based filter with struts
 
  javen
 perhaps this will help you.Coz on this mail, I implemented my part
 successfully
 Since the day I am in great awefor the Group and and their help
 cheers
 shilpa
 
 
 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow
 Sent: Friday, June 04, 2004 6:39 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Security and Struts (JAAS?)
 
 
 Ralf,
 
 Forgive me if I misintrepreted what you are asking, but I believe what
 you are wanting to use the Struts role attribute on actions for
 application-managed security.
 
 One way is to put a check on every page as was suggested and is done in
 the Struts example.
 
 Another way is to provide a custom RequestProcessor -- this is easier
 than it sounds ...
 
 The roles attribute on action is processed via the
 RequestProcessor.processRoles() method. You will want to override this
 method in a Custom Request Processor -- something like:
 code
 public class CustomRequestProcessor extends RequestProcessor {
protected boolean processRoles(HttpServletRequest request,
HttpServletResponse response,
ActionMapping mapping)
   throws IOException, ServletException {
 
   // Is this action protected by role requirements?
   String roles[] = mapping.getRoleNames();
   if ((roles == null) || (roles.length  1)) {
 return (true);
   }
 
   // Check the current user against the list of required roles
   HttpSession session = request.getSession();
   User user = (User) session.getAttribute(user);
 
   if (user == null) {
 return false;
   }
 
   for (int i = 0; i  roles.length; i++) {
 if (user.hasRole(roles[i])) {
   return (true);
 }
   }
 
   response.sendError(HttpServletResponse.SC_BAD_REQUEST,
   getInternal().getMessage(notAuthorized,mapping.getPath()));
   return (false);
}
 }
 /code
 
 Ralf Bode wrote:
  Hi, i have a portal based on struts.
  and i have some public action.
  (e.g for listing news and so on)
  however.
  my problem is the protected area.
  i have two roles.
  -customer
  -supplier
 
  both login via ONE Action
  (i got their roles via their usernames...)
  okay, i saved something in session
  and did if(session...) in an action,
  before a user (a logged in) could
  do some stuff.
 
  it works okay, but only
  if the user enters a URL like
  host:8080/trashApp/cust/addStuff.do
  (for submitting a form)
  i got validation.errors ...
  because the execute() of my action is not called...
 
  so i figured out, that i can use ROLES-attribute
  for action. nice, but this is jaas, isn't it?
 
  now the (for me) interessting point.
  can i add a user (or roles) manually in my
  LogonAction.execute() ?
  and when, how?
 
  or how to deal generally?
  with two user-roles and ONE-LogonAction.class ?
 
  i also watched tomcat-app, that uses struts/jaas for
  authorization, but only with ONE role.
 
  so is there anyone out, how has a tip/solution
  for me?
 
  thanks alot!
 
  Ralf
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -- 
 
 
 This e-mail message may contain confidential, proprietary or legally
 privileged information. It 
 should not be used by anyone who is not the original intended recipient.
 If you have erroneously 
 received this message, please delete it immediately and notify the sender.
 The recipient 
 acknowledges that ICICI Bank or its subsidiaries and associated companies,
 (collectively ICICI 
 Group), are unable to exercise control or ensure or guarantee the
 integrity of/over the contents of the information contained in e-mail
 transmissions and further acknowledges that any views 
 expressed in this message are those of the individual sender and no
 binding nature of the message shall be implied or assumed unless the
 sender does so expressly with due authority of ICICI Group.Before opening
 any attachments please check them for viruses and defects. 
 
 

-
To 

RE: [OT] FW: Timothy J Theis is out of the office

2004-06-25 Thread Hookom, Jacob
It's a local number for me... maybe I should chat with Mike for a while and
see how Tim's vacation is going.

-Original Message-
From: Andy Engle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 24, 2004 11:36 PM
To: Struts Users Mailing List
Subject: Re: [OT] FW: Timothy J Theis is out of the office

Robert Taylor [EMAIL PROTECTED] wrote:

 Should we call Mike, and tell him to tell Tim to unsubscribe when
 he is out of the office :)

I think we should.  How annoying!

Or we could have one of the list managers to unsubscribe him for us.


Andy


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

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



Re: Getting index value of iteration

2004-06-25 Thread Rick Reumann
Wendy Smoak wrote:
From: Tom McCobb [mailto:[EMAIL PROTECTED] 
In another section of the page I display an iterated list of 
items in a collection. 
I am stuck on how to get the value of i, the index of the row
wherein the button was clicked.
Are you willing to use JSTL?  The c:forEach tag has 'varStatus' which
will give you the integer position as you loop through the collection.
This won't be exactly right, I haven't worked with it for a while,
but...
c:forEach items=${myCollection} var=myItem varStatus=myLoopIndex
c:out value=${myLoopIndex}/ 
c:out value=${myItem}/
/c:forEach

Are these links, or do you need to submit the form with the index as one
of the form properties?  Do you have any objection to JavaScript?
With Struts-EL and JSTL, I haven't needed to venture into the Nested
taglib, although I understand there are things it can do that
Struts-EL/JSTL cannot.  This may be one of them...
Actually you can do everything with JSTL/EL that the nested tag does, 
but I must admit the nested tag makes things cleaner. In the above it 
doesn't matter much because you don't have Lists nested within each other.

Imagine a case, though, where you had a Company object that a Collection 
of divisions and then each division had a collection of departments and 
you want to display a form that lest you edit the departments in each 
division. You'll see the benefit of nested below (sorry for the ugly 
wrapping you'll get. If you want I can send the example to you offlist).

%-- JSTL way --%
c:forEach items=${companyForm.divisions} var=division 
varStatus=divstatus

Division: html:text property=divisions[${divstatus.index}].name 
value=${division.name} /br

	c:forEach items=${division.departments} var=department 
varStatus=depstatus
		--- Department: html:text 
property=divisions[${divstatus.index}].departments[${depstatus.index}].name 
value=${department.name} /br
/c:forEach

/c:forEach
%-- Nested tag way Notice how much less to write out--%
nested:iterate property=divisions
Division: nested:text property=name /br
nested:iterate property=departments
--- Department: nested:text property=name /br
/nested:iterate
/nested:iterate

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


Re: parameterized html:link problem

2004-06-25 Thread Navjot Singh
thx nicolas,
It worked. Though i had read the link you mentioned but couldn't get it.
Sometimes, examples can teach you better.
thx again
navjot
Nicolas De Loof wrote:
c:forEach items=${PRODS} var=prod
 trtd
 
 c:out value=${prod.productVo.name}/
 
 html:link action=/View paramId=Name paramName=prod paramProperty=productVo.code
 View /html:link
 
 /td/tr
/c:forEach

http://jakarta.apache.org/struts/userGuide/struts-html.html#link
Nico.

hi list,
I am not good in jsp views. Can someone tell me the way to accomplish 
the below?

I wish to generate is link a href=/myapp/View.do?CODE=ABCView/a
and i am doing this.
=
c:forEach items=${PRODS} var=prod
trtd
c:out value=${prod.productVo.name}/
html:link page='/View.do?CODE=c:out value=${prod.productVo.code}/' 
View /html:link

/td/tr
/c:forEach
=
but it generates a href=/myapp/View.do?CODE=c:out 
value=${prod.productVo.code}/'View/a

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

Our name has changed.  Please update your address book to the following format: [EMAIL 
PROTECTED].
This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized to read, 
print, retain, copy, disseminate,  distribute, or use this message or any part 
thereof. If you receive this  message in error, please notify the sender immediately 
and delete all  copies of this message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Getting index value of iteration

2004-06-25 Thread Mark Lowe
Thanks Rick.
You've shown me exactly how to do what i need do and I didn't even ask  
the question :o)

2 deep indexed properties and no nested tag llib.

On 25 Jun 2004, at 16:03, Rick Reumann wrote:
Wendy Smoak wrote:
From: Tom McCobb [mailto:[EMAIL PROTECTED] In another section  
of the page I display an iterated list of items in a collection. I  
am stuck on how to get the value of i, the index of the row
wherein the button was clicked.
Are you willing to use JSTL?  The c:forEach tag has 'varStatus'  
which
will give you the integer position as you loop through the collection.
This won't be exactly right, I haven't worked with it for a while,
but...
c:forEach items=${myCollection} var=myItem  
varStatus=myLoopIndex
c:out value=${myLoopIndex}/ c:out value=${myItem}/
/c:forEach
Are these links, or do you need to submit the form with the index as  
one
of the form properties?  Do you have any objection to JavaScript?
With Struts-EL and JSTL, I haven't needed to venture into the Nested
taglib, although I understand there are things it can do that
Struts-EL/JSTL cannot.  This may be one of them...
Actually you can do everything with JSTL/EL that the nested tag does,  
but I must admit the nested tag makes things cleaner. In the above it  
doesn't matter much because you don't have Lists nested within each  
other.

Imagine a case, though, where you had a Company object that a  
Collection of divisions and then each division had a collection of  
departments and you want to display a form that lest you edit the  
departments in each division. You'll see the benefit of nested below  
(sorry for the ugly wrapping you'll get. If you want I can send the  
example to you offlist).

%-- JSTL way --%
c:forEach items=${companyForm.divisions} var=division  
varStatus=divstatus

Division: html:text property=divisions[${divstatus.index}].name  
value=${division.name} /br

	c:forEach items=${division.departments} var=department  
varStatus=depstatus
		--- Department: html:text  
property=divisions[${divstatus.index}].departments[${depstatus.index}] 
.name value=${department.name} /br
/c:forEach

/c:forEach
%-- Nested tag way Notice how much less to write out--%
nested:iterate property=divisions
Division: nested:text property=name /br
nested:iterate property=departments
--- Department: nested:text property=name /br
/nested:iterate
/nested:iterate

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

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


strange problem while implementing validation

2004-06-25 Thread jpatel
Hello
I'm running Eclipse with Tomcat 5.0.18 and Struts 1.1. Since I use validation my
application sometimes dies at startup. When I restart the server it throws the
following exeption:

--
java.lang.NullPointerException
at
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:316)

at org.apache.jsp.index$jsp._jspService(index$jsp.java:741)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


-Jignesh 



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



Re: Getting index value of iteration

2004-06-25 Thread Rick Reumann
Mark Lowe wrote:
Thanks Rick.
You've shown me exactly how to do what i need do and I didn't even ask  
the question :o)
Glad I could help. Someone actually showed me how to do that using JSTL. 
He's now moved on to using Spring now that loser:)

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


image submit and lookupDispatchAction - drives me struts

2004-06-25 Thread Axel Groß
hi there!

i wanted to use images to hide my ugly submit button names, but exchanging
html:submit with html:image doesn't work;
this is what is rendered:

html:submit property=action
fmt:message key=profiles_action_${ownerName}_${prepopulatedActionPart}/
/html:submitbr/
html:image src=images/edit-button.jpg property=action
fmt:message key=profiles_action_${ownerName}_${prepopulatedActionPart}/
/html:imagebr/

bean:define id=editButton type=java.lang.Stringfmt:message
key=profiles_action_${ownerName}_${prepopulatedActionPart}//bean:define
html:submit property=action value=${editButton}/br/
html:image src=images/edit-button.jpg property=action value=${editButton}/


gets rendered to
 input type=submit name=action value=EDIT_USER /br/
 input type=image name=action src=images/edit-button.jpg /
input type=submit name=action value=EDIT_USER /br/
input type=image name=action src=images/edit-button.jpg value=EDIT_USER /


so the html:submit buttons do work, but neither of the html:image buttons 
pass the parameter on and i get a null reference for
 request.getParameter(parameter);
(with parameter.equals(action))

the resulting error message is:
 Request[/action/lookupDispatch] does not contain handler parameter named action


anybody knows what could help?
thanks,
axel

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



Re: Getting index value of iteration

2004-06-25 Thread Mark Lowe
I'm using spring too, albeit not for the web stuff.
Haven't looked into spring web tier wise, not sure it has anything for 
forms.

On 25 Jun 2004, at 17:23, Rick Reumann wrote:
Mark Lowe wrote:
Thanks Rick.
You've shown me exactly how to do what i need do and I didn't even 
ask  the question :o)
Glad I could help. Someone actually showed me how to do that using 
JSTL. He's now moved on to using Spring now that loser:)

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

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


RE: image submit and lookupDispatchAction - drives me struts

2004-06-25 Thread Wendy Smoak
 From: Axel Groß [mailto:[EMAIL PROTECTED] 
 so the html:submit buttons do work, but neither of the 
 html:image buttons 
 pass the parameter on and i get a null reference for
  request.getParameter(parameter);
 (with parameter.equals(action))
 the resulting error message is:
  Request[/action/lookupDispatch] does not contain handler 
 parameter named action
 anybody knows what could help?

http://www.google.com/search?q=struts+image+button

First hit: 
http://www.jguru.com/faq/view.jsp?EID=893423
which discusses the use of the ImageButtonBean class.

Or, my preferred solution is a bit of onClick JavaScript to set the form property and 
submit the form.  This only works in situations where where you can require that 
JavaScript be enabled.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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



custom error message handling

2004-06-25 Thread Nathan Maves
Currently I use the validator with my forms.
I am looking for a way to test if there was an error for a specified 
field.

I still want the list of errors produced by html:errors/ at the top 
but I would like to place something like ** next to any field that 
had errors.

Can this be done with either the struts tags or JSTL?
Nathan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: strange problem while implementing validation

2004-06-25 Thread Gaurav_Goyal
Looks to me like something in doStartTag is looking for something from
request or session and its not finding it since its a startup and so it
throws an exception.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, June 25, 2004 10:12 AM
To: 'Struts Users Mailing List'
Subject: strange problem while implementing validation


Hello
I'm running Eclipse with Tomcat 5.0.18 and Struts 1.1. Since I use
validation my
application sometimes dies at startup. When I restart the server it throws
the
following exeption:

--
java.lang.NullPointerException
at
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptVa
lidatorTag.java:316)

at org.apache.jsp.index$jsp._jspService(index$jsp.java:741)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


-Jignesh 



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

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



DynaValidatorActionForm.validate(DynaValidatorActionForm.java:115)

2004-06-25 Thread Assaf Nehoray
Dear user group,

I am having this constant exception thrown several
times a day. I am not able to reproduce it but I know
my visitors get it:

2004-06-24 18:45:00 StandardWrapperValve[action]:
Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at
org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorActionForm.java:115)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
com.mycompany.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:343)
at
org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:131)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)

I am using a wizard like form (several pages). The
only clue I have is that I do not get this error on
pages in which the validator does not use the page
attribute. On multiple page forms I get this error. 

Anyone with a suggestion as how to solve it or further
look into it?

Thanx,

Assaf






Problem With Struts-config. Pls Reply ASAP

2004-06-25 Thread kiranjeevan
Dear Friends,
I'm a bit out of touch with coding. My need is to display some 
orderdetails after a successful Login. So I have a Login View and a 
SucessView. So the orderDetails are picked up as a vector from the 
DAO and throu Delegate returned to the SuccessView. I display the 
OrderDetails using Logic-iterate.  I'm also using Tiles. This works 
fine if I have an intermediate JSP in the Login View which has a 
Button Action which inturn calls the DisplayOrders Action. 

so my intermediate JSP Looks Like this :

html:form action=/displayOrders

table width=98% height=78% border=0 cellspacing=0 
cellpadding=0 
  tr
td width=9%nbsp;/td
td width=91% Valign=top class=lg_title!-- 
#BeginEditable Body1 --font color=#CC face=Arial, 
Helvetica, sans-serifbfont color=#00br
  Display Orders/font/b/fontfont color=#CC 
face=Arial, Helvetica, sans-serifbbr
  br
  /b/font
  br
  br
  br
  br
  font color=black
  input type=submit align=center class=frmBtnS value=Search 
name=action onclick=doSetUserAction('%
=SucessView.ACTION_DISPLAY_ORDER_LIST %')/font font color=black
 ..

And My Struts-config looks Like this: 

action  path=/Login
   
type=com.equifax.emortgage.abstractui.GenericStrutsAction
   name=com.equifax.emortgage.ui.LoginView
   input=/jsp/Login.jsp
   scope=request
   validate=true
forward name=com.equifax.emortgage.ui.LoginView 
path=LoginViewResult/ 
   /action
   
   
action  path=/displayOrders
   
type=com.equifax.emortgage.abstractui.GenericStrutsAction
   name=com.equifax.emortgage.ui.SucessView
   scope=request
   validate=true
forward name=com.equifax.emortgage.ui.SucessView 
path=displayOrders/ 

 /action


And my Forward  Definition.xml  looks Like this:


definition name=LoginViewResult path=/jsp/MasterLayout.jsp
  put name=header value=/jsp/Eheader.jsp/
  put name=body value=/jsp/appHome.jsp/
  put name=footer value=/jsp/Efooter.jsp/  
  /definition
  
 
  definition name=displayOrders 
path=/jsp/MasterLayout.jsp
  put name=header value=/jsp/Eheader.jsp/
  put name=body value=/jsp/success.jsp/
  put name=footer value=/jsp/Efooter.jsp/  
  /definition


Now Instead of calling appHome.JSP which inturn calls success.jsp how 
can I call success.jsp directly. ?


 Pls tell me the changes to be made in struts-config.xml. and forward-
definition.xml.
thanks in advance,
regards,
kiran
 



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



Recommend Struts Plugins for Eclipse?

2004-06-25 Thread e-denton Java Programmer
I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
recommend for Struts, Tomcat, JBoss, XML, etc development?

Thanks for your opinions.


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



RE: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread James Holmes
You may want to checkout Struts Console:

http://www.jamesholmes.com/struts/

It has support for editing Struts, Tiles and Validator configuration files
as well as support for JST Tag Library Descriptors (TLDs).

Hope that helps,

James

-Original Message-
From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 25, 2004 12:16 PM
To: [EMAIL PROTECTED]
Subject: Recommend Struts Plugins for Eclipse?

I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
recommend for Struts, Tomcat, JBoss, XML, etc development?

Thanks for your opinions.


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


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



Re: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread Eric Schneider
The JBoss eclipse plugin is way helpful.
Here's an article on how to set it up.
http://www.devx.com/opensource/Article/20242
Cheers,
Eric
On Jun 25, 2004, at 1:15 PM, e-denton Java Programmer wrote:
I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
recommend for Struts, Tomcat, JBoss, XML, etc development?
Thanks for your opinions.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


NEWBIE: how to submit a named html:form via javascript

2004-06-25 Thread Adam Lipscombe

Folks,

I want to submit a named html:form. e.g.

html:form name=helpForm action=/help method=POST
   map name=Map
  area shape=rect coords=2,0,50,13 href=
onclick=javascript:document.helpForm.submit() 
   /map
/html:form


Wit the above construct Struts complains that the form requires a type
attribute - it seems to want me to specify the classname of the ActionForm
as the type.

My understanding is that Struts deduces the ActionForm to use automatically
from the struts-config action definition. Is this correct?


I know I could use javascript:document.forms[n].submit() but I would
prefer to submit the named form so that if further forms are added to the
page it does not mess up the submit.

Is this possible? How?


TIA - Adam


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



RE: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread James Mitchell

MyEclipse [0] works pretty good.  I also have seen Nitrox [1], but have yet
to evaluate it.

[0]
http://www.myeclipseide.com/

[1]
http://www.m7.com/
http://www.theserverside.com/news/thread.tss?thread_id=26427



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
http://www.EdgeTechServices.net/
678.910.8017
AIM: jmitchtx
 

 -Original Message-
 From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
 Sent: Friday, June 25, 2004 1:16 PM
 To: [EMAIL PROTECTED]
 Subject: Recommend Struts Plugins for Eclipse?
 
 I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
 recommend for Struts, Tomcat, JBoss, XML, etc development?
 
 Thanks for your opinions.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



RE: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread James Mitchell

MyEclipse [0] works pretty good.  I also have seen Nitrox [1], but have yet
to evaluate it.

[0]
http://www.myeclipseide.com/

[1]
http://www.m7.com/
http://www.theserverside.com/news/thread.tss?thread_id=26427



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
http://www.EdgeTechServices.net/
678.910.8017
AIM: jmitchtx
 

 -Original Message-
 From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
 Sent: Friday, June 25, 2004 1:16 PM
 To: [EMAIL PROTECTED]
 Subject: Recommend Struts Plugins for Eclipse?
 
 I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
 recommend for Struts, Tomcat, JBoss, XML, etc development?
 
 Thanks for your opinions.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



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



RE: NEWBIE: how to submit a named html:form via javascript

2004-06-25 Thread Jim Barrows
The name is optional.  I never use it in the form.  For JavaScript porpoises I use the 
name of the 
ActionForm your using in the struts config.

 -Original Message-
 From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 10:27 AM
 To: 'Struts Users Mailing List'
 Subject: NEWBIE: how to submit a named html:form via javascript
 
 
 
 Folks,
 
 I want to submit a named html:form. e.g.
 
 html:form name=helpForm action=/help method=POST
map name=Map
   area shape=rect coords=2,0,50,13 href=
 onclick=javascript:document.helpForm.submit() 
/map
 /html:form
 
 
 Wit the above construct Struts complains that the form 
 requires a type
 attribute - it seems to want me to specify the classname of 
 the ActionForm
 as the type.
 
 My understanding is that Struts deduces the ActionForm to use 
 automatically
 from the struts-config action definition. Is this correct?
 
 
 I know I could use javascript:document.forms[n].submit() but I would
 prefer to submit the named form so that if further forms are 
 added to the
 page it does not mess up the submit.
 
 Is this possible? How?
 
 
 TIA - Adam
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



RE: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread Shabalov, Igor
Struts Studio. The best...

-Original Message-
From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 25, 2004 10:16 AM
To: [EMAIL PROTECTED]
Subject: Recommend Struts Plugins for Eclipse?


I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
recommend for Struts, Tomcat, JBoss, XML, etc development?

Thanks for your opinions.


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


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



Re: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread Henrique VIECILI
You can try www.myeclipseide.org

Henrique Viecili
  - Original Message - 
  From: Shabalov, Igor 
  To: Struts Users Mailing List ; e-denton Java Programmer 
  Sent: Friday, June 25, 2004 2:31 PM
  Subject: RE: Recommend Struts Plugins for Eclipse?


  Struts Studio. The best...

  -Original Message-
  From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
  Sent: Friday, June 25, 2004 10:16 AM
  To: [EMAIL PROTECTED]
  Subject: Recommend Struts Plugins for Eclipse?


  I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
  recommend for Struts, Tomcat, JBoss, XML, etc development?

  Thanks for your opinions.


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


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


Re: R: Struts and PL/SQL

2004-06-25 Thread Daniel H. F. e Silva
Hi,

  You are talking about dynamic SQL in stored procedures. But there is a nice option
that provides you dynamic SQL alike features: iBATIS SQL MAPS. When you declare your
statements inside map config file, you can use a set of tags to build your statement
according to parameters you pass to your statement. It works nicely for me.
  Take a look on it: www.ibatis.com

Cheers,
 Daniel Silva.

--- Grassi Fabio [EMAIL PROTECTED] wrote:
 Yes, what you ask is possible, here is a minimal but working example:
 
 create or replace function test(obj_name in varchar2) return sys_refcursor is
   result sys_refcursor;
   sql_string varchar2(2000);
 begin
   sql_string := 'select * from user_objects';
   if obj_name is not null then
 sql_string := sql_string || ' where object_name like ''' || obj_name || '%''';
   end if;
   open result for sql_string;
   return result;
 end test;
 
 Please note that main reason I use stored procedure is to decouple the physical data 
 structure
 from the application. In order to keep this separation clean in your scenario I 
 would in some
 way abstract the dynamic filters (i.e. I would not use column or table names as 
 parameters).
 
 Note also that dynamic sql is not as performant as precompiled pl/sql code (but not 
 less
 performant than a client-built query) and more error-prone, so unless the logic gets 
 *very*
 complicated I prefer using if/elsif/else/end blocks and have some code duplicated.
 
 Bye, Fabio.
 
 
  -Messaggio originale-
  Da: Chris Cranford [mailto:[EMAIL PROTECTED] 
  Inviato: giovedì 24 giugno 2004 13:27
  A: Struts Users Mailing List
  Oggetto: Re: Struts and PL/SQL
  
  
  You done any type of experimentation with dynamic SQL in your 
  procedures?
  
  We have a form that accepts tons of input values from the web 
  user which
  eventually get translated into 1 SQL query to pull back the 
  data-set the
  user is looking for.  The problem is that nesting select 
  statements slows
  done the query, so in some cases, we create a 
  callablestatement, generate
  the list of IDs on the java side and simply make those part 
  of the query
  itself inline causing the query to run much faster.  There 
  are other form
  values that would reqiure we either append or not append additional
  constraints to our SQL.
  
  In my procedure, I could easily include all this logic and 
  have a multitude
  of IF/ELSIF/ENDIF statements which describe the logic but then I have
  multiple copies of the SQL query to maintain on each 
  IF-structure branch
  which I would prefer not to do.  Is there a way where the 
  string-append
  approach can be used in Oracle so that after all the 
  conditions have been
  met, I simply open my cursor once to retreive the data in a PL/SQL
  procedure?
  
  Thanks
  Chris
  
  - Original Message -
  From: Grassi Fabio [EMAIL PROTECTED]
  To: Lucas Gonzalez [EMAIL PROTECTED]; Struts Users
  Mailing List [EMAIL PROTECTED]
  Sent: Thursday, June 24, 2004 5:31 AM
  Subject: R: Struts and PL/SQL
  
  
  Hi, in my application all DB access goes through PL/SQL 
  stored procedures. I
  use Oracle JPublisher to generate the Java classes that map 
  PL/SQL packages.
  It works fine enough.
  
  Bye, Fabio.
  
   -Messaggio originale-
   Da: Lucas Gonzalez [mailto:[EMAIL PROTECTED]
   Inviato: mercoledì 23 giugno 2004 20:07
   A: Struts Users Mailing List
   Oggetto: Struts and PL/SQL
  
  
   Hi all!
  
   I´ve been using Struts a lot with EJB and Hibernate with no 
  problems.
  
   But I always wondered if it´s possible to use an architecture
   that uses
   STRUTS and goes directly to PL/SQL for the database layer. I
   know it is
   possible in many way, but I would like to know if there is 
  any special
   product or package that integrates with PL ( the only one I found is
   http://portalstudio.oracle.com/servlet/page?_pageid=473_dad=o
  ps_schema=OPSTUDIO ) ... any pointers?
  
  Thanks a lot
  Lucas
  
  Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni 
  contenute in
  questo messaggio sono riservate ed a uso esclusivo del 
  destinatario. Qualora
  il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad
  eliminarlo senza copiarlo e a non inoltrarlo a terzi, 
  dandocene gentilmente
  comunicazione. Grazie.BRBRPursuant to Legislative Decree 
  No. 196/2003,
  you are hereby informed that this message contains 
  confidential information
  intended only for the use of the addressee. If you are not 
  the addressee,
  and have received this message by mistake, please delete it 
  and immediately
  notify us. You may not copy or disseminate this message to 
  anyone. Thank
  you.
  
  
  
 Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo 
 messaggio sono
 riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le 
 fosse pervenuto
 per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, 
 dandocene
 

Trying to learn Struts, need help understanding design process

2004-06-25 Thread Jamison Roberts
I've been a C#/.Net developer for two years.  Recently my company has
decided to move towards Java/Struts, so i've spent the last three
weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
Ant, and Struts.

Struts is the last thing i've tried to tackle, and I thought I had a
handle on it, however I don't.  I'm not sure of the best (or
correct/standard) way of doing simple things.  I've read that if I
ever have a *.jsp showing in the address bar outside of the entry
page, i've done something wrong.

I'd like to give an example, and hear suggestions on the correct way
to implement such an idea.  Simple example to follow...

Let's say I have a database that contains a two tables:  one called
teams, and one called riders.  There is a one-to-many relationship
between teams and riders based on a teamid.

In the teams table, we have the following data (Primary Key in parens):
(1) USPS
(2) T-Mobile
(3) Cofidis
(4) Phonak
...

In the riders table, we have this data (relationship in parens):
Lance Armstrong (teamid = 1)
George Hincapie (teamid = 1)
Jan Ullrich (teamid = 2)
Alexandre Vinokourov (teamid = 2)
David Millar (teamid = 3)
Tyler Hamilton (teamid = 4)
...

From the Index.jsp, there should be a link to another page that will
have a single select box, and a submit button.  The select box needs
to be populated with a list of teams/teamids from the database.

Upon submission of the form, all riders will be displayed in a table.

Pretty simple stuff, except I can't seem to figure out how to do it
with Struts.  The closest i've gotten is to have a static Teams.jsp
with an input-text box, which calls an Action to display the users. 
In otherwords my Index.jsp links to Teams.jsp, instead of something
like Teams.do (and I can't figure out how to populate a select box
from a Vector or other sort of list).

I apologize for asking simple questions, but i'm at the end of my rope
trying to figure out all these new technologies (new to my Microsoft
dominated world).

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



Re: [OT] File upload design question

2004-06-25 Thread Jim Collins
Hi Paul,

Thanks for the help. I will try that.

Regards

Jim
- Original Message -
From: Paul McCulloch [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Friday, June 25, 2004 9:30 AM
Subject: RE: [OT] File upload design question


 I implement this as follows:

 On session creation I create a directory in an 'uploads' directory using
 session id for the name

 Uploading a file copies the file into the session upload directory and
adds
 the filename (as a String) to a collection on my session scoped form bean.

 On submission of the form the full paths to the files, in the session
upload
 directory, are passed to my business layer which processes them.

 On session destruction the session upload directory is removed.

 Paul

  -Original Message-
  From: Jim Collins [mailto:[EMAIL PROTECTED]
  Sent: 24 June 2004 23:19
  To: Struts Users Mailing List
  Subject: [OT] File upload design question
 
 
  Hi,
 
  Appologies for the off topic posting. I am writing an
  application where a
  user fills in a form, can attach some files and when they
  submit the form it
  kicks off a workflow and saves any attached files to a
  content management
  system.
 
  This works fine using the struts file upload tools. What I
  would like to do
  though is have it work in a similar fasion to Yahoo mail when
  you send an
  email with attachments. The user when filling the form out
  attaches some
  files, these are then uploaded to the server. When the user
  then submits the
  form the workflow is kicked up and the files that were
  uploaded are moved to
  the content management system.
 
  The files are only copied across if the user submits the
  form. If the user
  uploads some files and then decide not to submit the form the
  files should
  be deleted.from the server.
 
  Does anyone have any ideas on a design for this so that I
  don't end up with
  lots of orphan files on the server and when the user submits
  a form the
  correct files are copied to the content management system?
 
  Thanks
 
  Jim
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 


 **
 Axios Email Confidentiality Footer
 Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such case, you should destroy this message, and notify
us immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
 WARNING:
 While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.
 **


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




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



RE: Trying to learn Struts, need help understanding design proces s

2004-06-25 Thread Barnett, Brian W.
A nice combination of tools/libraries we use is the display tag library to
display tabular data in a jsp page and iBATIS SQL Maps for data access.
Both are widely used as far as I know.

The iBATIS site also has a JPetStore demo based on Struts which provides a
great example (source code included) of how to implement a struts
application, based on best practices.

http://displaytag.sourceforge.net/
http://www.ibatis.com

Hope this helps.
Brian Barnett

-Original Message-
From: Jamison Roberts [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 25, 2004 12:46 PM
To: Struts Mailing List
Subject: Trying to learn Struts, need help understanding design process

I've been a C#/.Net developer for two years.  Recently my company has
decided to move towards Java/Struts, so i've spent the last three
weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
Ant, and Struts.

Struts is the last thing i've tried to tackle, and I thought I had a
handle on it, however I don't.  I'm not sure of the best (or
correct/standard) way of doing simple things.  I've read that if I
ever have a *.jsp showing in the address bar outside of the entry
page, i've done something wrong.

I'd like to give an example, and hear suggestions on the correct way
to implement such an idea.  Simple example to follow...

Let's say I have a database that contains a two tables:  one called
teams, and one called riders.  There is a one-to-many relationship
between teams and riders based on a teamid.

In the teams table, we have the following data (Primary Key in parens):
(1) USPS
(2) T-Mobile
(3) Cofidis
(4) Phonak
...

In the riders table, we have this data (relationship in parens):
Lance Armstrong (teamid = 1)
George Hincapie (teamid = 1)
Jan Ullrich (teamid = 2)
Alexandre Vinokourov (teamid = 2)
David Millar (teamid = 3)
Tyler Hamilton (teamid = 4)
...

From the Index.jsp, there should be a link to another page that will
have a single select box, and a submit button.  The select box needs
to be populated with a list of teams/teamids from the database.

Upon submission of the form, all riders will be displayed in a table.

Pretty simple stuff, except I can't seem to figure out how to do it
with Struts.  The closest i've gotten is to have a static Teams.jsp
with an input-text box, which calls an Action to display the users. 
In otherwords my Index.jsp links to Teams.jsp, instead of something
like Teams.do (and I can't figure out how to populate a select box
from a Vector or other sort of list).

I apologize for asking simple questions, but i'm at the end of my rope
trying to figure out all these new technologies (new to my Microsoft
dominated world).

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

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



Re: s:form tag in Struts-Faces

2004-06-25 Thread Josh Porter
I get the following exception:
javax.servlet.ServletException: java.lang.NullPointerException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:209) 
with root cause listed as
javax.faces.el.EvaluationException: java.lang.NullPointerException
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
at javax.faces.component.UIData.getValue(UIData.java:527)
at javax.faces.component.UIData.getDataModel(UIData.java:848)
at javax.faces.component.UIData.setRowIndex(UIData.java:379)
at javax.faces.component.UIData.iterate(UIData.java:890) 
Caused by: java.lang.NullPointerException
at 
org.apache.struts.faces.application.PropertyResolverImpl.getValue(PropertyResolverImpl.java:146)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at 
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173)
... 53 more

Matthias Wessendorf wrote:
Do you get any exceptions on submitting a form?
regards,
 

-Original Message-
From: Josh Porter [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 24, 2004 11:37 PM
To: [EMAIL PROTECTED]
Subject: s:form tag in Struts-Faces

I am trying to develop a web application using Struts, Tiles, and 
JavaServer Faces, connected by the Struts-Faces integration 
library. I 
can't seem to make the s:form tag work.

The code I wrote looks like:
s:form action=/search
The /search action is configured in struts-config.xml to forward to a 
search results tile.

The code renders like this:
form id=navbar:_id19 
action=/WebInterface/faces/start.jsp;jsessionid=B61380A7B5F73
72ABE0CA4D8FF109123 method=post

where start.jsp is the page the form is on. This happens with other 
forms too; when the s:form tag is rendered, the action attribute is 
directed back on the current page.

I read the following article, which proposed sort of a hack to solve 
this problem:
-- http://www-106.ibm.com/developerworks/library/j-integrate/
except this was written last September for an older version of 
Struts-Faces, and some of the code it tells you to change is 
different 
now. I couldn't get this to work.

How do I get around this problem? It seems like something 
pretty basic, 
so I apologize if this is something that's been well covered already, 
but I couldn't find information about it anywhere.

-- Josh
   

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


RE: Trying to learn Struts, need help understanding design process

2004-06-25 Thread Robert Taylor
A general design for this sort of thing would be to load your collection
of teams at application start up and put them into the ServletContext.

Define an action for displaying the teams page and an action for
processing the user input after they have selected a team. Define your
actions to forward to these pages and not redirect. The display action
can simply be a forward defined in your struts-config.xml since the
teams already exist in the ServletContext. You will have to subclass
one the many Action classes in order to process the user input subsequent
to their team selection.

The teams page can enlist the help of the html:optionsCollection .../
to render the drop down list.
http://jakarta.apache.org/struts/userGuide/struts-html.html#optionsCollection


As Brian already mentioned, you can utilize some third party tools like
the displayTag library found here http://displaytag.sourceforge.net/ to
render the riders in tabular format.

Hide your pages behind WEB-INF. Something like WEB-INF/pages/teams.jsp.
Note that most (but not all) web containers disallow direct access to 
resources which are in the WEB-INF directory. This helps enforce the 
MVC aspect of your web application.

There are several ways to tackle this problem and the above is just some
high level advice.


I would review (actually install and do a code trace) the Struts example
web apps.


hth,

robert





 -Original Message-
 From: Jamison Roberts [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 2:46 PM
 To: Struts Mailing List
 Subject: Trying to learn Struts, need help understanding design process
 
 
 I've been a C#/.Net developer for two years.  Recently my company has
 decided to move towards Java/Struts, so i've spent the last three
 weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
 Ant, and Struts.
 
 Struts is the last thing i've tried to tackle, and I thought I had a
 handle on it, however I don't.  I'm not sure of the best (or
 correct/standard) way of doing simple things.  I've read that if I
 ever have a *.jsp showing in the address bar outside of the entry
 page, i've done something wrong.
 
 I'd like to give an example, and hear suggestions on the correct way
 to implement such an idea.  Simple example to follow...
 
 Let's say I have a database that contains a two tables:  one called
 teams, and one called riders.  There is a one-to-many relationship
 between teams and riders based on a teamid.
 
 In the teams table, we have the following data (Primary Key in parens):
 (1) USPS
 (2) T-Mobile
 (3) Cofidis
 (4) Phonak
 ...
 
 In the riders table, we have this data (relationship in parens):
 Lance Armstrong (teamid = 1)
 George Hincapie (teamid = 1)
 Jan Ullrich (teamid = 2)
 Alexandre Vinokourov (teamid = 2)
 David Millar (teamid = 3)
 Tyler Hamilton (teamid = 4)
 ...
 
 From the Index.jsp, there should be a link to another page that will
 have a single select box, and a submit button.  The select box needs
 to be populated with a list of teams/teamids from the database.
 
 Upon submission of the form, all riders will be displayed in a table.
 
 Pretty simple stuff, except I can't seem to figure out how to do it
 with Struts.  The closest i've gotten is to have a static Teams.jsp
 with an input-text box, which calls an Action to display the users. 
 In otherwords my Index.jsp links to Teams.jsp, instead of something
 like Teams.do (and I can't figure out how to populate a select box
 from a Vector or other sort of list).
 
 I apologize for asking simple questions, but i'm at the end of my rope
 trying to figure out all these new technologies (new to my Microsoft
 dominated world).
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

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



RE: Trying to learn Struts, need help understanding design process

2004-06-25 Thread Jim Barrows
It almost seems like you're coming at this from the wrong end, with the page calling 
the action.  It's the other way around.  I know that with php and asp development is 
page centric.  In JSP it's action centric.  The page is just a display.
Something like this is what you want I think:
/context/showTeamSelection.do  -- populate your lists, collections in request scope 
would do it. and forward
to the JSP.  This can also be the ForwardAction if you have nothing to setup for the 
page.  Then later, if you do have something change the struts-config.xml to point at 
the new action, nothing else changes.

Person clicks submit, which goes to /context/teamSelected.do -- which pulls from the 
database, populates the
request scope with appropriate data and then forwards to the page.



 -Original Message-
 From: Jamison Roberts [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 11:46 AM
 To: Struts Mailing List
 Subject: Trying to learn Struts, need help understanding 
 design process
 
 
 I've been a C#/.Net developer for two years.  Recently my company has
 decided to move towards Java/Struts, so I've spent the last three
 weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
 Ant, and Struts.
 
 Struts is the last thing i've tried to tackle, and I thought I had a
 handle on it, however I don't.  I'm not sure of the best (or
 correct/standard) way of doing simple things.  I've read that if I
 ever have a *.jsp showing in the address bar outside of the entry
 page, i've done something wrong.
 
 I'd like to give an example, and hear suggestions on the correct way
 to implement such an idea.  Simple example to follow...
 
 Let's say I have a database that contains a two tables:  one called
 teams, and one called riders.  There is a one-to-many relationship
 between teams and riders based on a teamid.
 
 In the teams table, we have the following data (Primary Key 
 in parens):
 (1) USPS
 (2) T-Mobile
 (3) Cofidis
 (4) Phonak
 ...
 
 In the riders table, we have this data (relationship in parens):
 Lance Armstrong (teamid = 1)
 George Hincapie (teamid = 1)
 Jan Ullrich (teamid = 2)
 Alexandre Vinokourov (teamid = 2)
 David Millar (teamid = 3)
 Tyler Hamilton (teamid = 4)
 ...
 
 From the Index.jsp, there should be a link to another page that will
 have a single select box, and a submit button.  The select box needs
 to be populated with a list of teams/teamids from the database.
 
 Upon submission of the form, all riders will be displayed in a table.
 
 Pretty simple stuff, except I can't seem to figure out how to do it
 with Struts.  The closest i've gotten is to have a static Teams.jsp
 with an input-text box, which calls an Action to display the users. 
 In otherwords my Index.jsp links to Teams.jsp, instead of something
 like Teams.do (and I can't figure out how to populate a select box
 from a Vector or other sort of list).
 
 I apologize for asking simple questions, but i'm at the end of my rope
 trying to figure out all these new technologies (new to my Microsoft
 dominated world).
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



Is it possible to reuse the same FormBean with different actions?

2004-06-25 Thread Asif Rahman
I have a few jsp pages that use almost the same information.  I am using a formbean 
for one of them right now for validation.  Of course I'd like to re-use the this same 
bean with the other jsp pages too since the info is so similar.  But here's the catch, 
theres only one input field in an action mapping, meaning it will always send the 
user back to the same jsp page if validation fails, rather than different ones.  Is 
there some other element in the action mapping I can set to get around this?  I can 
always have 2 or 3 formbeans and copy properties from one to the other, but that 
doesnt seem like a very good solution to me. Does anyone have any ideas?

-Asif 

Validation usign validwhen

2004-06-25 Thread Labajo, Dennis

Hi all.

I've got four fields (checkbox control) on my jsp page that I need to
validate. All that needs to pass the validation is at least one of them
to be checked. I've tried using 'validwhen' but I can only get it to
work for two fields...if I include the third field (or the fourth) in my
test condition it fails with an error message something about RPAREN.
I'm sure I'm not missing a parenthesis (just trust me on this). Can
somebody here please help.

Thanks. 

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



RE: Is it possible to reuse the same FormBean with different actions?

2004-06-25 Thread Robert Taylor
Use different action mappings with same form bean.
Each action mapping can have a different input attribute value
for validation.

robert

 -Original Message-
 From: Asif Rahman [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 3:52 PM
 To: Struts Users Mailing List
 Subject: Is it possible to reuse the same FormBean with different
 actions?
 Importance: High
 
 
 I have a few jsp pages that use almost the same information.  I am using a formbean 
 for one of them right now for 
 validation.  Of course I'd like to re-use the this same bean with the other jsp 
 pages too since the info is so similar.  
 But here's the catch, theres only one input field in an action mapping, meaning it 
 will always send the user back to 
 the same jsp page if validation fails, rather than different ones.  Is there some 
 other element in the action mapping I 
 can set to get around this?  I can always have 2 or 3 formbeans and copy properties 
 from one to the other, but that 
 doesnt seem like a very good solution to me. Does anyone have any ideas?
 
 -Asif 

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



Re: Is it possible to reuse the same FormBean with different actions?

2004-06-25 Thread Bill Siggelkow
Sounds like you should be setting the FormBean to be in session scope 
for the Actions -- as far as the input attribute being a problem -- I 
really don't understand.  Perhaps you could include more information :)

Asif Rahman wrote:
I have a few jsp pages that use almost the same information.  I am using a formbean for one of 
them right now for validation.  Of course I'd like to re-use the this same bean with the other 
jsp pages too since the info is so similar.  But here's the catch, theres only one 
input field in an action mapping, meaning it will always send the user back to the 
same jsp page if validation fails, rather than different ones.  Is there some other element in 
the action mapping I can set to get around this?  I can always have 2 or 3 formbeans and copy 
properties from one to the other, but that doesnt seem like a very good solution to me. Does 
anyone have any ideas?
-Asif 

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


Re: Getting index value of iteration

2004-06-25 Thread Ron Grabowski
 %-- Nested tag way Notice how much less to write out--%
 
 nested:iterate property=divisions
  Division: nested:text property=name /br
  nested:iterate property=departments
  --- Department: nested:text property=name /br
  /nested:iterate
 /nested:iterate

Thanks for the code snippet Rick. It helped trim down a lot of code.

Whenever I would try and submit the form I was getting
BeanUtil.populate errors. I tracked down this email from November 2002:

http://tinyurl.com/26w69

 VERY-IMPORTANT
 if I set the action scope=request I get:
 javax.servlet.ServletException: BeanUtils.populate
 ...
 Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 0
 or
 Caused by: java.lang.NullPointerException
 
 make sure you don't have scope=request in your action ...
/action
 /VERY-IMPORTANT


Do you _have_ to put forms that use nested beans in session scope?
Using your example, my getters/setters would look something like:

public void setDivisions(Divisions[] divisions) {
this.divisions = divisions;
}

public Divisionsa[] getDivisions() {
return this.divisions;
}

On my action, having scope=request would cause problems. Changing
that to scope=session solved the problem.

Do you know of a way I can avoid storing the ActionForm in the session?
I've caught a few references to Common's LazyList (page was formatted
correctly in Google cache under Mozilla 1.7 but not when the original
url was clicked on):

 http://tinyurl.com/yqot7

Should I declare this.divisions to be some sort of List or LazyList
instead of Divisions[]?

Is any of this making sense?

Thanks,
Ron

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



Re: Trying to learn Struts, need help understanding design process

2004-06-25 Thread Vic Cekvenich
Struts works in layers.
You might want to create 2 DAO objects to unit test.
1 to return a list of teams.
The other DAO takes an argument of the team ID and returns a list of 
memners of the team.
(Many DAO's out there, try iBatis.com).

Once you have that unit tested, you can write an action that populates 
object from DAO 1, and puts it in request scope; so you can display the 
JSP.
From that JSP, call another action, where you get the parm out of the 
request of the team you want returned.

Good luck.
On Struts wiki, there are 20 books on Struts, and many online tutorials 
on Struts (look at one from Rick Reuman)
.V

Jamison Roberts wrote:
I've been a C#/.Net developer for two years.  Recently my company has
decided to move towards Java/Struts, so i've spent the last three
weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
Ant, and Struts.
Struts is the last thing i've tried to tackle, and I thought I had a
handle on it, however I don't.  I'm not sure of the best (or
correct/standard) way of doing simple things.  I've read that if I
ever have a *.jsp showing in the address bar outside of the entry
page, i've done something wrong.
I'd like to give an example, and hear suggestions on the correct way
to implement such an idea.  Simple example to follow...
Let's say I have a database that contains a two tables:  one called
teams, and one called riders.  There is a one-to-many relationship
between teams and riders based on a teamid.
In the teams table, we have the following data (Primary Key in parens):
(1) USPS
(2) T-Mobile
(3) Cofidis
(4) Phonak
...
In the riders table, we have this data (relationship in parens):
Lance Armstrong (teamid = 1)
George Hincapie (teamid = 1)
Jan Ullrich (teamid = 2)
Alexandre Vinokourov (teamid = 2)
David Millar (teamid = 3)
Tyler Hamilton (teamid = 4)
...
From the Index.jsp, there should be a link to another page that will
have a single select box, and a submit button.  The select box needs
to be populated with a list of teams/teamids from the database.
Upon submission of the form, all riders will be displayed in a table.
Pretty simple stuff, except I can't seem to figure out how to do it
with Struts.  The closest i've gotten is to have a static Teams.jsp
with an input-text box, which calls an Action to display the users. 
In otherwords my Index.jsp links to Teams.jsp, instead of something
like Teams.do (and I can't figure out how to populate a select box
from a Vector or other sort of list).

I apologize for asking simple questions, but i'm at the end of my rope
trying to figure out all these new technologies (new to my Microsoft
dominated world).

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


RE: actions which return dynamically based on input

2004-06-25 Thread Jim Barrows
2 ways off the top of my head:
1) html:hidden/
2) html:form action=/action.do?returnTo=here.jsp


 -Original Message-
 From: Pietro Dansk [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 2:13 PM
 To: Struts Users Mailing List
 Subject: actions which return dynamically based on input
 
 
 I have a form which appears on multiple pages. The form leads 
 to an action
 which changes a simple property. After doing this, I want the 
 action to
 simply lead back to the individual page from which it came. I 
 can't register
 a single input within the action tag of the struts-config.xml file
 (because there are multiple actions from which it could 
 possibly come).
 Therefore, it doesn't seem like I can use the 
 mapping.findInputForward()
 method. I want this form to simply return to the page or 
 action that it was
 previously at. What is the most elegant way to do this?
 
 --Pietro 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



RE: NEWBIE: how to submit a named html:form via javascript

2004-06-25 Thread Adam Lipscombe
Thanks Jim,


If I understand you correctly, if I have this config in struts-config:

action path=/help name=helpActionForm scope=request
type=com.expensys.expensyswt.struts.action.DisplayHelp /

Then I can use javascript:document.helpActionForm.submit() in the jsp file
to submit a form like this:

html:form action=/help.do method=POST

/html:form


Is my understanding correct?


TIA - Adam




-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: 25 June 2004 18:31
To: Struts Users Mailing List
Subject: RE: NEWBIE: how to submit a named html:form via javascript


The name is optional.  I never use it in the form.  For JavaScript porpoises
I use the name of the 
ActionForm your using in the struts config.

 -Original Message-
 From: Adam Lipscombe [mailto:[EMAIL PROTECTED]
 Sent: Friday, June 25, 2004 10:27 AM
 To: 'Struts Users Mailing List'
 Subject: NEWBIE: how to submit a named html:form via javascript
 
 
 
 Folks,
 
 I want to submit a named html:form. e.g.
 
 html:form name=helpForm action=/help method=POST
map name=Map
   area shape=rect coords=2,0,50,13 href= 
 onclick=javascript:document.helpForm.submit() 
/map
 /html:form
 
 
 Wit the above construct Struts complains that the form
 requires a type
 attribute - it seems to want me to specify the classname of 
 the ActionForm
 as the type.
 
 My understanding is that Struts deduces the ActionForm to use
 automatically
 from the struts-config action definition. Is this correct?
 
 
 I know I could use javascript:document.forms[n].submit() but I would 
 prefer to submit the named form so that if further forms are added to 
 the page it does not mess up the submit.
 
 Is this possible? How?
 
 
 TIA - Adam
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



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



RE: actions which return dynamically based on input

2004-06-25 Thread Wendy Smoak
 From: Pietro Dansk [mailto:[EMAIL PROTECTED] 
 I want this form to simply return to the page or 
 action that it was
 previously at. What is the most elegant way to do this?

In Struts, everything goes forward so the go back where you came from
problem comes up repeatedly.  The 'coming from' page needs to put
something in the request so you can figure out where to go back to.
Then instead of looking up a forward from struts-config.xml, you can
construct a new one and return that.  Also consider that sometimes in
this situation you really want a redirect instead of a forward.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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



Problem with Tiles DTD

2004-06-25 Thread Ashwin D
Hi,

Our application resides on a machine which does not
have a direct connection to the internet. So, I have
changed all the references to dtds to be on the local
machine.

The struts  the tiles config file reference their 
dtds in the same directory.

!DOCTYPE tiles-definitions PUBLIC
 
 tiles_config_1_1.dtd


This works fine with Struts. However, Tiles throws an
exception at runtime about not being able to get the
DTD. Also, Tiles tries to look for the DTD in the
directory from which Tomcat was started. 

for e.g. if tomcat is started from /usr/app, Tiles
tries to look for the DTD in /usr/app

It looks like a bug with Tiles. I am wondering if
there is a known patch / fix to correct this problem.

I am using Struts 1.1 (official release) with Tomcat
5.0.19. 

Ashwin. 



__
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

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



RE: Recommend Struts Plugins for Eclipse?

2004-06-25 Thread David Friedman
I have two favorites

a) The JBoss IDE PlugIn for it's XDoclet support of Struts
b) The Sysdeo Tomcat plug-In to control Tomcat

Occasionally, I'll use
c) Hibernate Synchronizer
d) Hibernator
e) the http://www.pnehrer.com/ RSS module
f) the Brosinski regex tester
http://brosinski.com/stephan/archives/28.php

Regards,
David

-Original Message-
From: e-denton Java Programmer [mailto:[EMAIL PROTECTED]
Sent: Friday, June 25, 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Recommend Struts Plugins for Eclipse?


I am converting from Kawa to Eclipse. Anyone have Eclipse plugins they
recommend for Struts, Tomcat, JBoss, XML, etc development?

Thanks for your opinions.


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


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



RE: s:form tag in Struts-Faces

2004-06-25 Thread Matthias Wessendorf
is this for all forms you submit`?

did you take a look at the sample-application?
it works fine for me, with struts1.1 and RI from sun
(version 1.1)

Cheers,

 -Original Message-
 From: Josh Porter [mailto:[EMAIL PROTECTED] 
 Sent: Friday, June 25, 2004 9:03 PM
 To: Struts Users Mailing List
 Subject: Re: s:form tag in Struts-Faces
 
 
 I get the following exception:
 
 javax.servlet.ServletException: java.lang.NullPointerException
   at 
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:209) 
 
 with root cause listed as
 
 javax.faces.el.EvaluationException: java.lang.NullPointerException
   at 
 com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
   at 
 com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
   at javax.faces.component.UIData.getValue(UIData.java:527)
   at javax.faces.component.UIData.getDataModel(UIData.java:848)
   at javax.faces.component.UIData.setRowIndex(UIData.java:379)
   at javax.faces.component.UIData.iterate(UIData.java:890) 
 
 Caused by: java.lang.NullPointerException
   at 
 org.apache.struts.faces.application.PropertyResolverImpl.getVa
 lue(PropertyResolverImpl.java:146)
   at 
 com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
   at 
 com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
   at 
 com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(Express
 ionEvaluatorImpl.java:243)
   at 
 com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173)
   ... 53 more
 
 
 
 Matthias Wessendorf wrote:
 
 Do you get any exceptions on submitting a form?
 
 regards,
 
   
 
 -Original Message-
 From: Josh Porter [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 24, 2004 11:37 PM
 To: [EMAIL PROTECTED]
 Subject: s:form tag in Struts-Faces
 
 
 I am trying to develop a web application using Struts, Tiles, and
 JavaServer Faces, connected by the Struts-Faces integration 
 library. I 
 can't seem to make the s:form tag work.
 
 The code I wrote looks like:
 s:form action=/search
 
 The /search action is configured in struts-config.xml to 
 forward to a
 search results tile.
 
 The code renders like this:
 
 form id=navbar:_id19
 action=/WebInterface/faces/start.jsp;jsessionid=B61380A7B5F73
 72ABE0CA4D8FF109123 method=post
 
 where start.jsp is the page the form is on. This happens with other
 forms too; when the s:form tag is rendered, the action 
 attribute is 
 directed back on the current page.
 
 I read the following article, which proposed sort of a hack to solve
 this problem:
 -- http://www-106.ibm.com/developerworks/library/j-integrate/
 except this was written last September for an older version of
 Struts-Faces, and some of the code it tells you to change is 
 different 
 now. I couldn't get this to work.
 
 How do I get around this problem? It seems like something
 pretty basic, 
 so I apologize if this is something that's been well 
 covered already, 
 but I couldn't find information about it anywhere.
 
 -- Josh
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



RE: Problem with Tiles DTD

2004-06-25 Thread Wendy Smoak
 From: Ashwin D [mailto:[EMAIL PROTECTED] 
 Our application resides on a machine which does not
 have a direct connection to the internet. So, I have
 changed all the references to dtds to be on the local
 machine.

If you leave the dtds alone, and leave them inside the .jar files, and
refer to them with the URI, (which may look like a URL, but isn't,) then
they will be located automatically with no connection to the internet.
[I think.  See below.]

So, this:

 !DOCTYPE tiles-definitions PUBLIC
   -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN
   http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd;

will actually retrieve the dtd from inside the struts.jar file, where
the tiles-config_1_1.dtd file lives.  Unless I still don't understand
how this works, there is no need to do anything special.  (Granted I've
never had to work 'offline' and am still using Tomcat 4.1.  But since
nobody answered your prior message I figured I'd give it a shot.)

Craig posted a detailed explanation of how this all works not too long
ago, in response to a inquiry I made here.  Unfortunately, none of the
archives is cooperating with me right now, perhaps someone else can turn
it up.

Were you having problems that prompted you to make these changes?

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


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



Re: Converting Java Code in JSP to JSTL

2004-06-25 Thread Michael McGrady
Looks like a test, Caroline!
At 05:20 PM 6/25/2004, Caroline Jen wrote:
I was told that JSTL can convert most of the Java code
in JSP.  I still have some problem with initializing
variables and if statments; for example, I do not know
how to write in JSTL of the following:
1. int i = 0;
2. i++;
3. String prevArticle = null;
4. if ( numberOfPosts - 1 == 1 ) {}
5. if ( nextTopic != 0 )
6. String threadID = String.valueOf( threadID_int );
7. if ( threadRows.size() == 0 ) {}
8. if ( previousOffset = 0 || nextOffset = 0 ) {}
9. if ( prevArticle != null )  ( !article.equals(
prevArticle ) ) {}
if anybody could kindly show me the JSTL equivalents?


__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


[OT -- for Martin: bounce backs from Brian Husted] Fwd: Undeliverable: Re: Converting Java Code in JSP to JSTL

2004-06-25 Thread Michael McGrady
These are the bounce backs we are getting, Martin, if you did not get the 
emails.


Envelope-to: [EMAIL PROTECTED]
Subject: Undeliverable: Re: Converting Java Code in JSP to JSTL
Date: Fri, 25 Jun 2004 20:33:48 -0400
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: Converting Java Code in JSP to JSTL
Thread-Index: AcRbFT2tAfiE4XwbS5iyrTN3sew/LHCt
From: System Administrator [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
X-OriginalArrivalTime: 26 Jun 2004 00:33:33.0698 (UTC) 
FILETIME=[3651AE20:01C45B15]

Your message
  To:  Struts Users Mailing List
[EMAIL PROTECTED]@[EMAIL PROTECTED];
[EMAIL PROTECTED]@[EMAIL PROTECTED]
  Subject: Re: Converting Java Code in JSP to JSTL
  Sent:Fri, 25 Jun 2004 20:33:17 -0400
did not reach the following recipient(s):
Brian Husted on Sat, 26 Jun 2004 00:33:17 -0400
User Brian Husted/AMS/AMSINC (Brian Husted/AMS/[EMAIL PROTECTED]) not
listed in public Name  Address Book
Original-Envelope-ID: c=us;a= ;p=AMS;l={52F5B406-3C-040626003341Z-28290
Reporting-MTA: dns; CARNEY.ams.com
Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.0
X-Display-Name: Brian Husted
MIME-Version: 1.0
Content-Type: text/plain;
charset=us-ascii
Content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Subject: Re: Converting Java Code in JSP to JSTL
Date: Fri, 25 Jun 2004 20:33:17 -0400
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Re: Converting Java Code in JSP to JSTL
Thread-Index: AcRbFT2tAfiE4XwbS5iyrTN3sew/LA==
From: [EMAIL PROTECTED]@[EMAIL PROTECTED] 
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]@[EMAIL PROTECTED] 
[EMAIL PROTECTED],
[EMAIL PROTECTED]@[EMAIL PROTECTED] 
[EMAIL PROTECTED]

Looks like a test, Caroline!
At 05:20 PM 6/25/2004, Caroline Jen wrote:
I was told that JSTL can convert most of the Java code
in JSP.  I still have some problem with initializing
variables and if statments; for example, I do not know
how to write in JSTL of the following:

1. int i = 0;
2. i++;
3. String prevArticle = null;
4. if ( numberOfPosts - 1 == 1 ) {}
5. if ( nextTopic != 0 )
6. String threadID = String.valueOf( threadID_int );
7. if ( threadRows.size() == 0 ) {}
8. if ( previousOffset = 0 || nextOffset = 0 ) {}
9. if ( prevArticle != null )  ( !article.equals(
prevArticle ) ) {}

if anybody could kindly show me the JSTL equivalents?





__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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

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

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


Is there anyway an Action can dynamically return to a page based on input?

2004-06-25 Thread Pietro Dansk
I have a form which appears on multiple pages. The form leads to an action 
which changes a simple property. After doing this, I want the action to 
simply lead back to the individual page from which it came. I can't register 
a single input within the action tag of the struts-config.xml file 
(because there are multiple actions from which it could possibly come). 
Therefore, it doesn't seem like I can use the mapping.findInputForward() 
method. I want this form to simply return to the page or action that it was 
previously at. What is the most elegant way to do this?

--Pietro 

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


Re: Is there anyway an Action can dynamically return to a page based on input?

2004-06-25 Thread Pietro Dansk
My apologies if you received multiple copies of this email. We are having 
mail server troubles here.

--Pietro
- Original Message - 
From: Pietro Dansk [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, June 25, 2004 1:54 PM
Subject: Is there anyway an Action can dynamically return to a page based on 
input?


I have a form which appears on multiple pages. The form leads to an action 
which changes a simple property. After doing this, I want the action to 
simply lead back to the individual page from which it came. I can't 
register a single input within the action tag of the struts-config.xml 
file (because there are multiple actions from which it could possibly 
come). Therefore, it doesn't seem like I can use the 
mapping.findInputForward() method. I want this form to simply return to the 
page or action that it was previously at. What is the most elegant way to 
do this?

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


Re: Converting Java Code in JSP to JSTL

2004-06-25 Thread Bill Siggelkow
Caroline Jen wrote:
I was told that JSTL can convert most of the Java code
in JSP.
Whoever told you that should be shot! It's not that JSTL is deficient, 
its just sort of like saying I have heard that a honeydew melon can be 
used instead of a canteloupe. Theyr'e both round fruits, but they taste 
different.

JSTL relies on scoped variable where the scopes are pageScope, 
requestScope, sessionScope, and applicationScope. To get the variables 
into these scopes should be the job of your actions. You can create 
these scoped variables using other things such as jsp:useBean and 
bean:define.  However, the best place is your action, (or other things 
like PlugIn, SessionListener, etc.).

I have not tested all of these so YMMV.
  I still have some problem with initializing
variables and if statments; for example, I do not know
how to write in JSTL of the following:
1. int i = 0;
c:set var=i0/c:set
2. i++;
c:set var=i value=${i + 1}/
3. String prevArticle = null;
c:set var=prevArticle value=/
4. if ( numberOfPosts - 1 == 1 ) {}
c:if test=${(numberOfPosts - 1) eq 1}
/c:if
5. if ( nextTopic != 0 )
c:if test=${(nextTopic ne 0}
/c:if
6. String threadID = String.valueOf( threadID_int );
c:set var=threadId value=${threadID_int}/
7. if ( threadRows.size() == 0 ) {}
c:if test=${empty threadRows}
/c:if
8. if ( previousOffset = 0 || nextOffset = 0 ) {}
c:if test=${previousOffset ge 0 and nextOffset ge 0}
/c:if
9. if ( prevArticle != null )  ( !article.equals(
prevArticle ) ) {}
c:if test=${(not empty prevArticle) and (article ne prevArticle)}
/c:if
Good Luck!
Bill Siggelkow
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: strange problem while implementing validation

2004-06-25 Thread jpatel
The Problem is datatabse pool, due to bug in sysdudo plug in database connection
pool is not mounted. So I added commons-pool.jar in path and it started working fine.

-Jignesh


On Fri, 25 Jun 2004 11:44 , [EMAIL PROTECTED] sent:

Looks to me like something in doStartTag is looking for something from
request or session and its not finding it since its a startup and so it
throws an exception.

-Original Message-
From: [EMAIL PROTECTED]
[EMAIL PROTECTED]','','','')[EMAIL PROTECTED]
Sent: Friday, June 25, 2004 10:12 AM
To: 'Struts Users Mailing List'
Subject: strange problem while implementing validation


Hello
I'm running Eclipse with Tomcat 5.0.18 and Struts 1.1. Since I use
validation my
application sometimes dies at startup. When I restart the server it throws
the
following exeption:

--
java.lang.NullPointerException
at
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptVa
lidatorTag.java:316)

at org.apache.jsp.index$jsp._jspService(index$jsp.java:741)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


-Jignesh 



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

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






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