Nested tags...

2004-08-13 Thread sridhar ramalingam
Hi All,
I'm trying to achieve the following...
   

   
 
   

   
 
But, I'm getting this error... Unterminated user-defined tag: ending tag
 not found or incorrectly nested

Please help me find a work around to this.



 
Regards,
Sridhar
 


user@struts.apache.org

2004-08-13 Thread Wolfgang Woger
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Accessing bean properties problem

2004-08-13 Thread Janne Mattila

Oops, that was a typo. Should have read
" 
/>

If browsers did pick up "value" parameter, this problem would not even 
exist...

Some browsers do.  What is your problem?  Why are you adding "delete" in 
here?
There is no "name" attribute with image.  I assume you mean to use the 
"property" attribute.  There is no problem with this, even without a 
"value" attribute.  If you use "property='<%= "delete" + choiceKey %>'", 
and (in your processing of the form):

   String button = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   button = parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
Sorry, I seem to have gotten a bit confused here. You are correct with your 
assumption that I meant the "property" attribute.

I described what I wanted to achieve in my original posting. To recap, I 
want to have a page with several delete buttons. Clicking on one button 
would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have not 
quite figured out how to properly implement this kind of functionality using 
them.

_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Struts Path problem

2004-08-13 Thread Ding Lei
Hello List,
I encountered problems on displaying images in JSP pages which
belongs to a specified Struts module.
   If we include an image file in a JSP page, say "A.jsp", and we
we define an action forward that points to it, and access through
that action forward in browser, the image is able to display correctly.
But if "A.jsp" contains an iframe which points two another JSP page
under the same module(through it's filename,not action forward), 
say B.jsp, then all images on B.jsp won't able to display properly.
  Similiarly, if there's some javascript code snippet on A.jsp which
popups something, such as a calender, all images on it won't able to
display.

  Any idea? Thanks!



-- 
layman

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



Re: Struts Path problem

2004-08-13 Thread Shailender Jain

May be the problem related to directory structure.
For e.g.

webapps
examples
images
com/struts/examples
view/modulename/A.jsp


If the forward action to A.jsp has happened then A.jsp  should have





Ding Lei wrote:

> Hello List,
> I encountered problems on displaying images in JSP pages which
> belongs to a specified Struts module.
>If we include an image file in a JSP page, say "A.jsp", and we
> we define an action forward that points to it, and access through
> that action forward in browser, the image is able to display correctly.
> But if "A.jsp" contains an iframe which points two another JSP page
> under the same module(through it's filename,not action forward),
> say B.jsp, then all images on B.jsp won't able to display properly.
>   Similiarly, if there's some javascript code snippet on A.jsp which
> popups something, such as a calender, all images on it won't able to
> display.
>
>   Any idea? Thanks!
>
> --
> layman
>
> -
> 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: Struts - passing unicode parameter from jsp to action

2004-08-13 Thread Masoud Kalali
Pavel Kolesnikov wrote:
On Thu, 12 Aug 2004, Masoud Kalali wrote:
 

I  use post for sending parameter to action and also add
(request.setCharacterEncoding("UTF-8");
to my action before reading parameter from it , also i add two 
   

You should better call request.setCharacterEncoding() in
a filter or overriden ActionServlet's method process().
Request parameters are read when ActionServlet prepares form
instances - it happens before your Action is called.
 

difinition on my jsp page <%request.setcharacterEncoding("UTF-8");%>
   

I think you have no reason to put this call in your JSP.
Pavel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 

hi
thank you for your post.
I test what you said , for creating a filter and apply it on web.xml , 
but still i could not get parameter in utf-8 and those are in ISO 
Latin-1 encoding , could you post the filter you mean here?
is it possible that WAS does not support UTF-8 parameter?
thank you

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


RE: Nested tags...

2004-08-13 Thread Kataria, Satish
I am not sure but just a guesss
You are not closing the html:form tag and a html:form can't be embeded
within another
Just closing the tags should solve the problem.

Thanks,
Satish

-Original Message-
From: sridhar ramalingam [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 1:00 PM
To: [EMAIL PROTECTED]
Subject: Nested tags...


Hi All,
I'm trying to achieve the following...
   

   
 
   

   
 
But, I'm getting this error... Unterminated user-defined tag: ending tag
 not found or incorrectly nested

Please help me find a work around to this.



 
Regards,
Sridhar
 

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



JSF-Struts integration

2004-08-13 Thread Prasad, Kamakshya
Hi All,

I have a bean containing ArrayList property as given below

public ArrayList getCountries() 
{ 
return arrlCountries; 
}
public void setCountries(int iIndex, String strCountry) 
{ 
if (arrlCountries == null)
{
arrlCountries = new ArrayList();
}
arrlCountries.add(strCountry); 
}

This property is displayed in the jsp by the following code







But when user changes the texts in textboxes and submit, the old values
comes up and not the new submitted one.

Please help me on this.

Also while putting logs I realized the get method is called twice after
form submission. Could anyone please help me find the reason for this?

Thanks and Regards,
KP

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 3:37 PM
To: Struts Users Mailing List
Subject: Re: Plugin struts validator framework to JSF

On Fri, 13 Aug 2004 15:22:46 +0900, Prasad, Kamakshya
<[EMAIL PROTECTED]> wrote:
> Dear Craig,
> 
> Could you please elaborate more on this? Kindly if possible some code
> snippets which may help me understand it better.
> 

As I said in my previous message, the nightly builds of the
Struts-Faces integration library include two versions of the standard
Struts example application -- one with Tiles and one without.  Both of
them use the Struts validator framework in conjunction with page that
use JavaServer Faces components.  Your best bet is to examine the
sources in these two webapps to understand what is going on.

http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

Craig

-
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: Nested tags...

2004-08-13 Thread Jitender K Chukkavenkata
Where did you terminate  tag.  Close the 

Jitender Kumar C.V.


handling multiple independent window

2004-08-13 Thread Kailash Vasani
Hi,

Is it possible to have 2 windows showing same JSP page, but different data,
using struts?
The data to be displayed is populated in form bean, in action class.

Both the JSP pages would be performing same set of operations, but not
necessarily in same order.
Operations are Save, Update etc. When operation is performed, data from form
bean would be used
to perform database operation.

To best of my knowledge, form beans with session scope will fail to achieve
this, as both the windows
would be sharing the same instance of form bean. Request scoped form beans
are not feasible due to size
and complexity (nesting mainly) of data structure.

There is restriction that there may be only one user session in application.

Did any one faced similar situation? Do anyone have any suggestion?

Kailash


Quinnox - Global Leadership in eBusiness and IT services, vertically aligned
for clients in the automotive/discrete manufacturing, SAP , ERP , and
powered by an offshore-based global delivery model.

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



RE: Accessing bean properties problem

2004-08-13 Thread Janne Mattila
I described what I wanted to achieve in my original posting. To recap, I 
want to have a page with several delete buttons. Clicking on one button 
would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have not 
quite figured out how to properly implement this kind of functionality 
using them.
I finally figured out a reasonably satisfying way to do this while using 
Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTracer tracer) {
deleteButton = tracer;
}
}
public class ImageButtonTracer {
private Map clickedButtons;
public ImageButtonTracer() {
clickedButtons = new HashMap();
}
public Button getItem(int index) {
Button toReturn = (Button) clickedButtons.get(new Integer(index));
if (toReturn == null) toReturn = new Button();
clickedButtons.put(new Integer(index), toReturn);
return toReturn;
}
public void setItem(int index, Button button) {
logger.debug("setItem(" + index + ")");
clickedButtons.put(new Integer(index), button);
}
public Collection getClickedButtonIndexes() {
return clickedButtons.keySet();
}
public class Button {
private int x;
private int y;
public int getX() { return x; }
public int getY() { return y; }
public void setX(int i) { x = i; }
public void setY(int i) { y = i; }
}
}
public class ChoiceView implements Serializable {
private String key;
private String name;
private String description;
... + getters & setters
}

 
 
   
 
 
 
 
   
 
 
 


public class SaveChoicesAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ChoicesForm cform = (ChoicesForm) form;
ChoiceDAO dao = new ChoiceDAO();
// UPDATE
Iterator i = cform.getChoices().iterator();
while (i.hasNext()) {
ChoiceView view = (ChoiceView) i.next();
Choice toUpdate = ChoiceView.createChoice(view);
dao.update(toUpdate);
}
  // DELETE
Collection deletedIds =
cform.getDeleteButton().getClickedButtonIndexes();
if (deletedIds != null) {
Iterator d = deletedIds.iterator();
while (d.hasNext()) {
int deleteIndex = ((Integer) d.next()).intValue();
ChoiceView toDelete = cform.getChoice(deleteIndex);
Choice choice = ChoiceView.createChoice(toDelete);
dao.delete(choice);
}
}
return mapping.findForward("success");
}
}
ImageButtonTracer can be simplified a bit if one assumes that only one 
button can be clicked per request (as is the case) => 	public Collection 
getClickedButtonIndexes()  can be changed to public int 
getClickedButtonIndex(). This works, and I can use indexed properties 
somewhat comfortably.


[OT] form default submit button

2004-08-13 Thread Erez Efrati
Hi,
 
This not a struts issue though my project is well attached down to the
bones to struts.
I am a bit rusty in HTML and I need your advice.
I have a login form with username and password fields. The button is
built with a table consisting of the graphical edges and the text 
(retrieved from the resource bundle) in the middle.
 
What do I have to do so when the user is in the username field or
password and hits  the form will submit. Currently it does not do
it and I have to click on the "table" button, whereas with buttons made
of . it worked automatically even with more
forms on the page where each works the same way autonomously. 
 
Here is the fragment of the button in my login form.
 
<-- Start Button -->

  

 




 


 


 
 
Thanks in advance,
 
--Erez
 
 


RE: [OT] form default submit button

2004-08-13 Thread Shilpa Vaidya
try use 

onsubmit(); instead of onclick()



regds 
Shilpa

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 4:12 PM
To: 'Struts Users Mailing List'
Subject: [OT] form default submit button


Hi,
 
This not a struts issue though my project is well attached down to the
bones to struts.
I am a bit rusty in HTML and I need your advice.
I have a login form with username and password fields. The button is
built with a table consisting of the graphical edges and the text 
(retrieved from the resource bundle) in the middle.
 
What do I have to do so when the user is in the username field or
password and hits  the form will submit. Currently it does not do
it and I have to click on the "table" button, whereas with buttons made
of . it worked automatically even with more
forms on the page where each works the same way autonomously. 
 
Here is the fragment of the button in my login form.
 
<-- Start Button -->

  

 




 


 


 
 
Thanks in advance,
 
--Erez
 
 

-- 


"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." 




RE: [OT] form default submit button

2004-08-13 Thread Erez Efrati
Thanks Shilpa, 

I will try it.

Erez

-Original Message-
From: Shilpa Vaidya [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 11:44 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] form default submit button

try use 

onsubmit(); instead of onclick()



regds 
Shilpa

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 4:12 PM
To: 'Struts Users Mailing List'
Subject: [OT] form default submit button


Hi,
 
This not a struts issue though my project is well attached down to the
bones to struts.
I am a bit rusty in HTML and I need your advice.
I have a login form with username and password fields. The button is
built with a table consisting of the graphical edges and the text 
(retrieved from the resource bundle) in the middle.
 
What do I have to do so when the user is in the username field or
password and hits  the form will submit. Currently it does not do
it and I have to click on the "table" button, whereas with buttons made
of . it worked automatically even with more
forms on the page where each works the same way autonomously. 
 
Here is the fragment of the button in my login form.
 
<-- Start Button -->

  

 




 


 


 
 
Thanks in advance,
 
--Erez
 
 

-- 


"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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] form default submit button

2004-08-13 Thread Erez Efrati
Where do I put this onsubmit();

--Erez

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 12:51 PM
To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
Subject: RE: [OT] form default submit button

Thanks Shilpa, 

I will try it.

Erez

-Original Message-
From: Shilpa Vaidya [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 11:44 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] form default submit button

try use 

onsubmit(); instead of onclick()



regds 
Shilpa

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 4:12 PM
To: 'Struts Users Mailing List'
Subject: [OT] form default submit button


Hi,
 
This not a struts issue though my project is well attached down to the
bones to struts.
I am a bit rusty in HTML and I need your advice.
I have a login form with username and password fields. The button is
built with a table consisting of the graphical edges and the text 
(retrieved from the resource bundle) in the middle.
 
What do I have to do so when the user is in the username field or
password and hits  the form will submit. Currently it does not do
it and I have to click on the "table" button, whereas with buttons made
of . it worked automatically even with more
forms on the page where each works the same way autonomously. 
 
Here is the fragment of the button in my login form.
 
<-- Start Button -->

  

 




 


 


 
 
Thanks in advance,
 
--Erez
 
 

-- 


"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 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] form default submit button

2004-08-13 Thread Shilpa Vaidya
lol

hi 
1. like this
<-- Start Button -->

  

 




 


 




---

2...also use a  submit button  instead of a button
coz need to do a form submit.

so in ur code c if u can replace  class="btn" with class="submit" if u have
some class for submit.

---

Regds

shilpa





-- 


"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." 




Re:

2004-08-13 Thread Erik Weber
Not sure about the fmt:format tag, but I use the Struts bean:write tag 
to format my dates:


Erik

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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]


How to help the user navigate to his own folder

2004-08-13 Thread Gao Jun
Hi everyone,
 
I've a problem in using Slide and I'd like to hear your suggestion.
We are using slide to implement a document management system and we
will assign specific users access to specific folders. For example,
we have a doc tree like,
 
A
   -B1
-C
   -B2
 
One user has the access to folder C, so he can read and write in folder C.
However, I have the problem of letting this user enter C folder. 
First, because he doesn't have access to A and B1, so he can't navigate to
C by enter A first, then enter B1.
Second, if I let this user jump into C directly, this user should know his
folder has the path A/B1/C. But does Slide provide a way (some api) to let
us find this users all available paths?
 
Have you ever met this kind of problem? Any suggestion?
 
Thanks and regards,
 
Jun


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re:

2004-08-13 Thread Wolfgang Woger

Erik Weber wrote:
Not sure about the fmt:format tag, but I use the Struts bean:write tag 
to format my dates:


Erik
Thank you Erik,
I will try bean:write.
But by now I have an other problem. I want a new Date() as a default
value for a html-el:text element. I did:
<%
   Date curDate = new Date();
   String dateString = curDate.toString();
%>
 
 
 :
 

But nothing can be seen in that field.
regards
Wolfgang

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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:

2004-08-13 Thread Erik Weber
Not positive on this, but I think the place to set this default date 
string would be in your form bean's reset method. Then your JSP wouldn't 
need any code, the html:text field would pull the just-initialized value 
from the form bean, as reset would be invoked by Struts just before the 
JSP renders.

As far as I know, you should steer clear of using the "value" attribute 
to any HTML input tags. You won't get proper "memory" of what the user 
had entered when the page is redisplayed after a form validation error.

Someone correct me if that is not the right approach. It's what I do 
when I want checkboxes to be checked by default though, for example, so 
this seems analogous.

Erik
Wolfgang Woger wrote:

Erik Weber wrote:
Not sure about the fmt:format tag, but I use the Struts bean:write 
tag to format my dates:


Erik

Thank you Erik,
I will try bean:write.
But by now I have an other problem. I want a new Date() as a default
value for a html-el:text element. I did:
<%
   Date curDate = new Date();
   String dateString = curDate.toString();
%>
 
 
 : 


But nothing can be seen in that field.
regards
Wolfgang

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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:

2004-08-13 Thread Erik Weber
I just tried this in one of my forms. Works fine under both add and 
update conditions, with and without validation errors (the only time the 
new string is rendered is for a fresh add page).

Erik
Erik Weber wrote:
Not positive on this, but I think the place to set this default date 
string would be in your form bean's reset method. Then your JSP 
wouldn't need any code, the html:text field would pull the 
just-initialized value from the form bean, as reset would be invoked 
by Struts just before the JSP renders.

As far as I know, you should steer clear of using the "value" 
attribute to any HTML input tags. You won't get proper "memory" of 
what the user had entered when the page is redisplayed after a form 
validation error.

Someone correct me if that is not the right approach. It's what I do 
when I want checkboxes to be checked by default though, for example, 
so this seems analogous.

Erik
Wolfgang Woger wrote:

Erik Weber wrote:
Not sure about the fmt:format tag, but I use the Struts bean:write 
tag to format my dates:


Erik

Thank you Erik,
I will try bean:write.
But by now I have an other problem. I want a new Date() as a default
value for a html-el:text element. I did:
<%
   Date curDate = new Date();
   String dateString = curDate.toString();
%>
 
 
 : 


But nothing can be seen in that field.
regards
Wolfgang

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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:

2004-08-13 Thread Wolfgang Woger

Erik Weber wrote:
Not positive on this, but I think the place to set this default date 
string would be in your form bean's reset method. Then your JSP 
wouldn't need any code, the html:text field would pull the 
just-initialized value from the form bean, as reset would be invoked 
by Struts just before the JSP renders. 
I think that will not be that simple, since my form is a 
DynavalidatorForm and all its properties are Strings. An initial value
for the questionable property can be given in struts.config.xml, which 
is not what i wanted

regards
Wolfgang

As far as I know, you should steer clear of using the "value" 
attribute to any HTML input tags. You won't get proper "memory" of 
what the user had entered when the page is redisplayed after a form 
validation error.

Someone correct me if that is not the right approach. It's what I do 
when I want checkboxes to be checked by default though, for example, 
so this seems analogous.

Erik
Wolfgang Woger wrote:

Erik Weber wrote:
Not sure about the fmt:format tag, but I use the Struts bean:write 
tag to format my dates:


Erik

Thank you Erik,
I will try bean:write.
But by now I have an other problem. I want a new Date() as a default
value for a html-el:text element. I did:
<%
   Date curDate = new Date();
   String dateString = curDate.toString();
%>
 
 
 : 


But nothing can be seen in that field.
regards
Wolfgang

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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: Loosing request attributes

2004-08-13 Thread Kataria, Satish
Ru using redirect="true" in ur action mapping. If so then changing it to false will 
solve the problem.

Thanx,
Satish Kataria

-Original Message-
From: Leandro Melo [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 7:39 AM
To: struts jakarta
Subject: Loosing request attributes


Hi,
when a user request hits the ActionForm's validate
method and bounces back, i'm loosing some request
attributes that i had set for the page. In other
words, if the user inputs some data that don't pass
the validate method,
the page comes back with a few request scope
attributes missing.

Is there a way to avoid that this happens?

=
_
Leandro Terra C. Melo
Eng. de Controle e Automação - UFMG





___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

-
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] DAO ... where to draw the line?

2004-08-13 Thread Matthew J. Vincent
Hi all,
Thanks for the info.  Here's another issue.
What if I have an employee search screen that wants to show only some of 
the information of an employee (not all).  What do you do then? 

1. Instanatiate an Employee object and only fill in the relative 
information?  Keep in mind that this could be just employee name and 
location on the search results screen and then when the user chooses 
which employee to view I need to get all of the employee information.

2.  Instantiate an Employee object and fill out all the information even 
though you won't be needing most of it on the search results screen?

3.  Create 2 DTOs, one called Employee and one called EmployeeSearch 
DTO.  The EmployeeSearch DTO only stores what needs to be shown on the 
search results screen and the EmployeeDTO holds all the information for 
what needs to be shown on the detail screen?

4.  Something else...
Thanks!
Matt

Navjot Singh wrote:
hi matthew,
I wont say that you go with one or other of your approaches.
It depends upon type of assosciation that 2 entities may share. They 
may have aggregation or composition relationship. Depending on that 
your DAO implementation will decide that you need to get ONLY id or 
the composite objects.

Let me explain.
Say you have class named ORDER ad ORDER_DETAILS. (consists-of 
relationship) Order without order details is nothing. So you may get 
the OrderDetails object as well when you get Order.

Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) 
EMPLOYEE *may* still exists with or without department. So you may get 
only id of department and later fetch the department.

Think in employee table, you have relationship (reports-to). If you 
specify this relation as composition, you may go on fetching the 
objects all the way up to the organization chart ;-)

Do i make sense?
Navjot Singh
-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: 
Wednesday, August 11, 2004 8:21 AM
To: Struts Users Mailing List
Subject: [OT] DAO ... where to draw the line?

[OFF TOPIC]
I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line?
For example:

Let''s say I have three tables:
Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)
How deep do your classes go to replicate the data?
Do you do this...
public class Employee {
   private int id;
   private String name;
   private int deptId;   // just the id
   // .. implementation details
}
or do you do this
public class Employee {
   private int id;
   private String name;
   private Department dept;  // all of the data
   // .. implementation details
}
and so on and so on.   Class Department has the same type of 
problem.  Does it hold just the id for location or a variable class 
Location?

Should DAOs just fill in the id (keys) so it is up to the application 
using the DAOs to get the Employee class, then the Department class, 
and the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + 
loc.getLocationName());

or
Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  
It's possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!
Thanks!
Matt
-
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]


Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:


 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 

Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re:

2004-08-13 Thread Erik Weber
Sorry, that's one I have not encountered.
Erik
Wolfgang Woger wrote:

Erik Weber wrote:
Not positive on this, but I think the place to set this default date 
string would be in your form bean's reset method. Then your JSP 
wouldn't need any code, the html:text field would pull the 
just-initialized value from the form bean, as reset would be invoked 
by Struts just before the JSP renders. 

I think that will not be that simple, since my form is a 
DynavalidatorForm and all its properties are Strings. An initial value
for the questionable property can be given in struts.config.xml, which 
is not what i wanted

regards
Wolfgang

As far as I know, you should steer clear of using the "value" 
attribute to any HTML input tags. You won't get proper "memory" of 
what the user had entered when the page is redisplayed after a form 
validation error.

Someone correct me if that is not the right approach. It's what I do 
when I want checkboxes to be checked by default though, for example, 
so this seems analogous.

Erik
Wolfgang Woger wrote:

Erik Weber wrote:
Not sure about the fmt:format tag, but I use the Struts bean:write 
tag to format my dates:


Erik


Thank you Erik,
I will try bean:write.
But by now I have an other problem. I want a new Date() as a default
value for a html-el:text element. I did:
<%
   Date curDate = new Date();
   String dateString = curDate.toString();
%>
 
 
 : 


But nothing can be seen in that field.
regards
Wolfgang

Wolfgang Woger wrote:
Hi,
I have a form with a Date:

 

The problem: the formated date is not shown at all, it should have
functioned as the value of that input.
what can I do ?
Wolfgang
-
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: Need help with layered Map iteration in JSP

2004-08-13 Thread Kris Schneider
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>


  <%-- ${entry.key} is the current key --%>
  <%-- ${entry.value} is the associated bean array --%>
  
...
  


Quoting Erik Weber <[EMAIL PROTECTED]>:

> I could use some Struts-EL/JSTL tag help, please.
> 
> I have a Map with each entry having a String as the key and a bean array 
> as the value.
> 
> I need two iterations, one nested inside the other.
> 
> For the outer iteration, I want to iterate the keySet of the Map. I 
> don't know what the keys are going to be or how many there will be.
> 
> Within that iteration, for each key in the keySet, I need to iterate 
> over the buckets of the array that is the value for that key.
> 
> To make this more clear, let's say I will produce a table of tables, 
> somewhat like this:
> 
> 
> 
>   
> 
>   
> 
>   
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
>   
> 
> 
> 
>   
> 
>   
> 
>   
> 
>   
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
>   
> 
> 
> 
>   
> 
>   
> 
>   
> 
> 
> 
> 
> Could someone show me some skeleton JSTL or Struts-el code?
> 
> I would appreciate it very much,
> Erik

-- 
Kris Schneider 
D.O.Tech   

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



Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in 
any event.  The better button solution involves making only one button 
and then nuking that button as soon as you determine what image was 
clicked.  I just nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking on 
one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTracer tracer) {
deleteButton = tracer;
}
}
public class ImageButtonTracer {
private Map clickedButtons;
public ImageButtonTracer() {
clickedButtons = new HashMap();
}
public Button getItem(int index) {
Button toReturn = (Button) clickedButtons.get(new 
Integer(index));
if (toReturn == null) toReturn = new Button();
clickedButtons.put(new Integer(index), toReturn);
return toReturn;
}

public void setItem(int index, Button button) {
logger.debug("setItem(" + index + ")");
clickedButtons.put(new Integer(index), button);
}
public Collection getClickedButtonIndexes() {
return clickedButtons.keySet();
}
public class Button {
private int x;
private int y;
public int getX() { return x; }
public int getY() { return y; }
public void setX(int i) { x = i; }
public void setY(int i) { y = i; }
}
}
public class ChoiceView implements Serializable {
private String key;
private String name;
private String description;
... + getters & setters
}

 
 
   
 
 
 
 
   
 
 
 


public class SaveChoicesAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ChoicesForm cform = (ChoicesForm) form;
ChoiceDAO dao = new ChoiceDAO();
// UPDATE
Iterator i = cform.getChoices().iterator();
while (i.hasNext()) {
ChoiceView view = (ChoiceView) i.next();
Choice toUpdate = ChoiceView.createChoice(view);
dao.update(toUpdate);
}
  // DELETE
Collection deletedIds =
cform.getDeleteButton().getClickedButtonIndexes();
if (deletedIds != null) {
Iterator d = deletedIds.iterator();
while (d.hasNext()) {
int deleteIndex = ((Integer) d.next()).intValue();
ChoiceView toDelete = cform.getChoice(deleteIndex);
Choice choice = ChoiceView.createChoice(toDelete);
dao.delete(choice);
}
}
return mapping.findForward("success");
}
}
ImageButtonTracer can be simplified a bit if one assumes that only one

Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
Thanks!
Erik

Kris Schneider wrote:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

 <%-- ${entry.key} is the current key --%>
 <%-- ${entry.value} is the associated bean array --%>
 
   ...
 

Quoting Erik Weber <[EMAIL PROTECTED]>:
 

I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:


 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 

Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
   

 

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
See http://wiki.apache.org/struts/StrutsCatalogMultipleImageTagsSimplified
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking on 
one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTracer tracer) {
deleteButton = tracer;
}
}
public class ImageButtonTracer {
private Map clickedButtons;
public ImageButtonTracer() {
clickedButtons = new HashMap();
}
public Button getItem(int index) {
Button toReturn = (Button) clickedButtons.get(new 
Integer(index));
if (toReturn == null) toReturn = new Button();
clickedButtons.put(new Integer(index), toReturn);
return toReturn;
}

public void setItem(int index, Button button) {
logger.debug("setItem(" + index + ")");
clickedButtons.put(new Integer(index), button);
}
public Collection getClickedButtonIndexes() {
return clickedButtons.keySet();
}
public class Button {
private int x;
private int y;
public int getX() { return x; }
public int getY() { return y; }
public void setX(int i) { x = i; }
public void setY(int i) { y = i; }
}
}
public class ChoiceView implements Serializable {
private String key;
private String name;
private String description;
... + getters & setters
}

 
 
   
 
 
 
 
   
 
 
 


public class SaveChoicesAction extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ChoicesForm cform = (ChoicesForm) form;
ChoiceDAO dao = new ChoiceDAO();
// UPDATE
Iterator i = cform.getChoices().iterator();
while (i.hasNext()) {
ChoiceView view = (ChoiceView) i.next();
Choice toUpdate = ChoiceView.createChoice(view);
dao.update(toUpdate);
}
  // DELETE
Collection deletedIds =
cform.getDeleteButton().getClickedButtonIndexes();
if (deletedIds != null) {
Iterator d = deletedIds.iterator();
while (d.hasNext()) {
int deleteIndex = ((Integer) d.next()).intValue();
ChoiceView toDelete = cform.getChoice(deleteIndex);
Choice choice = ChoiceView.createChoice(toDelete);
dao.delete(choice);
}
}
return mapping.findForward("success");
}
}
ImageButtonTracer can be simplified a bit if one assumes that only one 
button can be clicked per request (as is the case) => public 
Collection getClickedButtonIndexes()  can be changed to public int 
getClickedButtonIndex(). This works, and I can use indexed properties 
somewhat comfortably.

Any improvements / alternatives are welcome.
_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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



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

Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Michael McGrady
Niall Pemberton wrote:
I don't have anything that implements Map - but I developed a LazyDynaMap
and flavours of ActionForm which use it
To use it you need...
* Struts Nightly Build
http://cvs.apache.org/builds/jakarta-struts/nightly/
* BeanUtils 1.7.0 Release
http://jakarta.apache.org/site/binindex.cgi
* LazyValidatorMap  or LazyValidatorActionMap
http://www.niallp.pwp.blueyonder.co.uk/lazyforms.zip
Full Info on my web site:
 http://www.niallp.pwp.blueyonder.co.uk
Niall
Niall,
This is the prior message I was referring to:
To: "Struts Developers List" <[EMAIL PROTECTED]>
Subject: Re:  this.that.x=4 and this.that.y=9 translations
 in  ActionForm
At 08:53 AM 8/10/2004, you wrote:
Have you tried this with the latest nightly build - I was having similar
problems with some of the standard parameters struts uses (e.g. Cancel
button indicator and Transaction tokens) - my forms were trying to get the
"org" bean.
I changed the form population mechanims to ignore parameters that start
"org.apache.struts." recently to resolve this - try it with the nightly
build.
Niall
What do I need to use this?
Thanks, Michael

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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly implement 
this kind of functionality using them. 

All the solutions involve parsing the request parameters, Janne.  That 
is clearly the only way you will ever know what they are.  The 
difference is that there is a clear, extensible, light, fast, loosely 
coupled, solution and a messy, solution specific, heavy, slow, tightly 
coupled version of the solution.  You are seeking the latter for some 
reason.  There is NO reason to couple your solution to Struts.  Struts 
is a framework and is not meant to be a fulcrum to solve this problem.  
If you were using the solution I have suggested for "ages", you should 
go back to it.  Your present solution is horrible in comparison.  That 
is just plain true.

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


Re: Accessing bean properties problem

2004-08-13 Thread Janne Mattila
I am well aware of the solution that you suggest and the fact that you think 
other solutions are over-engineered - I did indeed try to search for a 
solution before creating my own, and noticed the wiki page with the original 
over-engineered solution (which I noticed did change just recently).

There are two problems, first, your solution does not solve my case. Note 
that this is not a simple case of distinguishing whether "accept" or "nuke" 
was clicked (for those I would not certainly have used the original strategy 
from the wiki page, I agree with over-engineering there) - I want to get the 
ID conveniently as well. Please refer to earlier posts for details. Of 
course, I can add more parsing code to get also the ID, but this does not 
help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one important 
being parsing HttpServletRequest parameters so I do not have to deal with 
them manually. This service comes with a price - I have to spend time to 
learn the principles of the framework and all the small annoying quirks and 
unintuitive details (so far I've ran into quite a few!). If I have to both 
learn to cope with Struts and still continue to parse request parameters 
manually like I have done so many times before, the deal does not sound so 
good to me. The solution you suggest works, is not too complicated, but it 
does not integrate as seamlessly with the rest of the framework and how it 
is used to handle parameters. Button parameters end up being an exception to 
the general rule and I prefer a "pretty" solution. The solution I described 
also integrates nicely to the way other indexed properties are handled on 
the JSP page.

I don't know, but I am currently satisfied with the solution I am using. I 
end up creating one additional class (ImageButtonTracer) and add instance of 
it as a field to each form that requires this kind of "indexed buttons". You 
would probably create one additional helper class (with a further developed 
version of the method you present) and add parameter name encoding logic to 
each form that contains such buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in any 
event.  The better button solution involves making only one button and then 
nuking that button as soon as you determine what image was clicked.  I just 
nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To recap, I 
want to have a page with several delete buttons. Clicking on one button 
would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have 
not quite figured out how to properly implement this kind of 
functionality using them.

I finally figured out a reasonably satisfying way to do this while using 
Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonTracer();
}
public ChoiceView getChoice(int index) {
// if struts tries to get item with id index,
// and it does not exist,
// add new items until ok.
while (choices.size() <= index) {
choices.add(new ChoiceView());
}
List lChoices = (List) choices;
return (ChoiceView) lChoices.get(index);
}
public Collection getChoices() {
return choices;
}
public void setChoices(Collection collection) {
choices = collection;
}
public ImageButtonTracer getDeleteButton() {
return deleteButton;
}
public void setDeleteButton(ImageButtonTr

Spring/Struts & Hibernate

2004-08-13 Thread Marco Mistroni
Hello mark,
How r u? hope fine...
i saw some of ur posts in the past about Spring framework and
I wanted to ask u few questions.. 

are you using Spring? Together with Struts?

What do you think about it?


Thanx in advance and regards
Marco



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



Re: Accessing bean properties problem

2004-08-13 Thread Janne Mattila


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 06:22:38 -0700
Janne Mattila wrote:
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I started 
learning Struts :) I was just expecting that Struts would somehow help me 
with this task. I have been looking into indexed properties but I have 
not quite figured out how to properly implement this kind of 
functionality using them.

All the solutions involve parsing the request parameters, Janne.  That is 
clearly the only way you will ever know what they are.  The difference is 
that there is a clear, extensible, light, fast, loosely coupled, solution 
and a messy, solution specific, heavy, slow, tightly coupled version of the 
solution.  You are seeking the latter for some reason.  There is NO reason 
to couple your solution to Struts.  Struts is a framework and is not meant 
to be a fulcrum to solve this problem.  If you were using the solution I 
have suggested for "ages", you should go back to it.  Your present solution 
is horrible in comparison.  That is just plain true.
If you use Struts to do your HTTP request processing, you'll couple your 
HTTP request processing to Struts. I don't know what all this nonsense about 
"decoupling from Struts" is meant to be. That is the whole point of using 
Struts, there is absolutely no logic in trying to decouple you application's 
HTTP parameter handling from Struts. It is what Struts does.

You seem to like parsing HttpServletRequests manually, so why don't you skip 
Struts altogether and parse all request parameters manually? I bet it would 
be "clear, extensible, light, fast, loosely coupled solution". Hell, who 
needs ActionForms after all? They make your solution tightly coupled to 
Struts!

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

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


Caching Framework

2004-08-13 Thread ravi.vedala

Hi,

Is there any Caching framework available for struts ?

For eg: I need to cache some list of objects ...etc.,

Ravi





Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

Re: Caching Framework

2004-08-13 Thread Erik Weber
Ravi, without getting real complicated, I use PlugIns to do this!
Implement org.apache.struts.action.PlugIn. You only need to write two 
methods -- init and destroy. In your init method, gather some data store 
it as application scope attributes (you get a reference to the 
controller Servlet in the init method). Finally, register your PlugIn 
with struts-config.xml. When your Struts app initializes, your PlugIn's 
init method is invoked. Your JSPs now have easy access to the cached 
data, as do your Actions.

Erik

[EMAIL PROTECTED] wrote:
Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
Ravi


Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.
 

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


RE: Caching Framework

2004-08-13 Thread ravi.vedala

That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two
methods -- init and destroy. In your init method, gather some data store
it as application scope attributes (you get a reference to the
controller Servlet in the init method). Finally, register your PlugIn
with struts-config.xml. When your Struts app initializes, your PlugIn's
init method is invoked. Your JSPs now have easy access to the cached
data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain confidential or privileged information. If
>you are not the intended recipient, please notify the sender at Wipro
>or [EMAIL PROTECTED] immediately and destroy all copies of this message and any 
>attachments.
> 
>

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




Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



RE: Caching Framework

2004-08-13 Thread Richard Cave
Ravi,

We've just implemented a master data load using the same technique as Eric.
Appears to be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this message
and any attachments.
> 

>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

-
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]



Validating indexed properties

2004-08-13 Thread Bill Siggelkow
I posted this message to the commons-user list but didn't receive any 
feedback. Basically, I am trying to get the indexedListProperty feature 
of Validator to allow me to report errors correctly for each property on 
a form that fails validation -- the only way I could get it to work was 
to change the Validator Field class -- I am trying to find out if there 
are any other known work arounds.
===
I have been working with indexedListProperty in Struts 1.2 (using 
Validator 1.1.3, I believe). Suppose I have the following validation:



   
   
   
   minlength
   5
   


Now, when I validate the form, if the minlength validation fails on one 
of the indexed properties, then none of the rest of the partNumber 
fields are checked for minlength.

I am using Struts and I was trying to output the error message beside 
the property using html:messages -- the result is that the error message 
is only generated for the first property that fails.

For what its worth, I did hack a fix -- I changed the
ValidatorResults validate(Map params, Map actions) method in the Field 
class [org.apache.commons.validator.Field].

Basically where it had (on line 724):
-
if (!good) {
return allResults;
}

I made it ...
-
if (!good && numberOfFieldsToValidate <= 1) {
return allResults;
}

This worked -- in other words I get all the messages generated for each 
field if the field is indexed.

Any opinions on ramifications of making this change or other possible 
solutions? I have not messed at all with the client-side javascript so I 
am not sure what the behavior is like there.

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


RE: Caching Framework

2004-08-13 Thread rahul.chaudhary
--- Begin Message ---
One option is to use the singleton pattern. It also depends upon what functionality 
are you looking for e.g. frequency of cache update.. and many more..

-Original Message- 
From: Ravi Vedala (WT01 - FINANCE BANKING & SERVICES) 
Sent: Fri 8/13/2004 6:38 AM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: Caching Framework




Hi,


Is there any Caching framework available for struts ?


For eg: I need to cache some list of objects ...etc.,


Ravi






Confidentiality Notice


The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or 
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments. 

<>--- End Message ---

Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to help the user navigate to his own folder

2004-08-13 Thread Bill Siggelkow
I suggest you slide (couldn't resist:) on over to 
http://jakarta.apache.org/site/mail2.html#Slide.

Gao Jun wrote:
Hi everyone,
 
I've a problem in using Slide and I'd like to hear your suggestion.
We are using slide to implement a document management system and we
will assign specific users access to specific folders. For example,
we have a doc tree like,
 
A
   -B1
-C
   -B2
 
One user has the access to folder C, so he can read and write in folder C.
However, I have the problem of letting this user enter C folder. 
First, because he doesn't have access to A and B1, so he can't navigate to
C by enter A first, then enter B1.
Second, if I let this user jump into C directly, this user should know his
folder has the path A/B1/C. But does Slide provide a way (some api) to let
us find this users all available paths?
 
Have you ever met this kind of problem? Any suggestion?
 
Thanks and regards,
 
Jun

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


RE: Caching Framework

2004-08-13 Thread Guillermo Meyer
You could use Providers (http://providers.sourceforge.net) to handle collections
of objects, cache them and in addition use these collection to populate
select tags, create dependant drop down lists and display labels (descriptions)
according to an ID (i.e using  tag similar to  Struts )

With providers you can create collections with different strategies (fixed,
JDBC, filtered, etc) and optionally you could create your own collection
factory.

Cheers.
Guillermo.

>-- Mensaje original --
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Caching Framework
>Date:  Fri, 13 Aug 2004 19:08:31 +0530
>From:  <[EMAIL PROTECTED]>
>To:<[EMAIL PROTECTED]>
>
>
>
>Hi,
>
>
>Is there any Caching framework available for struts ?
>
>
>For eg: I need to cache some list of objects ...etc.,
>
>
>Ravi
>
>
>
>
>
>
>Confidentiality Notice
>
>
>The information contained in this electronic message and any attachments
>to this message are intended
>for the exclusive use of the addressee(s) and may contain confidential
or
>privileged information. If
>you are not the intended recipient, please notify the sender at Wipro or
>[EMAIL PROTECTED] immediately
>and destroy all copies of this message and any attachments.



FiberTel, el nombre de la banda ancha http://www.fibertel.com.ar



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



Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
No mas, Janne!  If you think that your serpentine code is superior to 
the following:

public class ButtonMiner {
 public int getId(HttpServletRequest request) {
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   buttonValue = parameterName.substring(0,parameterName.indexOf('.'));
 }
 return Integer.parseInt(buttonValue.substring(1));
 }
}
which you could get from indexing "_", then go for it!  I have no more 
to say.

Michael
Janne Mattila wrote:
I am well aware of the solution that you suggest and the fact that you 
think other solutions are over-engineered - I did indeed try to search 
for a solution before creating my own, and noticed the wiki page with 
the original over-engineered solution (which I noticed did change just 
recently).

There are two problems, first, your solution does not solve my case. 
Note that this is not a simple case of distinguishing whether "accept" 
or "nuke" was clicked (for those I would not certainly have used the 
original strategy from the wiki page, I agree with over-engineering 
there) - I want to get the ID conveniently as well. Please refer to 
earlier posts for details. Of course, I can add more parsing code to 
get also the ID, but this does not help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one 
important being parsing HttpServletRequest parameters so I do not have 
to deal with them manually. This service comes with a price - I have 
to spend time to learn the principles of the framework and all the 
small annoying quirks and unintuitive details (so far I've ran into 
quite a few!). If I have to both learn to cope with Struts and still 
continue to parse request parameters manually like I have done so many 
times before, the deal does not sound so good to me. The solution you 
suggest works, is not too complicated, but it does not integrate as 
seamlessly with the rest of the framework and how it is used to handle 
parameters. Button parameters end up being an exception to the general 
rule and I prefer a "pretty" solution. The solution I described also 
integrates nicely to the way other indexed properties are handled on 
the JSP page.

I don't know, but I am currently satisfied with the solution I am 
using. I end up creating one additional class (ImageButtonTracer) and 
add instance of it as a field to each form that requires this kind of 
"indexed buttons". You would probably create one additional helper 
class (with a further developed version of the method you present) and 
add parameter name encoding logic to each form that contains such 
buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something 
similar, however.  As I menteioned before, I just use the following 
code to determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated 
in any event.  The better button solution involves making only one 
button and then nuking that button as soon as you determine what 
image was clicked.  I just nuked the whole solution, since it is 
unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To 
recap, I want to have a page with several delete buttons. Clicking 
on one button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from 
database. Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts would 
somehow help me with this task. I have been looking into indexed 
properties but I have not quite figured out how to properly 
implement this kind of functionality using them.

I finally figured out a reasonably satisfying way to do this while 
using Struts to help as much as possible:

public class ChoicesForm extends ActionForm {
private Collection choices;
private ImageButtonTracer deleteButton;
public void reset(ActionMapping arg0, HttpServletRequest arg1) {
this.choices = new ArrayList();
this.deleteButton = new ImageButtonT

Re: Caching Framework

2004-08-13 Thread Erik Weber
// your PlugIn implementation
public class SimpleCache implements org.apache.struts.action.PlugIn {
   public void init(org.apache.struts.action.ActionServlet controller, 
org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException {
javax.servlet.ServletContext app = controller.getServletContext();
   //invoke some DAO methods to get arrays of String values;
   //for example, labels & values for the fifty US states
   //to be used in an HTML select
DAO someDAO = new DAO();
   app.setAttribute("USStateLabels", someDAO.getUSStateLabels()); // "Alabama", 
"Arkansas", etc.
   app.setAttribute("USStateValues", someDAO.getUSStateValues()); // "AL", "AR", 
etc.
   }
   public void destroy() {
   }
}
. . .

. . .


State:


Cheers,
Erik
[EMAIL PROTECTED] wrote:
That's really a great idea Erik.
Can you please point me to some example.
Thanks Erik,
Regds
Ravi
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework
Ravi, without getting real complicated, I use PlugIns to do this!
Implement org.apache.struts.action.PlugIn. You only need to write two
methods -- init and destroy. In your init method, gather some data store
it as application scope attributes (you get a reference to the
controller Servlet in the init method). Finally, register your PlugIn
with struts-config.xml. When your Struts app initializes, your PlugIn's
init method is invoked. Your JSPs now have easy access to the cached
data, as do your Actions.
Erik

[EMAIL PROTECTED] wrote:
 

Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
Ravi


Confidentiality Notice
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro
or [EMAIL PROTECTED] immediately and destroy all copies of this message and any 
attachments.
   

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

Confidentiality Notice
The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.
-
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: Accessing bean properties problem

2004-08-13 Thread Janne Mattila
OK, Cap't of the Eh Team!
Maybe you should go and add "Note: this is a clear, extensible, light, fast, 
loosely coupled, solution compared to a messy, solution specific, heavy, 
slow, tightly coupled version!" to the Wiki page? After all, you have 
invented an elegant solution with low cost and with great flexibility and 
freedom!


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 07:11:29 -0700
No mas, Janne!  If you think that your serpentine code is superior to the 
following:

public class ButtonMiner {
 public int getId(HttpServletRequest request) {
   String buttonValue = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   buttonValue = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
 return Integer.parseInt(buttonValue.substring(1));
 }
}

which you could get from indexing "_", then go for it!  I have no more to 
say.

Michael
Janne Mattila wrote:
I am well aware of the solution that you suggest and the fact that you 
think other solutions are over-engineered - I did indeed try to search for 
a solution before creating my own, and noticed the wiki page with the 
original over-engineered solution (which I noticed did change just 
recently).

There are two problems, first, your solution does not solve my case. Note 
that this is not a simple case of distinguishing whether "accept" or 
"nuke" was clicked (for those I would not certainly have used the original 
strategy from the wiki page, I agree with over-engineering there) - I want 
to get the ID conveniently as well. Please refer to earlier posts for 
details. Of course, I can add more parsing code to get also the ID, but 
this does not help with the second problem.

Which is: the purpose of Struts is to help me with some tasks, one 
important being parsing HttpServletRequest parameters so I do not have to 
deal with them manually. This service comes with a price - I have to spend 
time to learn the principles of the framework and all the small annoying 
quirks and unintuitive details (so far I've ran into quite a few!). If I 
have to both learn to cope with Struts and still continue to parse request 
parameters manually like I have done so many times before, the deal does 
not sound so good to me. The solution you suggest works, is not too 
complicated, but it does not integrate as seamlessly with the rest of the 
framework and how it is used to handle parameters. Button parameters end 
up being an exception to the general rule and I prefer a "pretty" 
solution. The solution I described also integrates nicely to the way other 
indexed properties are handled on the JSP page.

I don't know, but I am currently satisfied with the solution I am using. I 
end up creating one additional class (ImageButtonTracer) and add instance 
of it as a field to each form that requires this kind of "indexed 
buttons". You would probably create one additional helper class (with a 
further developed version of the method you present) and add parameter 
name encoding logic to each form that contains such buttons.


From: Michael McGrady <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: Accessing bean properties problem
Date: Fri, 13 Aug 2004 05:57:24 -0700
This is all "over-engineered", Janne.  I used to do something similar, 
however.  As I menteioned before, I just use the following code to 
determine which image was clicked:

   String imageClicked = null;
   Enumeration enum = request.getParameterNames();
   String parameterName = null;
   while(enum.hasMoreElements()) {
 parameterName = (String)enum.nextElement();
 if(parameterName.endsWith(".x")) {
   imageClicked = 
parameterName.substring(0,parameterName.indexOf('.'));
 }
   }
   return imageClicked;

That's all there is to it.  Your button solution is too complicated in 
any event.  The better button solution involves making only one button 
and then nuking that button as soon as you determine what image was 
clicked.  I just nuked the whole solution, since it is unnecessary.

Michael
Janne Mattila wrote:
I described what I wanted to achieve in my original posting. To recap, 
I want to have a page with several delete buttons. Clicking on one 
button would produce parameter

delete_23.x=56
to be sent => we parse that, and delete item with ID 23 from database. 
Choosing a different delete -button would send parameter

delete_304.x=144
=> we delete item with ID 304.
I am aware that I can use the approach you suggested (parse request 
parameters manually), and have been doing that for ages before I 
started learning Struts :) I was just expecting that Struts w

Re: Caching Framework

2004-08-13 Thread kcitron
Use OSCache
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Caching Framework

2004-08-13 Thread ravi.vedala

As I am very new to struts, it would be very helpful if you can point me to some 
sample code.

Thanks for support from everybody.

Regds
Ravi

-Original Message-
From: Richard Cave [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:16 PM
To: 'Struts Users Mailing List'
Subject: RE: Caching Framework


Ravi,

We've just implemented a master data load using the same technique as Eric. Appears to 
be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this
>message
and any attachments.
>

>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to this 
message are intended for the exclusive use of the addressee(s) and may contain 
confidential or privileged information. If you are not the intended recipient, please 
notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of 
this message and any attachments.

-
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]



Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
I guess, to be more concilliatory, Janne, I could say that if you want 
to use your solution, then you could just index item, e.g. 

public Id getIndex(Integer id) {
 return new Id(intValue());
}
Where the class Id is the following:
public class Id {
 private int id;
 public Id(Integer x) {
   id = x.intValue();
 }
 public int getId() {
   return id;
 }
 public void setX(Integer x) {
 }
 public void setY(Integer y) {
 }
}
That gets rid of all your classes and gives you the same result. 


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


Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
OK, Cap't of the Eh Team!
Maybe you should go and add "Note: this is a clear, extensible, light, 
fast, loosely coupled, solution compared to a messy, solution 
specific, heavy, slow, tightly coupled version!" to the Wiki page? 
After all, you have invented an elegant solution with low cost and 
with great flexibility and freedom!

Janne,
You too can be sardonic.  LOL  I guess we are just going to have to 
disagree on this one.  Enjoy coding and have a great day!  I was way 
ahead of you on the Wiki page suggestion though.  LOL

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


Re: Caching Framework

2004-08-13 Thread Vic Cekvenich
In Struts, a layered framework, caching data should happen in the data 
layer. iBatis, Hibrenate, and other DAO's all do caching automaticaly 
and configureable of data, such as drop down selects, etc.
Caching data in View layer is not Strut-y.
.V

[EMAIL PROTECTED] wrote:
Hi,
Is there any Caching framework available for struts ?
For eg: I need to cache some list of objects ...etc.,
 
Ravi



Confidentiality Notice
The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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


RE: Caching Framework

2004-08-13 Thread Richard Cave
Code as follows
Caching class

package com.mypackage.Cache

mport org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.action.ActionServlet;

public class Cacheimplements PlugIn
{
private static Cacheinstance = null;

private ModuleConfig module = null;
private ActionServlet action = null;

public Cache()
{
  if (instance == null)
instance = this;
}

public static Cache getInstance()
{
  if (instance == null)
instance = new Cache();
  return instance;
}
 
 
   
   public void init(ActionServlet action, ModuleConfig module)
   {
 this.action = action;
 this.module = module;

   put your code in here to fire off any caching of data
   }

  public void destroy()
   {
  instance = null;
  action = null;
  module = null;

 any cleanup code.
   }


Add the following into your Struts-config.xml file





Parameters can be supplied to the class using the 

inclusion between the plug-in statements. You would then have a local
declaration in the Cache class with getter and setter methods to access the
parameter.

Hope this helps.

Richard


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 15:29
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



As I am very new to struts, it would be very helpful if you can point me to
some sample code.

Thanks for support from everybody.

Regds
Ravi

-Original Message-
From: Richard Cave [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:16 PM
To: 'Struts Users Mailing List'
Subject: RE: Caching Framework


Ravi,

We've just implemented a master data load using the same technique as Eric.
Appears to be working very well.


Richard

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 13 August 2004 14:54
To: [EMAIL PROTECTED]
Subject: RE: Caching Framework



That's really a great idea Erik.

Can you please point me to some example.

Thanks Erik,

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]

Sent: Friday, August 13, 2004 7:21 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


Ravi, without getting real complicated, I use PlugIns to do this!

Implement org.apache.struts.action.PlugIn. You only need to write two

methods -- init and destroy. In your init method, gather some data store

it as application scope attributes (you get a reference to the

controller Servlet in the init method). Finally, register your PlugIn

with struts-config.xml. When your Struts app initializes, your PlugIn's

init method is invoked. Your JSPs now have easy access to the cached

data, as do your Actions.

Erik



[EMAIL PROTECTED] wrote:

>Hi,
>
>Is there any Caching framework available for struts ?
>
>For eg: I need to cache some list of objects ...etc.,
>
>Ravi
>
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any

>attachments to this message are intended for the exclusive use of the

>addressee(s) and may contain confidential or privileged information. If

>you are not the intended recipient, please notify the sender at Wipro

>or [EMAIL PROTECTED] immediately and destroy all copies of this

>message
and any attachments.
>


>

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




Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender at Wipro or [EMAIL PROTECTED]
immediately and destroy all copies of this message and any attachments.

-
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]



Confidentiality Notice


The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.

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

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

Re: Accessing bean properties problem

2004-08-13 Thread Michael McGrady
Janne Mattila wrote:
You seem to like parsing HttpServletRequests manually, so why don't 
you skip Struts altogether and parse all request parameters manually? 
I bet it would be "clear, extensible, light, fast, loosely coupled 
solution". Hell, who needs ActionForms after all? They make your 
solution tightly coupled to Struts!
The forms are meant to mine values.  They are not meant to supplant 
business logic.  The question is not about "manual" parsing.  The 
question is when and how to parse.  Parsing is parsing -- is "manual" of 
necessity.   There is a difference between "manual" and "hard coding". 

ActionForms are not tightly coupled to Struts.  They are Struts.  I for 
one am a great advocate of Struts and believe in fact that in the end it 
will be preferred to JSF by a long shot.  Still, loose coupling is a 
primary goal of Struts, not the opposite.  I am not sure why you prefer 
your solution.  I cannot see a single advantage in practice to it.  But, 
as I said, c'est la vie!

Michael


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


RE: Caching Framework

2004-08-13 Thread ravi.vedala

Thanks a ton Erik.

Regds
Ravi

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Friday, August 13, 2004 7:41 PM
To: Struts Users Mailing List
Subject: Re: Caching Framework


// your PlugIn implementation

public class SimpleCache implements org.apache.struts.action.PlugIn {

public void init(org.apache.struts.action.ActionServlet controller, 
org.apache.struts.config.ModuleConfig config) throws javax.servlet.ServletException {

javax.servlet.ServletContext app = controller.getServletContext();

//invoke some DAO methods to get arrays of String values;

//for example, labels & values for the fifty US states

//to be used in an HTML select

DAO someDAO = new DAO();

app.setAttribute("USStateLabels", someDAO.getUSStateLabels()); // "Alabama", 
"Arkansas", etc.

app.setAttribute("USStateValues", someDAO.getUSStateValues()); // "AL", "AR", 
etc.

}

public void destroy() {

}

}


 . . .




. . .



State:
 


Cheers,
Erik


[EMAIL PROTECTED] wrote:

>That's really a great idea Erik.
>
>Can you please point me to some example.
>
>Thanks Erik,
>
>Regds
>Ravi
>
>-Original Message-
>From: Erik Weber [mailto:[EMAIL PROTECTED]
>Sent: Friday, August 13, 2004 7:21 PM
>To: Struts Users Mailing List
>Subject: Re: Caching Framework
>
>
>Ravi, without getting real complicated, I use PlugIns to do this!
>
>Implement org.apache.struts.action.PlugIn. You only need to write two
>methods -- init and destroy. In your init method, gather some data
>store it as application scope attributes (you get a reference to the
>controller Servlet in the init method). Finally, register your PlugIn
>with struts-config.xml. When your Struts app initializes, your PlugIn's
>init method is invoked. Your JSPs now have easy access to the cached
>data, as do your Actions.
>
>Erik
>
>
>
>[EMAIL PROTECTED] wrote:
>
> 
>
>>Hi,
>>
>>Is there any Caching framework available for struts ?
>>
>>For eg: I need to cache some list of objects ...etc.,
>>
>>Ravi
>>
>>
>>
>>
>>
>>Confidentiality Notice
>>
>>The information contained in this electronic message and any
>>attachments to this message are intended for the exclusive use of the
>>addressee(s) and may contain confidential or privileged information.
>>If you are not the intended recipient, please notify the sender at
>>Wipro or [EMAIL PROTECTED] immediately and destroy all copies of
>>this message and any attachments.
>>
>>
>>   
>>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>Confidentiality Notice
>
>The information contained in this electronic message and any
>attachments to this message are intended for the exclusive use of the
>addressee(s) and may contain confidential or privileged information. If
>you are not the intended recipient, please notify the sender at Wipro
>or [EMAIL PROTECTED] immediately and destroy all copies of this
>message and any attachments.
>
>-
>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]





Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
I was taking a look at the HttpServeltRequest and
ServletRequest apis and noted that theres a method
"getParameterMap()" wich returns a map of the
parameters, BUT there isn`t such a "setParameterMap()"
method.

So, what`s an automated way to re-set all my request
parameters in the ActionForm??? Do i have to go one by
one for each ActionForm :-( ???


 --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu: 
> Ensure that the request attributes are set in the
> ActionForm, this is 
> the only way that you can ensure that they'll still
> be there when the 
> validate fails.
> 
> Leandro Melo wrote:
> 
> >Hi,
> >when a user request hits the ActionForm's validate
> >method and bounces back, i'm loosing some request
> >attributes that i had set for the page. In other
> >words, if the user inputs some data that don't pass
> >the validate method,
> >the page comes back with a few request scope
> >attributes missing.
> >
> >Is there a way to avoid that this happens?
> >
> >=
> >_
> >Leandro Terra C. Melo
> >Eng. de Controle e Automação - UFMG
> >
> >
> > 
> > 
> > 
>
>___
> >Yahoo! Acesso Grátis - navegue de graça com conexão
> de qualidade! Acesse: http://br.acesso.yahoo.com/
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >  
> >
> 
> -- 
> Brice Ruth, Sr. IT Analyst
> Fiskars Brands Inc
> http://www.fiskarsbrands.com/
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Loosing request attributes

2004-08-13 Thread Robert Taylor
form.reset();

robert

> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 11:20 AM
> To: Struts Users Mailing List
> Subject: Re: Loosing request attributes
>
>
> I was taking a look at the HttpServeltRequest and
> ServletRequest apis and noted that theres a method
> "getParameterMap()" wich returns a map of the
> parameters, BUT there isn`t such a "setParameterMap()"
> method.
>
> So, what`s an automated way to re-set all my request
> parameters in the ActionForm??? Do i have to go one by
> one for each ActionForm :-( ???
>
>
>  --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> > Ensure that the request attributes are set in the
> > ActionForm, this is
> > the only way that you can ensure that they'll still
> > be there when the
> > validate fails.
> >
> > Leandro Melo wrote:
> >
> > >Hi,
> > >when a user request hits the ActionForm's validate
> > >method and bounces back, i'm loosing some request
> > >attributes that i had set for the page. In other
> > >words, if the user inputs some data that don't pass
> > >the validate method,
> > >the page comes back with a few request scope
> > >attributes missing.
> > >
> > >Is there a way to avoid that this happens?
> > >
> > >=
> > >_
> > >Leandro Terra C. Melo
> > >Eng. de Controle e Automação - UFMG
> > >
> > >
> > >
> > >
> > >
> >
> >___
> > >Yahoo! Acesso Grátis - navegue de graça com conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > >
> >
> >-
> > >To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > >For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > Brice Ruth, Sr. IT Analyst
> > Fiskars Brands Inc
> > http://www.fiskarsbrands.com/
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
> =
>
>
>
>
>
>
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
> http://br.acesso.yahoo.com/
>
> -
> 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: Loosing request attributes

2004-08-13 Thread Leandro Melo
I don`t want to reset the attributes of my ActionForm
(what a form.reset() would do), BUT the attributes of
the request the were probably set by the Action that
forwarded to the specific page.

So i need them back in that page if validate fails.


 --- Robert Taylor <[EMAIL PROTECTED]> escreveu: 
> form.reset();
> 
> robert
> 
> > -Original Message-
> > From: Leandro Melo
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 11:20 AM
> > To: Struts Users Mailing List
> > Subject: Re: Loosing request attributes
> >
> >
> > I was taking a look at the HttpServeltRequest and
> > ServletRequest apis and noted that theres a method
> > "getParameterMap()" wich returns a map of the
> > parameters, BUT there isn`t such a
> "setParameterMap()"
> > method.
> >
> > So, what`s an automated way to re-set all my
> request
> > parameters in the ActionForm??? Do i have to go
> one by
> > one for each ActionForm :-( ???
> >
> >
> >  --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> > > Ensure that the request attributes are set in
> the
> > > ActionForm, this is
> > > the only way that you can ensure that they'll
> still
> > > be there when the
> > > validate fails.
> > >
> > > Leandro Melo wrote:
> > >
> > > >Hi,
> > > >when a user request hits the ActionForm's
> validate
> > > >method and bounces back, i'm loosing some
> request
> > > >attributes that i had set for the page. In
> other
> > > >words, if the user inputs some data that don't
> pass
> > > >the validate method,
> > > >the page comes back with a few request scope
> > > >attributes missing.
> > > >
> > > >Is there a way to avoid that this happens?
> > > >
> > > >=
> > > >_
> > > >Leandro Terra C. Melo
> > > >Eng. de Controle e Automação - UFMG
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
>___
> > > >Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > > de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > > >
> > >
> >
>
>-
> > > >To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > >For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > >
> > > --
> > > Brice Ruth, Sr. IT Analyst
> > > Fiskars Brands Inc
> > > http://www.fiskarsbrands.com/
> > >
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> >
> > =
> >
> >
> >
> >
> >
> >
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> >
> >
>
-
> > 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]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Loosing request attributes

2004-08-13 Thread Erik Weber
You shouldn't have to do anything (in general, you rarely need to 
implement reset) special for this. Struts does this for you. The user 
submits the form. The form bean is populated with the user's input. 
Validation starts on the form bean. Validation fails. Struts forwards 
back to the input page, and the struts tags render all the values that 
the user had input using the populated form bean.

Could you describe in more detail which types of form values seem to be 
"missing" and which ones are intact? Is there a pattern to it?

Erik

Leandro Melo wrote:
I don`t want to reset the attributes of my ActionForm
(what a form.reset() would do), BUT the attributes of
the request the were probably set by the Action that
forwarded to the specific page.
So i need them back in that page if validate fails.
--- Robert Taylor <[EMAIL PROTECTED]> escreveu: 
 

form.reset();
robert
   

-Original Message-
From: Leandro Melo
 

[mailto:[EMAIL PROTECTED]
   

Sent: Friday, August 13, 2004 11:20 AM
To: Struts Users Mailing List
Subject: Re: Loosing request attributes
I was taking a look at the HttpServeltRequest and
ServletRequest apis and noted that theres a method
"getParameterMap()" wich returns a map of the
parameters, BUT there isn`t such a
 

"setParameterMap()"
   

method.
So, what`s an automated way to re-set all my
 

request
   

parameters in the ActionForm??? Do i have to go
 

one by
   

one for each ActionForm :-( ???
--- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
 

Ensure that the request attributes are set in
   

the
   

ActionForm, this is
the only way that you can ensure that they'll
   

still
   

be there when the
validate fails.
Leandro Melo wrote:
   

Hi,
when a user request hits the ActionForm's
 

validate
   

method and bounces back, i'm loosing some
 

request
   

attributes that i had set for the page. In
 

other
   

words, if the user inputs some data that don't
 

pass
   

the validate method,
the page comes back with a few request scope
attributes missing.
Is there a way to avoid that this happens?
=
_
Leandro Terra C. Melo
Eng. de Controle e Automação - UFMG


 

___
   

Yahoo! Acesso Grátis - navegue de graça com
 

conexão
   

de qualidade! Acesse:
   

http://br.acesso.yahoo.com/
   

-
   

To unsubscribe, e-mail:
 

[EMAIL PROTECTED]
   

For additional commands, e-mail:
 

[EMAIL PROTECTED]
   

 

--
Brice Ruth, Sr. IT Analyst
Fiskars Brands Inc
http://www.fiskarsbrands.com/

   

-
 

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

=



 

___
 

Yahoo! Acesso Grátis - navegue de graça com
 

conexão de qualidade! Acesse:
http://br.acesso.yahoo.com/
   

 

-
 

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]
   

=




___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/
-
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: Spring/Struts & Hibernate

2004-08-13 Thread James Mitchell
I am using it.  It works great.



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

- Original Message - 
From: "Marco Mistroni" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 9:31 AM
Subject: Spring/Struts & Hibernate


> Hello mark,
> How r u? hope fine...
> i saw some of ur posts in the past about Spring framework and
> I wanted to ask u few questions.. 
> 
> are you using Spring? Together with Struts?
> 
> What do you think about it?
> 
> 
> Thanx in advance and regards
> Marco
> 
> 
> 
> -
> 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] Friday: where's Atlanta Mark?

2004-08-13 Thread Michael McGrady
Whatever happened to Friday Mark the beer hustler from Atlanta?  This 
list seems much less active.  What does that mean?

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


Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Erik Weber
How can I refer to the index of the current iteration with c:forEach 
(analogous to the indexId attribute to logic:iterate)?

Thanks,
Erik
Kris Schneider wrote:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

 <%-- ${entry.key} is the current key --%>
 <%-- ${entry.value} is the associated bean array --%>
 
   ...
 

Quoting Erik Weber <[EMAIL PROTECTED]>:
 

I could use some Struts-EL/JSTL tag help, please.
I have a Map with each entry having a String as the key and a bean array 
as the value.

I need two iterations, one nested inside the other.
For the outer iteration, I want to iterate the keySet of the Map. I 
don't know what the keys are going to be or how many there will be.

Within that iteration, for each key in the keySet, I need to iterate 
over the buckets of the array that is the value for that key.

To make this more clear, let's say I will produce a table of tables, 
somewhat like this:


 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 
 
   
 
   
   
   
 
 
   
   
   
   
 
 
   
   
 
   
 
 
 

Could someone show me some skeleton JSTL or Struts-el code?
I would appreciate it very much,
Erik
   

 

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


Re: Need help with layered Map iteration in JSP

2004-08-13 Thread Kris Schneider
 supports a "varStatus" attribute. The value of that atrribute is a
String that names an instance of javax.servlet.jsp.jstl.core.LoopTagStatus. The
LoopTagStatus instance has nested visibility so that it's only available within
the enclosing  tag. LoopTagStatus exposes a number of properties,
but the one you're probably interested in is "index":

..
  
<%-- ${status.index} is the current index --%>
...
  
..

Quoting Erik Weber <[EMAIL PROTECTED]>:

> How can I refer to the index of the current iteration with c:forEach 
> (analogous to the indexId attribute to logic:iterate)?
> 
> Thanks,
> Erik
> 
> 
> Kris Schneider wrote:
> 
> ><%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> >
> >
> >  <%-- ${entry.key} is the current key --%>
> >  <%-- ${entry.value} is the associated bean array --%>
> >  
> >...
> >  
> >
> >
> >Quoting Erik Weber <[EMAIL PROTECTED]>:
> >
> >  
> >
> >>I could use some Struts-EL/JSTL tag help, please.
> >>
> >>I have a Map with each entry having a String as the key and a bean array 
> >>as the value.
> >>
> >>I need two iterations, one nested inside the other.
> >>
> >>For the outer iteration, I want to iterate the keySet of the Map. I 
> >>don't know what the keys are going to be or how many there will be.
> >>
> >>Within that iteration, for each key in the keySet, I need to iterate 
> >>over the buckets of the array that is the value for that key.
> >>
> >>To make this more clear, let's say I will produce a table of tables, 
> >>somewhat like this:
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>Could someone show me some skeleton JSTL or Struts-el code?
> >>
> >>I would appreciate it very much,
> >>Erik

-- 
Kris Schneider 
D.O.Tech   

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



Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Niall Pemberton
Just the latest nightly build.
- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 6:12 AM
Subject: Re: Bean-Map-Forms: what do I need Niall


> Niall Pemberton wrote:
>
> >I don't have anything that implements Map - but I developed a LazyDynaMap
> >and flavours of ActionForm which use it
> >
>
> Apparently you have forgotten our discussion a few days ago.  I have
> implemented a BeanMapForm which you said the nightlies would allow me to
> use, since they no longer read org.apache as org.getApache().  The
> BeanMapForm is at
> http://wiki.apache.org/struts/StrutsCatalogInstrumentableForms.  I was
> asking what I needed to do that.
>
> Thanks,
>
> Michael
>
>
> -
> 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]



Read only iterate?

2004-08-13 Thread Mike Elliott
I've been totally defeated in my attempt to alter an html:text
element inside a logic:iterate tag.  There must be a way to
accomplish this, but I've been beating my head against the wall
for three days now without making progress.

I have simplified the problem substantially from the initial page.
What I have now looks like this:

   -
  [ Submit ]
   Problematic Input [0   ]
   Problematic Input [1   ]
   Functioning Input [A Value ]
   -

The lines containing "Problematic Input" were generated by a
logic:iterate tag, which successfully fetched the list of objects from
the form bean.  The last line, containing "Functioning Input", was
generated outside of the logic:iterate tag.  Actual contents of the
jsp page, bean, etc., are attached.

What happens at runtime is that when the JSP page is rendered, the
text fields for all three rows are successfully and correctly fetched
from the form bean, but only the last row can be changed.  As the log
shows:


  INFO  [org.apache.struts.util.PropertyMessageResources] Initializing, 
config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
  INFO  [problem.ProblemBean] initializing entries
  INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
  INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
  INFO  [problem.ProblemAction] show
  INFO  [org.apache.struts.util.PropertyMessageResources] Initializing, 
config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
  INFO  [problem.ProblemBean] getEntries
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean] getWorking_perfectly

  INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
  INFO  [problem.ProblemAction] update
  INFO  [problem.ProblemBean] getEntries
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean$ProblemItem] getInteger_value
  INFO  [problem.ProblemBean] getWorking_perfectly

The page is initialized properly.  All three values are fetched from
the form bean via the expected get methods.  The html form is properly
populated and displays the expected values (0, 1, and "A Value").

The three fields are then changed (to 5, 5, and "mutated") and the
submit button is selected at the point in the log file where I have
inserted the  annotation.

This causes the form to be submitted to the Action, causing the set
method for the field "working_perfectly" to be invoked (as it should
be), but the set method for the two fields in the logic:iterate tag is
not invoked.  And I don't know why.  And I can't seem to get them to
be invoked, either.

So . . . the magic isn't working.  Something must be needed to tell
the generated servlet not to treat these two properties (inside the
logic:iterate tag) as read-only.  What should it be?  How can I get
these properties to be updated in the form bean as the
"working_perfectly" property is?

Like I said -- I've been beating my head against this problem for
three days now.  There's just got to be a way!

--
struts-config.xml
--


http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>



   
  
   

   
  
   



--
problem.jsp:
--
<%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
<%@ taglib uri="/taglib/struts-html" prefix="html" %>

  
Problem page




  

  

  

  
  
  

  Problematic input
  

  

  

  
Functioning input

   

  


  
  

  


--
ProblemAction.java
--
package problem;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.Action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public final class ProblemAction extends Action {

   public ActionForward execute( ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response ) {

  String arg = request.getParameter( "arg" );

  if ("update".equals( arg )) {
 log.info( "update" );
  }

  if

RE: Read only iterate?

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Mike Elliott [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: Read only iterate?
> 
> 
> I've been totally defeated in my attempt to alter an html:text
> element inside a logic:iterate tag.  There must be a way to
> accomplish this, but I've been beating my head against the wall
> for three days now without making progress.
> 
> I have simplified the problem substantially from the initial page.
> What I have now looks like this:

from 
http://struts.apache.org/userGuide/struts-html.html#text
I'm guessing that a List won't work and you need to have an array.


> 
>-
>   [ Submit ]
>Problematic Input [0   ]
>Problematic Input [1   ]
>Functioning Input [A Value ]
>-
> 
> The lines containing "Problematic Input" were generated by a
> logic:iterate tag, which successfully fetched the list of objects from
> the form bean.  The last line, containing "Functioning Input", was
> generated outside of the logic:iterate tag.  Actual contents of the
> jsp page, bean, etc., are attached.
> 
> What happens at runtime is that when the JSP page is rendered, the
> text fields for all three rows are successfully and correctly fetched
> from the form bean, but only the last row can be changed.  As the log
> shows:
> 
> 
>   INFO  [org.apache.struts.util.PropertyMessageResources] 
> Initializing, 
> config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] initializing entries
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
>   INFO  [problem.ProblemAction] show
>   INFO  [org.apache.struts.util.PropertyMessageResources] 
> Initializing, 
> config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
>   INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
>   INFO  [problem.ProblemAction] update
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
> The page is initialized properly.  All three values are fetched from
> the form bean via the expected get methods.  The html form is properly
> populated and displays the expected values (0, 1, and "A Value").
> 
> The three fields are then changed (to 5, 5, and "mutated") and the
> submit button is selected at the point in the log file where I have
> inserted the  annotation.
> 
> This causes the form to be submitted to the Action, causing the set
> method for the field "working_perfectly" to be invoked (as it should
> be), but the set method for the two fields in the logic:iterate tag is
> not invoked.  And I don't know why.  And I can't seem to get them to
> be invoked, either.
> 
> So . . . the magic isn't working.  Something must be needed to tell
> the generated servlet not to treat these two properties (inside the
> logic:iterate tag) as read-only.  What should it be?  How can I get
> these properties to be updated in the form bean as the
> "working_perfectly" property is?
> 
> Like I said -- I've been beating my head against this problem for
> three days now.  There's just got to be a way!
> 
> --
> struts-config.xml
> --
> 
> 
>"-//Apache Software Foundation//DTD Struts 
> Configuration 1.0//EN"
>   
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
> 
> 
> 
>
> name="problemBean"
>  type="problem.ProblemBean"/>
>
> 
>
> path="/problemPage"
>  type="problem.ProblemAction"
>  name="problemBean"
>  validate="false"
>  input="/pages/problem.jsp"/>
>
> 
> 
> 
> --
> problem.jsp:
> --
> <%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
> <%@ taglib uri="/taglib/struts-html" prefix="html" %>
> 
>   
> Problem page
> 
> 
> 
> 
>method="post">
> cellpadding="0">
>   
> 
>   
> 
>   
>   
>property="items" >
> 
>   Problematic input
>   
>property="integer_value" indexed="true"/>
> 

Re: [OT] Need help with layered Map iteration in JSP

2004-08-13 Thread Curtis Taylor
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>


  <%-- ${entry.key} is the current key --%>
  <%-- ${entry.value} is the associated bean array --%>
  
  

  


See the API docs for the LoopTagStatus interface:  http://tinyurl.com/542tw

"Erik Weber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How can I refer to the index of the current iteration with c:forEach
> (analogous to the indexId attribute to logic:iterate)?
>
> Thanks,
> Erik
>
>
> Kris Schneider wrote:
>
> ><%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
> >
> >
> >  <%-- ${entry.key} is the current key --%>
> >  <%-- ${entry.value} is the associated bean array --%>
> >  
> >...
> >  
> >
> >
> >Quoting Erik Weber <[EMAIL PROTECTED]>:
> >
> >
> >
> >>I could use some Struts-EL/JSTL tag help, please.
> >>
> >>I have a Map with each entry having a String as the key and a bean array
> >>as the value.
> >>
> >>I need two iterations, one nested inside the other.
> >>
> >>For the outer iteration, I want to iterate the keySet of the Map. I
> >>don't know what the keys are going to be or how many there will be.
> >>
> >>Within that iteration, for each key in the keySet, I need to iterate
> >>over the buckets of the array that is the value for that key.
> >>
> >>To make this more clear, let's say I will produce a table of tables,
> >>somewhat like this:
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>
> >>  
> >>
> >>
> >>
> >>  
> >>
> >>  
> >>
> >>  
> >>
> >>
> >>
> >>
> >>Could someone show me some skeleton JSTL or Struts-el code?
> >>
> >>I would appreciate it very much,
> >>Erik
> >>
> >>
> >
> >
> >




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



Re: Read only iterate?

2004-08-13 Thread Richard Yee

Mike,
What does the generated HTML look like?

-Richard




__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

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



RE: Read only iterate?

2004-08-13 Thread Brian Lee
Lists work, but you have to write your own set(int index) method to set the 
correct object from the List.

BAL
From: "Jim Barrows" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: Read only iterate?
Date: Fri, 13 Aug 2004 09:40:27 -0700

> -Original Message-
> From: Mike Elliott [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 9:33 AM
> To: [EMAIL PROTECTED]
> Subject: Read only iterate?
>
>
> I've been totally defeated in my attempt to alter an html:text
> element inside a logic:iterate tag.  There must be a way to
> accomplish this, but I've been beating my head against the wall
> for three days now without making progress.
>
> I have simplified the problem substantially from the initial page.
> What I have now looks like this:
from
http://struts.apache.org/userGuide/struts-html.html#text
I'm guessing that a List won't work and you need to have an array.
>
>-
>   [ Submit ]
>Problematic Input [0   ]
>Problematic Input [1   ]
>Functioning Input [A Value ]
>-
>
> The lines containing "Problematic Input" were generated by a
> logic:iterate tag, which successfully fetched the list of objects from
> the form bean.  The last line, containing "Functioning Input", was
> generated outside of the logic:iterate tag.  Actual contents of the
> jsp page, bean, etc., are attached.
>
> What happens at runtime is that when the JSP page is rendered, the
> text fields for all three rows are successfully and correctly fetched
> from the form bean, but only the last row can be changed.  As the log
> shows:
>
> 
>   INFO  [org.apache.struts.util.PropertyMessageResources]
> Initializing,
> config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] initializing entries
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 0
>   INFO  [problem.ProblemBean$ProblemItem] setInteger_value to 1
>   INFO  [problem.ProblemAction] show
>   INFO  [org.apache.struts.util.PropertyMessageResources]
> Initializing,
> config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
> 
>   INFO  [problem.ProblemBean] setWorking_perfectly to 'mutated'
>   INFO  [problem.ProblemAction] update
>   INFO  [problem.ProblemBean] getEntries
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean$ProblemItem] getInteger_value
>   INFO  [problem.ProblemBean] getWorking_perfectly
>
> The page is initialized properly.  All three values are fetched from
> the form bean via the expected get methods.  The html form is properly
> populated and displays the expected values (0, 1, and "A Value").
>
> The three fields are then changed (to 5, 5, and "mutated") and the
> submit button is selected at the point in the log file where I have
> inserted the  annotation.
>
> This causes the form to be submitted to the Action, causing the set
> method for the field "working_perfectly" to be invoked (as it should
> be), but the set method for the two fields in the logic:iterate tag is
> not invoked.  And I don't know why.  And I can't seem to get them to
> be invoked, either.
>
> So . . . the magic isn't working.  Something must be needed to tell
> the generated servlet not to treat these two properties (inside the
> logic:iterate tag) as read-only.  What should it be?  How can I get
> these properties to be updated in the form bean as the
> "working_perfectly" property is?
>
> Like I said -- I've been beating my head against this problem for
> three days now.  There's just got to be a way!
>
> --
> struts-config.xml
> --
> 
>
>"-//Apache Software Foundation//DTD Struts
> Configuration 1.0//EN"
>
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>
>
> 
>
>
> name="problemBean"
>  type="problem.ProblemBean"/>
>
>
>
> path="/problemPage"
>  type="problem.ProblemAction"
>  name="problemBean"
>  validate="false"
>  input="/pages/problem.jsp"/>
>
>
> 
>
> --
> problem.jsp:
> --
> <%@ taglib uri="/taglib/struts-logic" prefix="logic" %>
> <%@ taglib uri="/taglib/struts-html" prefix="html" %>
> 
>   
> Problem page
> 
>
> 
> 
>method="post">
> cellpadding="0">
>   
> 

Spring's MVC? (was Re: Spring/Struts & Hibernate)

2004-08-13 Thread dhay

Talking of Spring, has anyone tried out their MVC framework (hopefully this
isn't considered sacrilege!!).

Any comparisons with Struts?

cheers,

David



|-+>
| |   "Marco Mistroni" |
| |   <[EMAIL PROTECTED]|
| |   stems.com>   |
| ||
| |   08/13/2004 09:31 |
| |   AM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>|
  |
|
  |   To:   "'Struts Users Mailing List'" <[EMAIL PROTECTED]>  
   |
  |   cc:  
|
  |   Subject:  Spring/Struts  & Hibernate 
|
  
>|




Hello mark,
 How r u? hope fine...
i saw some of ur posts in the past about Spring framework and
I wanted to ask u few questions..

are you using Spring? Together with Struts?

What do you think about it?


Thanx in advance and regards
 Marco



-
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] Friday: where's Atlanta Mark?

2004-08-13 Thread Vic Cekvenich
He is now harasing the Axis list.
.V
Michael McGrady wrote:
Whatever happened to Friday Mark the beer hustler from Atlanta?  This 
list seems much less active.  What does that mean?

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


Re: Bean-Map-Forms: what do I need Niall

2004-08-13 Thread Michael McGrady
This is getting to be like Abbott and Costello's "Who's On First?".  You 
mean the lastest nightly build of what?  Struts?  Commons-beanutils?

Thanks,
Michael
Niall Pemberton wrote:
Just the latest nightly build.
- Original Message - 
From: "Michael McGrady" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 13, 2004 6:12 AM
Subject: Re: Bean-Map-Forms: what do I need Niall

 

Niall Pemberton wrote:
   

I don't have anything that implements Map - but I developed a LazyDynaMap
and flavours of ActionForm which use it
 

Apparently you have forgotten our discussion a few days ago.  I have
implemented a BeanMapForm which you said the nightlies would allow me to
use, since they no longer read org.apache as org.getApache().  The
BeanMapForm is at
http://wiki.apache.org/struts/StrutsCatalogInstrumentableForms.  I was
asking what I needed to do that.
Thanks,
Michael
-
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] Friday: where's Atlanta Mark?

2004-08-13 Thread Michael McGrady
Vic Cekvenich wrote:
He is now harasing the Axis list.
.V 

Well, I thought he did need a little SOAP from time to time.  LOL
Michael
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] DAO ... where to draw the line?

2004-08-13 Thread Matthew J. Vincent

Matthew J. Vincent wrote:
Hi all,
Thanks for the info.  Here's another issue.
What if I have an employee search screen that wants to show only some 
of the information of an employee (not all).  What do you do then?
1. Instanatiate an Employee object and only fill in the relative 
information?  Keep in mind that this could be just employee name and 
location on the search results screen and then when the user chooses 
which employee to view I need to get all of the employee information.

2.  Instantiate an Employee object and fill out all the information 
even though you won't be needing most of it on the search results screen?

3.  Create 2 DTOs, one called Employee and one called EmployeeSearch 
DTO.  The EmployeeSearch DTO only stores what needs to be shown on the 
search results screen and the EmployeeDTO holds all the information 
for what needs to be shown on the detail screen?

4.  Something else...
Thanks!
Matt

Navjot Singh wrote:
hi matthew,
I wont say that you go with one or other of your approaches.
It depends upon type of assosciation that 2 entities may share. They 
may have aggregation or composition relationship. Depending on that 
your DAO implementation will decide that you need to get ONLY id or 
the composite objects.

Let me explain.
Say you have class named ORDER ad ORDER_DETAILS. (consists-of 
relationship) Order without order details is nothing. So you may get 
the OrderDetails object as well when you get Order.

Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) 
EMPLOYEE *may* still exists with or without department. So you may 
get only id of department and later fetch the department.

Think in employee table, you have relationship (reports-to). If you 
specify this relation as composition, you may go on fetching the 
objects all the way up to the organization chart ;-)

Do i make sense?
Navjot Singh
-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: 
Wednesday, August 11, 2004 8:21 AM
To: Struts Users Mailing List
Subject: [OT] DAO ... where to draw the line?

[OFF TOPIC]
I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line?
For example:

Let''s say I have three tables:
Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)
How deep do your classes go to replicate the data?
Do you do this...
public class Employee {
   private int id;
   private String name;
   private int deptId;   // just the id
   // .. implementation details
}
or do you do this
public class Employee {
   private int id;
   private String name;
   private Department dept;  // all of the data
   // .. implementation details
}
and so on and so on.   Class Department has the same type of 
problem.  Does it hold just the id for location or a variable class 
Location?

Should DAOs just fill in the id (keys) so it is up to the 
application using the DAOs to get the Employee class, then the 
Department class, and the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + 
loc.getLocationName());

or
Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  
It's possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!
Thanks!
Matt
-
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: Loosing request attributes

2004-08-13 Thread Leandro Melo
No i'm not Kataria. Is this the default option???
Actually, i checked it out in some bibliography and it
seems that redirect is not even a valid attribute for
action mappings :-| ??


 --- "Kataria, Satish" <[EMAIL PROTECTED]>
escreveu: 
> Ru using redirect="true" in ur action mapping. If so
> then changing it to false will solve the problem.
> 
> Thanx,
> Satish Kataria
> 
> -Original Message-
> From: Leandro Melo
> [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 13, 2004 7:39 AM
> To: struts jakarta
> Subject: Loosing request attributes
> 
> 
> Hi,
> when a user request hits the ActionForm's validate
> method and bounces back, i'm loosing some request
> attributes that i had set for the page. In other
> words, if the user inputs some data that don't pass
> the validate method,
> the page comes back with a few request scope
> attributes missing.
> 
> Is there a way to avoid that this happens?
> 
> =
> _
> Leandro Terra C. Melo
> Eng. de Controle e Automação - UFMG
> 
> 
>   
>   
>   
>
___
> Yahoo! Acesso Grátis - navegue de graça com conexão
> de qualidade! Acesse: http://br.acesso.yahoo.com/
> 
>
-
> 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]
> 
>  

=


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Loosing request attributes

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 10:50 AM
> To: Struts Users Mailing List
> Subject: RE: Loosing request attributes
> 
> 
> No i'm not Kataria. Is this the default option???
> Actually, i checked it out in some bibliography and it
> seems that redirect is not even a valid attribute for
> action mappings :-| ??

Missing, as in the when the screen gets re-rendered they're missing or the data is 
missing?
If the data is missing are you using primitives in your action form or Strings?  
If you're using primitives then of course your data is misssing.  See archives and 
documentation for why.


> 
> 
>  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> escreveu: 
> > Ru using redirect="true" in ur action mapping. If so
> > then changing it to false will solve the problem.
> > 
> > Thanx,
> > Satish Kataria
> > 
> > -Original Message-
> > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, August 13, 2004 7:39 AM
> > To: struts jakarta
> > Subject: Loosing request attributes
> > 
> > 
> > Hi,
> > when a user request hits the ActionForm's validate
> > method and bounces back, i'm loosing some request
> > attributes that i had set for the page. In other
> > words, if the user inputs some data that don't pass
> > the validate method,
> > the page comes back with a few request scope
> > attributes missing.
> > 
> > Is there a way to avoid that this happens?
> > 
> > =
> > _
> > Leandro Terra C. Melo
> > Eng. de Controle e Automação - UFMG
> > 
> > 
> > 
> > 
> > 
> >
> ___
> > Yahoo! Acesso Grátis - navegue de graça com conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > 
> >
> -
> > 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]
> > 
> >  
> 
> =
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> 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: Loosing request attributes

2004-08-13 Thread Leandro Melo
Sorry Kataria,
the redirect attribute is inside the forward tag. My
fault.
Any way, i'm not using and as i understand the default
is false.


 --- Leandro Melo <[EMAIL PROTECTED]>
escreveu: 
> No i'm not Kataria. Is this the default option???
> Actually, i checked it out in some bibliography and
> it
> seems that redirect is not even a valid attribute
> for
> action mappings :-| ??
> 
> 
>  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> escreveu: 
> > Ru using redirect="true" in ur action mapping. If
> so
> > then changing it to false will solve the problem.
> > 
> > Thanx,
> > Satish Kataria
> > 
> > -Original Message-
> > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, August 13, 2004 7:39 AM
> > To: struts jakarta
> > Subject: Loosing request attributes
> > 
> > 
> > Hi,
> > when a user request hits the ActionForm's validate
> > method and bounces back, i'm loosing some request
> > attributes that i had set for the page. In other
> > words, if the user inputs some data that don't
> pass
> > the validate method,
> > the page comes back with a few request scope
> > attributes missing.
> > 
> > Is there a way to avoid that this happens?
> > 
> > =
> > _
> > Leandro Terra C. Melo
> > Eng. de Controle e Automação - UFMG
> > 
> > 
> > 
> > 
> > 
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > de qualidade! Acesse: http://br.acesso.yahoo.com/
> > 
> >
>
-
> > 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]
> > 
> >  
> 
> =
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Loosing request attributes

2004-08-13 Thread Leandro Melo
As i replied many times for this topic, i'd like to
expose the situation again and in DETAILS.

Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:

request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
This page (myPageDoSomeOtherThing.jsp) uses the bean
"obj" that was set in MyActionDoSomething.java ok !?

Now suppose the user submits wrong information in
myPageDoSomeOtherThing.jsp, what will cause the
validate method in the associated ActionForm to return
some ActionErrors. BUT when the ActionForm send this
page back for the user to re-input data, the bean
"obj" that was set at the very beginning in
MyActionDoSomething.java is NOT present anymore!

I think now it's clear that i'm not talking about the
formBean attributes, right !? 




 --- Jim Barrows <[EMAIL PROTECTED]> escreveu: 
> 
> 
> > -Original Message-
> > From: Leandro Melo
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 10:50 AM
> > To: Struts Users Mailing List
> > Subject: RE: Loosing request attributes
> > 
> > 
> > No i'm not Kataria. Is this the default option???
> > Actually, i checked it out in some bibliography
> and it
> > seems that redirect is not even a valid attribute
> for
> > action mappings :-| ??
> 
> Missing, as in the when the screen gets re-rendered
> they're missing or the data is missing?
> If the data is missing are you using primitives
> in your action form or Strings?  If you're using
> primitives then of course your data is misssing. 
> See archives and documentation for why.
> 
> 
> > 
> > 
> >  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> > escreveu: 
> > > Ru using redirect="true" in ur action mapping.
> If so
> > > then changing it to false will solve the
> problem.
> > > 
> > > Thanx,
> > > Satish Kataria
> > > 
> > > -Original Message-
> > > From: Leandro Melo
> > > [mailto:[EMAIL PROTECTED] 
> > > Sent: Friday, August 13, 2004 7:39 AM
> > > To: struts jakarta
> > > Subject: Loosing request attributes
> > > 
> > > 
> > > Hi,
> > > when a user request hits the ActionForm's
> validate
> > > method and bounces back, i'm loosing some
> request
> > > attributes that i had set for the page. In other
> > > words, if the user inputs some data that don't
> pass
> > > the validate method,
> > > the page comes back with a few request scope
> > > attributes missing.
> > > 
> > > Is there a way to avoid that this happens?
> > > 
> > > =
> > > _
> > > Leandro Terra C. Melo
> > > Eng. de Controle e Automação - UFMG
> > > 
> > > 
> > >   
> > >   
> > >   
> > >
> >
>
___
> > > Yahoo! Acesso Grátis - navegue de graça com
> conexão
> > > de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > > 
> > >
> >
>
-
> > > 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]
> > > 
> > >  
> > 
> > =
> > 
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
-
> > 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]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Loosing request attributes

2004-08-13 Thread Hubert Rabago
This is because when the user submits the form, that already starts a
different request, so the request attributes are no longer there.
In your mapping for the action where the form gets submitted to, where does
the input attribute point to?

Hubert

--- Leandro Melo <[EMAIL PROTECTED]> wrote:

> As i replied many times for this topic, i'd like to
> expose the situation again and in DETAILS.
> 
> Suppose a user submits a request that is handled by
> MyActionDoSomething. Then this action sets a request
> attribute like this:
> 
> request.setAttribute("MyObject", obj); 
> 
> and forwards the request to the page
> myPageDoSomeOtherThing.jsp, wich has some inputs for
> the user to fill in.
> This page (myPageDoSomeOtherThing.jsp) uses the bean
> "obj" that was set in MyActionDoSomething.java ok !?
> 
> Now suppose the user submits wrong information in
> myPageDoSomeOtherThing.jsp, what will cause the
> validate method in the associated ActionForm to return
> some ActionErrors. BUT when the ActionForm send this
> page back for the user to re-input data, the bean
> "obj" that was set at the very beginning in
> MyActionDoSomething.java is NOT present anymore!
> 
> I think now it's clear that i'm not talking about the
> formBean attributes, right !? 
> 
> 
> 
> 
>  --- Jim Barrows <[EMAIL PROTECTED]> escreveu: 
> > 
> > 
> > > -Original Message-
> > > From: Leandro Melo
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, August 13, 2004 10:50 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: Loosing request attributes
> > > 
> > > 
> > > No i'm not Kataria. Is this the default option???
> > > Actually, i checked it out in some bibliography
> > and it
> > > seems that redirect is not even a valid attribute
> > for
> > > action mappings :-| ??
> > 
> > Missing, as in the when the screen gets re-rendered
> > they're missing or the data is missing?
> > If the data is missing are you using primitives
> > in your action form or Strings?  If you're using
> > primitives then of course your data is misssing. 
> > See archives and documentation for why.
> > 
> > 
> > > 
> > > 
> > >  --- "Kataria, Satish" <[EMAIL PROTECTED]>
> > > escreveu: 
> > > > Ru using redirect="true" in ur action mapping.
> > If so
> > > > then changing it to false will solve the
> > problem.
> > > > 
> > > > Thanx,
> > > > Satish Kataria
> > > > 
> > > > -Original Message-
> > > > From: Leandro Melo
> > > > [mailto:[EMAIL PROTECTED] 
> > > > Sent: Friday, August 13, 2004 7:39 AM
> > > > To: struts jakarta
> > > > Subject: Loosing request attributes
> > > > 
> > > > 
> > > > Hi,
> > > > when a user request hits the ActionForm's
> > validate
> > > > method and bounces back, i'm loosing some
> > request
> > > > attributes that i had set for the page. In other
> > > > words, if the user inputs some data that don't
> > pass
> > > > the validate method,
> > > > the page comes back with a few request scope
> > > > attributes missing.
> > > > 
> > > > Is there a way to avoid that this happens?
> > > > 
> > > > =
> > > > _
> > > > Leandro Terra C. Melo
> > > > Eng. de Controle e Automação - UFMG
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > >
> >
> ___
> > > > Yahoo! Acesso Grátis - navegue de graça com
> > conexão
> > > > de qualidade! Acesse:
> > http://br.acesso.yahoo.com/
> > > > 
> > > >
> > >
> >
> -
> > > > 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]
> > > > 
> > > >  
> > > 
> > > =
> > > 
> > > 
> > > __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > > http://mail.yahoo.com 
> > > 
> > >
> >
> -
> > > 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]
> > 
> >  
> 
> =
> 
> 
> 
>   
>   
>   
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




__
Do you 

RE: Losing request attributes

2004-08-13 Thread Hubert Rabago
You can point the "input" to an action which will populate the request with
the attribute(s) you need, and then forwards to your form.

--- Hubert Rabago <[EMAIL PROTECTED]> wrote:

> This is because when the user submits the form, that already starts a
> different request, so the request attributes are no longer there.
> In your mapping for the action where the form gets submitted to, where does
> the input attribute point to?
> 
> Hubert
> 
> --- Leandro Melo <[EMAIL PROTECTED]> wrote:
> 
> > As i replied many times for this topic, i'd like to
> > expose the situation again and in DETAILS.
> > 
> > Suppose a user submits a request that is handled by
> > MyActionDoSomething. Then this action sets a request
> > attribute like this:
> > 
> > request.setAttribute("MyObject", obj); 
> > 
> > and forwards the request to the page
> > myPageDoSomeOtherThing.jsp, wich has some inputs for
> > the user to fill in.
> > This page (myPageDoSomeOtherThing.jsp) uses the bean
> > "obj" that was set in MyActionDoSomething.java ok !?
> > 
> > Now suppose the user submits wrong information in
> > myPageDoSomeOtherThing.jsp, what will cause the
> > validate method in the associated ActionForm to return
> > some ActionErrors. BUT when the ActionForm send this
> > page back for the user to re-input data, the bean
> > "obj" that was set at the very beginning in
> > MyActionDoSomething.java is NOT present anymore!
> > 
> > I think now it's clear that i'm not talking about the
> > formBean attributes, right !? 
> > 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Christina Siena
Hi,

I am developing a page containing dynamically generated input
type="text" controls where their names consist of multiple composite
keys. The name of the input type="text" controls, however, can not be
referenced correctly using javascript. For example, I have the
following html input tag:



The following javascript won't work because the control name contains =
and ; and : as follows:

document.formname.number=1480;countryCode=USA;templateNumber=7;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
= "";

I only have one other idea how to solve this problem. Instead of control
names containing the multiple composite keys, instead use a simple valid
name. In the action, map the valid name to the multiple composite keys.
Does
anyone have any other ideas how to solve this?

Thanks in advance.




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



RE: Losing request attributes

2004-08-13 Thread Leandro Melo
Hubert, 
i think that's actually the only solution.
Thanks.

 
> You can point the "input" to an action which will
> populate the request with
> the attribute(s) you need, and then forwards to your
> form.
> 
> --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> 
> > This is because when the user submits the form,
> that already starts a
> > different request, so the request attributes are
> no longer there.
> > In your mapping for the action where the form gets
> submitted to, where does
> > the input attribute point to?
> > 
> > Hubert
> > 
> > --- Leandro Melo <[EMAIL PROTECTED]>
> wrote:
> > 
> > > As i replied many times for this topic, i'd like
> to
> > > expose the situation again and in DETAILS.
> > > 
> > > Suppose a user submits a request that is handled
> by
> > > MyActionDoSomething. Then this action sets a
> request
> > > attribute like this:
> > > 
> > > request.setAttribute("MyObject", obj); 
> > > 
> > > and forwards the request to the page
> > > myPageDoSomeOtherThing.jsp, wich has some inputs
> for
> > > the user to fill in.
> > > This page (myPageDoSomeOtherThing.jsp) uses the
> bean
> > > "obj" that was set in MyActionDoSomething.java
> ok !?
> > > 
> > > Now suppose the user submits wrong information
> in
> > > myPageDoSomeOtherThing.jsp, what will cause the
> > > validate method in the associated ActionForm to
> return
> > > some ActionErrors. BUT when the ActionForm send
> this
> > > page back for the user to re-input data, the
> bean
> > > "obj" that was set at the very beginning in
> > > MyActionDoSomething.java is NOT present anymore!
> > > 
> > > I think now it's clear that i'm not talking
> about the
> > > formBean attributes, right !? 
> > > 
> 
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Losing request attributes

2004-08-13 Thread Denis Avdic
In order to keep the actual entries that the user typed in (so they
don't have to retype everything if they changed a bunch of things) I
usually put the entire form and errors into request if there are
errors.

Then you need to make sure that your  populate action checks for
presence of the form in request and overrides the DB entries with the
ones in the form.

On Fri, 13 Aug 2004 15:23:47 -0300 (ART), Leandro Melo
<[EMAIL PROTECTED]> wrote:
> Hubert,
> i think that's actually the only solution.
> Thanks.
> 
> 
> 
> 
> > You can point the "input" to an action which will
> > populate the request with
> > the attribute(s) you need, and then forwards to your
> > form.
> >
> > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> >
> > > This is because when the user submits the form,
> > that already starts a
> > > different request, so the request attributes are
> > no longer there.
> > > In your mapping for the action where the form gets
> > submitted to, where does
> > > the input attribute point to?
> > >
> > > Hubert
> > >
> > > --- Leandro Melo <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > > As i replied many times for this topic, i'd like
> > to
> > > > expose the situation again and in DETAILS.
> > > >
> > > > Suppose a user submits a request that is handled
> > by
> > > > MyActionDoSomething. Then this action sets a
> > request
> > > > attribute like this:
> > > >
> > > > request.setAttribute("MyObject", obj);
> > > >
> > > > and forwards the request to the page
> > > > myPageDoSomeOtherThing.jsp, wich has some inputs
> > for
> > > > the user to fill in.
> > > > This page (myPageDoSomeOtherThing.jsp) uses the
> > bean
> > > > "obj" that was set in MyActionDoSomething.java
> > ok !?
> > > >
> > > > Now suppose the user submits wrong information
> > in
> > > > myPageDoSomeOtherThing.jsp, what will cause the
> > > > validate method in the associated ActionForm to
> > return
> > > > some ActionErrors. BUT when the ActionForm send
> > this
> > > > page back for the user to re-input data, the
> > bean
> > > > "obj" that was set at the very beginning in
> > > > MyActionDoSomething.java is NOT present anymore!
> > > >
> > > > I think now it's clear that i'm not talking
> > about the
> > > > formBean attributes, right !?
> > > >
> >
> >
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
> 
> =
> 
> 
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
> http://br.acesso.yahoo.com/
> 
> 
> 
> -
> 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: Losing request attributes

2004-08-13 Thread Leandro Melo
Denis, that's not the point of our discussion. One
more time: I'm not talking about formBean attributes.

Anyway, Hubert pointed a workaroung for my problem.

Thanks.


 --- Denis Avdic <[EMAIL PROTECTED]> escreveu: 
> In order to keep the actual entries that the user
> typed in (so they
> don't have to retype everything if they changed a
> bunch of things) I
> usually put the entire form and errors into request
> if there are
> errors.
> 
> Then you need to make sure that your  populate
> action checks for
> presence of the form in request and overrides the DB
> entries with the
> ones in the form.
> 
> On Fri, 13 Aug 2004 15:23:47 -0300 (ART), Leandro
> Melo
> <[EMAIL PROTECTED]> wrote:
> > Hubert,
> > i think that's actually the only solution.
> > Thanks.
> > 
> > 
> > 
> > 
> > > You can point the "input" to an action which
> will
> > > populate the request with
> > > the attribute(s) you need, and then forwards to
> your
> > > form.
> > >
> > > --- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > >
> > > > This is because when the user submits the
> form,
> > > that already starts a
> > > > different request, so the request attributes
> are
> > > no longer there.
> > > > In your mapping for the action where the form
> gets
> > > submitted to, where does
> > > > the input attribute point to?
> > > >
> > > > Hubert
> > > >
> > > > --- Leandro Melo <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > > As i replied many times for this topic, i'd
> like
> > > to
> > > > > expose the situation again and in DETAILS.
> > > > >
> > > > > Suppose a user submits a request that is
> handled
> > > by
> > > > > MyActionDoSomething. Then this action sets a
> > > request
> > > > > attribute like this:
> > > > >
> > > > > request.setAttribute("MyObject", obj);
> > > > >
> > > > > and forwards the request to the page
> > > > > myPageDoSomeOtherThing.jsp, wich has some
> inputs
> > > for
> > > > > the user to fill in.
> > > > > This page (myPageDoSomeOtherThing.jsp) uses
> the
> > > bean
> > > > > "obj" that was set in
> MyActionDoSomething.java
> > > ok !?
> > > > >
> > > > > Now suppose the user submits wrong
> information
> > > in
> > > > > myPageDoSomeOtherThing.jsp, what will cause
> the
> > > > > validate method in the associated ActionForm
> to
> > > return
> > > > > some ActionErrors. BUT when the ActionForm
> send
> > > this
> > > > > page back for the user to re-input data, the
> > > bean
> > > > > "obj" that was set at the very beginning in
> > > > > MyActionDoSomething.java is NOT present
> anymore!
> > > > >
> > > > > I think now it's clear that i'm not talking
> > > about the
> > > > > formBean attributes, right !?
> > > > >
> > >
> > >
> > >
> __
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
>
-
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> > >
> > 
> > =
> > 
> > 
> >
>
___
> > Yahoo! Acesso Grátis - navegue de graça com
> conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> > 
> > 
> > 
> >
>
-
> > 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]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Displaying bean values within tiles

2004-08-13 Thread Andy Engle
Hi all,

I hate to ask a real, boring, non-OT question on a Friday, but I am
working with a Struts application in which I am using tiles to organize
my views.  What I want to be able to do is pass in a bean with a String
(or, "string beans" for all you farmer types out there) into my tiles
setup and have that value displayed in my view.

I have my tiles definitions in tiles-defs.xml, and of course I have a
file template.jsp which handles my layout.

I have horsed around with using the  tag with the
String value, but I can't seem to get that to work -- for the page I
want to display it on, it either displays the default value for the
page as I have it set in tiles-defs.xml, or it doesn't print anything
at all.  I suppose my question could/should be how and where would I
use this useAttribute tag, as it seems to be the solution to my
problem.

Thanks for your help, and I look forward to receiving your responses.


Best Regards,
Andy


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



Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
Erik,
i'm not talking about form attributes, that's what i
said in my last e-mail.
I'll try to clear it out.
Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:

request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
This page (myPageDoSomeOtherThing.jsp) uses the bean
"obj" that was set in MyActionDoSomething.java ok !?

Now suppose the user submits wrong information in
myPageDoSomeOtherThing.jsp, what will cause the
validate method in the associated ActionForm to return
some ActionErrors. BUT when the ActionForm send this
page back for the user to re-input data, the bean
"obj" that was set at the very beginning in
MyActionDoSomething.java is NOT present anymore!

I think now it's clear that i'm not talking about the
formBean attributes, right !? 








 --- Erik Weber <[EMAIL PROTECTED]> escreveu: 
> You shouldn't have to do anything (in general, you
> rarely need to 
> implement reset) special for this. Struts does this
> for you. The user 
> submits the form. The form bean is populated with
> the user's input. 
> Validation starts on the form bean. Validation
> fails. Struts forwards 
> back to the input page, and the struts tags render
> all the values that 
> the user had input using the populated form bean.
> 
> Could you describe in more detail which types of
> form values seem to be 
> "missing" and which ones are intact? Is there a
> pattern to it?
> 
> Erik
> 
> 
> 
> Leandro Melo wrote:
> 
> >I don`t want to reset the attributes of my
> ActionForm
> >(what a form.reset() would do), BUT the attributes
> of
> >the request the were probably set by the Action
> that
> >forwarded to the specific page.
> >
> >So i need them back in that page if validate fails.
> >
> >
> > --- Robert Taylor <[EMAIL PROTECTED]> escreveu:
> 
> >  
> >
> >>form.reset();
> >>
> >>robert
> >>
> >>
> >>
> >>>-Original Message-
> >>>From: Leandro Melo
> >>>  
> >>>
> >>[mailto:[EMAIL PROTECTED]
> >>
> >>
> >>>Sent: Friday, August 13, 2004 11:20 AM
> >>>To: Struts Users Mailing List
> >>>Subject: Re: Loosing request attributes
> >>>
> >>>
> >>>I was taking a look at the HttpServeltRequest and
> >>>ServletRequest apis and noted that theres a
> method
> >>>"getParameterMap()" wich returns a map of the
> >>>parameters, BUT there isn`t such a
> >>>  
> >>>
> >>"setParameterMap()"
> >>
> >>
> >>>method.
> >>>
> >>>So, what`s an automated way to re-set all my
> >>>  
> >>>
> >>request
> >>
> >>
> >>>parameters in the ActionForm??? Do i have to go
> >>>  
> >>>
> >>one by
> >>
> >>
> >>>one for each ActionForm :-( ???
> >>>
> >>>
> >>> --- "Ruth, Brice" <[EMAIL PROTECTED]> escreveu:
> >>>  
> >>>
> Ensure that the request attributes are set in
> 
> 
> >>the
> >>
> >>
> ActionForm, this is
> the only way that you can ensure that they'll
> 
> 
> >>still
> >>
> >>
> be there when the
> validate fails.
> 
> Leandro Melo wrote:
> 
> 
> 
> >Hi,
> >when a user request hits the ActionForm's
> >  
> >
> >>validate
> >>
> >>
> >method and bounces back, i'm loosing some
> >  
> >
> >>request
> >>
> >>
> >attributes that i had set for the page. In
> >  
> >
> >>other
> >>
> >>
> >words, if the user inputs some data that don't
> >  
> >
> >>pass
> >>
> >>
> >the validate method,
> >the page comes back with a few request scope
> >attributes missing.
> >
> >Is there a way to avoid that this happens?
> >
> >=
> >_
> >Leandro Terra C. Melo
> >Eng. de Controle e Automação - UFMG
> >
> >
> >
> >
> >
> >  
> >
>
>>___
> >>
> >>
> >Yahoo! Acesso Grátis - navegue de graça com
> >  
> >
> >>conexão
> >>
> >>
> de qualidade! Acesse:
> 
> 
> >>http://br.acesso.yahoo.com/
> >>
> >>
>
>>-
> >>
> >>
> >To unsubscribe, e-mail:
> >  
> >
> [EMAIL PROTECTED]
> 
> 
> >For additional commands, e-mail:
> >  
> >
> [EMAIL PROTECTED]
> 
> 
> >
> >  
> >
> --
> Brice Ruth, Sr. IT Analyst
> Fiskars Brands Inc
> http://www.fiskarsbrands.com/
> 
> 
> 
> 
> 
>
>-
> >  
> >
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
=== message truncated === 

=





 

Who calls the validate method ???

2004-08-13 Thread Leandro Melo
Hi,
could anyone tell me who calls the validate method of
the ActionForms?

I thought it was ActionServlet, but it seems not be
it.

ltcmelo

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Who calls the validate method ???

2004-08-13 Thread Hubert Rabago
It's actually the RequestProcessor.
There's a processValidate() there where the form's validate() method is
called.

--- Leandro Melo <[EMAIL PROTECTED]> wrote:

> Hi,
> could anyone tell me who calls the validate method of
> the ActionForms?
> 
> I thought it was ActionServlet, but it seems not be
> it.
> 
> ltcmelo
> 
> =
> 
> 
> 
>   
>   
>   
> ___
> Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse:
> http://br.acesso.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Christina Siena [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 11:23 AM
> To: [EMAIL PROTECTED]
> Subject: Javascript question re: dynamically generated input 
> type='text'
> controls
> 
> 
> Hi,
> 
> I am developing a page containing dynamically generated input
> type="text" controls where their names consist of multiple composite
> keys. The name of the input type="text" controls, however, can not be
> referenced correctly using javascript. For example, I have the
> following html input tag:
> 
>  name="value(number=1480;countryCode=USA;templateNumber=7;t
ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
> value="" disabled="true" class="disabledText"
> onchange="benefitsChanged();" />
> 
> The following javascript won't work because the control name 
> contains =
> and ; and : as follows:
> 
> document.formname.number=1480;countryCode=USA;templateNumber=7
;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
> = "";
> 
> I only have one other idea how to solve this problem. Instead 
> of control
> names containing the multiple composite keys, instead use a 
> simple valid
> name. In the action, map the valid name to the multiple 
> composite keys.
> Does
> anyone have any other ideas how to solve this?

Um hidden fields in the form?


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



RE: Displaying bean values within tiles

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Andy Engle [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 12:05 PM
> To: [EMAIL PROTECTED]
> Subject: Displaying bean values within tiles
> 
> 
> Hi all,
> 
> I hate to ask a real, boring, non-OT question on a Friday, but I am
> working with a Struts application in which I am using tiles 
> to organize
> my views.  What I want to be able to do is pass in a bean 
> with a String
> (or, "string beans" for all you farmer types out there) into my tiles
> setup and have that value displayed in my view.
> 
> I have my tiles definitions in tiles-defs.xml, and of course I have a
> file template.jsp which handles my layout.
> 
> I have horsed around with using the  tag with the
> String value, but I can't seem to get that to work -- for the page I
> want to display it on, it either displays the default value for the
> page as I have it set in tiles-defs.xml, or it doesn't print anything
> at all.  I suppose my question could/should be how and where would I
> use this useAttribute tag, as it seems to be the solution to my
> problem.

useAttribute:
 Declare a Java variable, and an attribute in the specified scope, using tile 
attribute value.
Java variable and attribute will have the name specified by 'id', or the original name 
if not specified. 

So I believe for tiles def:








In the jsp page:


Will allow



And yes, for this example I could have used .  :)

Not sure what you mean by pass in a bean to your tiles setup though.


> 
> Thanks for your help, and I look forward to receiving your responses.
> 
> 
> Best Regards,
> 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: Loosing request attributes

2004-08-13 Thread Rick Reumann
Leandro Melo wrote:
Suppose a user submits a request that is handled by
MyActionDoSomething. Then this action sets a request
attribute like this:
request.setAttribute("MyObject", obj); 

and forwards the request to the page
myPageDoSomeOtherThing.jsp, wich has some inputs for
the user to fill in.
The problem you are describing comes up a lot on this list - when 
validation fails and you are back on the initial form you will not have 
access to the previous set request attributes. It is for this reason 
that I now rarely ever set my mapping validate to "true" and instead 
call validate() from my Action after the form submits. The reason for 
this is when validation fails (ActionErrors/Messages return) I can then 
call a private setUp() method in my Action that is used to set up my 
form with any other request attributes that should always be there.

For example, a common complaint is: "I have a List that I set up in 
request scope that is used on the form for the user to select an item, 
but when validation fails this List will not be there." To get around 
this problem, simply call validate() manually in your action and if 
errors return you can then call a setUp() method that will repopulate 
what you need to be in the request, otherwise you just proceed on as 
normal.

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


Re: Loosing request attributes

2004-08-13 Thread Leandro Melo
Vary nice Rick!
Interesting solution, i'll work on that!


 --- Rick Reumann <[EMAIL PROTECTED]> escreveu: 
> Leandro Melo wrote:
> 
> > Suppose a user submits a request that is handled
> by
> > MyActionDoSomething. Then this action sets a
> request
> > attribute like this:
> > 
> > request.setAttribute("MyObject", obj); 
> > 
> > and forwards the request to the page
> > myPageDoSomeOtherThing.jsp, wich has some inputs
> for
> > the user to fill in.
> 
> The problem you are describing comes up a lot on
> this list - when 
> validation fails and you are back on the initial
> form you will not have 
> access to the previous set request attributes. It is
> for this reason 
> that I now rarely ever set my mapping validate to
> "true" and instead 
> call validate() from my Action after the form
> submits. The reason for 
> this is when validation fails (ActionErrors/Messages
> return) I can then 
> call a private setUp() method in my Action that is
> used to set up my 
> form with any other request attributes that should
> always be there.
> 
> For example, a common complaint is: "I have a List
> that I set up in 
> request scope that is used on the form for the user
> to select an item, 
> but when validation fails this List will not be
> there." To get around 
> this problem, simply call validate() manually in
> your action and if 
> errors return you can then call a setUp() method
> that will repopulate 
> what you need to be in the request, otherwise you
> just proceed on as 
> normal.
> 
> -- 
> Rick
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re: Who calls the validate method ???

2004-08-13 Thread Rick Reumann
Leandro Melo wrote:
Hi,
could anyone tell me who calls the validate method of
the ActionForms?
I think "you" should:) I find it's often more beneficial to not rely on 
Struts calling this validate() method and instead you should call this 
manually.

From my other post:
 - when validation fails and you are back on the initial form you 
will not have access to the previous set request attributes. It is for 
this reason that I now rarely ever set my mapping validate to "true" and 
instead call validate() from my Action after the form submits. The 
reason for this is when validation fails (ActionErrors/Messages return) 
I can then call a private setUp() method in my Action that is used to 
set up my form with any other request attributes that should always be 
there.

For example, a common complaint is: "I have a List that I set up in 
request scope that is used on the form for the user to select an item, 
but when validation fails this List will not be there." To get around 
this problem, simply call validate() manually in your action and if 
errors return you can then call a setUp() method that will repopulate 
what you need to be in the request, otherwise you just proceed on as normal.


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


RE: Loosing request attributes

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:06 PM
> To: Struts Users Mailing List
> Subject: Re: Loosing request attributes
> The problem you are describing comes up a lot on this list - when 
> validation fails and you are back on the initial form you 
> will not have 
> access to the previous set request attributes. It is for this reason 
> that I now rarely ever set my mapping validate to "true" and instead 
> call validate() from my Action after the form submits. The reason for 
> this is when validation fails (ActionErrors/Messages return) 
> I can then 
> call a private setUp() method in my Action that is used to set up my 
> form with any other request attributes that should always be there.

I'm curious why using the input parameter doesn't work for you?



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



RE: Who calls the validate method ???

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:09 PM
> To: Struts Users Mailing List
> Subject: Re: Who calls the validate method ???
> 
> 
> Leandro Melo wrote:
> 
> > Hi,
> > could anyone tell me who calls the validate method of
> > the ActionForms?
> 
> I think "you" should:) I find it's often more beneficial to 
> not rely on 
> Struts calling this validate() method and instead you should 
> call this 
> manually.
> 
>  From my other post:
> 
>  - when validation fails and you are back on the 
> initial form you 
> will not have access to the previous set request attributes. 
> It is for 
> this reason that I now rarely ever set my mapping validate to 
> "true" and 
> instead call validate() from my Action after the form submits. The 
> reason for this is when validation fails 
> (ActionErrors/Messages return) 
> I can then call a private setUp() method in my Action that is used to 
> set up my form with any other request attributes that should 
> always be 
> there.
> 
> For example, a common complaint is: "I have a List that I set up in 
> request scope that is used on the form for the user to select 
> an item, 
> but when validation fails this List will not be there." To get around 
> this problem, simply call validate() manually in your action and if 
> errors return you can then call a setUp() method that will repopulate 
> what you need to be in the request, otherwise you just 
> proceed on as normal.

See, I disagree with this entirely.  Pick lists can be put into application scope, if 
they are small enough.  Use the Fast Lane Reader pattern if they aren't.  If you need 
to customize the list based on whatever, then you can that through the list bean ( I 
wouldn't recommend just putting a list in application scope, rather a bean containing 
a list to support this kind of setup) and then set the input parameter.  If they 
aren't application in scope, then put them into the session.
I know that some people don't like putting things into session/application scopes 
because of memory.. however memory is not only cheaper then developer time, it's 
expensable too!



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



Re: Loosing request attributes

2004-08-13 Thread Craig McClanahan
On Fri, 13 Aug 2004 12:51:44 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Rick Reumann [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 13, 2004 1:06 PM
> > To: Struts Users Mailing List
> > Subject: Re: Loosing request attributes
> > The problem you are describing comes up a lot on this list - when
> > validation fails and you are back on the initial form you
> > will not have
> > access to the previous set request attributes. It is for this reason
> > that I now rarely ever set my mapping validate to "true" and instead
> > call validate() from my Action after the form submits. The reason for
> > this is when validation fails (ActionErrors/Messages return)
> > I can then
> > call a private setUp() method in my Action that is used to set up my
> > form with any other request attributes that should always be there.
> 
> I'm curious why using the input parameter doesn't work for you?
> 

Indeed ... the feature is working as it was designed, based on
application user expectations that, if errors occur, whatever they
typed in is redisplayed (even if it is wrong) so that it can be
corrected.  That's the way that any rich GUI client works, and nobody
wants to use apps that force you to fill an entire form in again
simply because you made one mistake.

Craig

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



include vs. forward attributes in struts-config action element

2004-08-13 Thread Michael Finger
Hi all, 

I'm a bit puzzled about the processing of includes and forward
attributes in the struts-config action element vs. the forward element
under the action element

 

I understand why the forward element is there (and I use it quite a lot
, too) but I got a bit confused when I was looking around in the
RequestProcessor.process method:

 

public void process(HttpServletRequest request,

HttpServletResponse response)

throws IOException, ServletException {

 

...

 

// Process a forward or include specified by this mapping

if (!processForward(request, response, mapping)) {

return;

}

if (!processInclude(request, response, mapping)) {

return;

}

 





// Process the returned ActionForward instance

processForwardConfig(request, response, forward);

 

}

 

It looks to me like including a forward attribute  in the action element
will break any forwards you want with a forward element as it calls
RequestDispatcher.forward - which forwards on the output stream, etc...

This question came up when I was digging up info on  RequestDispatcher
forward vs. include and found refrences to these attributes, but no real
examples.   Does struts still support the forward and include attributes
as a legacy or a servlet api spec thing? Or what? 

 

 

Thanks

 

Michael Finger

 

 



RE: include vs. forward attributes in struts-config action element

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Michael Finger [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 12:57 PM
> To: Struts Users Mailing List
> Subject: include vs. forward attributes in struts-config 
> action element
> 

code and problem explanation

> 
> 
> It looks to me like including a forward attribute  in the 
> action element
> will break any forwards you want with a forward element as it calls
> RequestDispatcher.forward - which forwards on the output 
> stream, etc...
> 
> This question came up when I was digging up info on  RequestDispatcher
> forward vs. include and found refrences to these attributes, 
> but no real
> examples.   Does struts still support the forward and include 
> attributes
> as a legacy or a servlet api spec thing? Or what? 

I'm confused.  what's your confusion about? :)


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



Re: Who calls the validate method ???

2004-08-13 Thread Leandro Melo
Rick,
as i said i really like your approach, but there are
some input pages that are really really simple, so
there's no need for doing this.
Then, in this cases, i'd like to call some other
method just after validate is called from Struts.
That's why i was wondering "who" calls it.


 --- Rick Reumann <[EMAIL PROTECTED]> escreveu: 
> Leandro Melo wrote:
> 
> > Hi,
> > could anyone tell me who calls the validate method
> of
> > the ActionForms?
> 
> I think "you" should:) I find it's often more
> beneficial to not rely on 
> Struts calling this validate() method and instead
> you should call this 
> manually.
> 
>  From my other post:
> 
>  - when validation fails and you are back on
> the initial form you 
> will not have access to the previous set request
> attributes. It is for 
> this reason that I now rarely ever set my mapping
> validate to "true" and 
> instead call validate() from my Action after the
> form submits. The 
> reason for this is when validation fails
> (ActionErrors/Messages return) 
> I can then call a private setUp() method in my
> Action that is used to 
> set up my form with any other request attributes
> that should always be 
> there.
> 
> For example, a common complaint is: "I have a List
> that I set up in 
> request scope that is used on the form for the user
> to select an item, 
> but when validation fails this List will not be
> there." To get around 
> this problem, simply call validate() manually in
> your action and if 
> errors return you can then call a setUp() method
> that will repopulate 
> what you need to be in the request, otherwise you
> just proceed on as normal.
> 
> 
> 
> -- 
> Rick
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

=






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



RE: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Christina Siena
If I try to use hidden fields to associate the valid name with the
multiple composite key name, then what is it about hidden fields that I
can use?
>
>
>> -Original Message-
>> From: Christina Siena [mailto:[EMAIL PROTECTED]
>> Sent: Friday, August 13, 2004 11:23 AM
>> To: [EMAIL PROTECTED]
>> Subject: Javascript question re: dynamically generated input
>> type='text'
>> controls
>>
>>
>> Hi,
>>
>> I am developing a page containing dynamically generated input
>> type="text" controls where their names consist of multiple composite
>> keys. The name of the input type="text" controls, however, can not be
>> referenced correctly using javascript. For example, I have the
>> following html input tag:
>>
>> > name="value(number=1480;countryCode=USA;templateNumber=7;t
> ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
>> value="" disabled="true" class="disabledText"
>> onchange="benefitsChanged();" />
>>
>> The following javascript won't work because the control name
>> contains > and ; and : as follows:
>>
>> document.formname.number=1480;countryCode=USA;templateNumber=7
> ;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
>> = "";
>>
>> I only have one other idea how to solve this problem. Instead
>> of control
>> names containing the multiple composite keys, instead use a
>> simple valid
>> name. In the action, map the valid name to the multiple
>> composite keys.
>> Does
>> anyone have any other ideas how to solve this?
>
> Um hidden fields in the form?
>
>
> - 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: Javascript question re: dynamically generated input type='text' controls

2004-08-13 Thread Jim Barrows


> -Original Message-
> From: Christina Siena [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 1:10 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Javascript question re: dynamically generated input
> type='text' controls
> 
> 
> If I try to use hidden fields to associate the valid name with the
> multiple composite key name, then what is it about hidden 
> fields that I
> can use?

by way of example:






Then put the key together in your action class.  HTML is not designed to do what you 
want to do.





> >
> >
> >> -Original Message-
> >> From: Christina Siena [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, August 13, 2004 11:23 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: Javascript question re: dynamically generated input
> >> type='text'
> >> controls
> >>
> >>
> >> Hi,
> >>
> >> I am developing a page containing dynamically generated input
> >> type="text" controls where their names consist of multiple 
> composite
> >> keys. The name of the input type="text" controls, however, 
> can not be
> >> referenced correctly using javascript. For example, I have the
> >> following html input tag:
> >>
> >>  >> name="value(number=1480;countryCode=USA;templateNumber=7;t
> > ypeCode=STAGE;languageCode=EN;idTypeCode=MODE:)"
> >> value="" disabled="true" class="disabledText"
> >> onchange="benefitsChanged();" />
> >>
> >> The following javascript won't work because the control name
> >> contains > and ; and : as follows:
> >>
> >> document.formname.number=1480;countryCode=USA;templateNumber=7
> > ;typeCode=STAGE;languageCode=EN;idTypeCode=MODE:.value
> >> = "";
> >>
> >> I only have one other idea how to solve this problem. Instead
> >> of control
> >> names containing the multiple composite keys, instead use a
> >> simple valid
> >> name. In the action, map the valid name to the multiple
> >> composite keys.
> >> Does
> >> anyone have any other ideas how to solve this?
> >
> > Um hidden fields in the form?
> >
> >
> > 
> --
> --- 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]



  1   2   >