user@struts.apache.org

2006-06-03 Thread M.Liang Liu

I just want to  carry parameters to action :login.do
I will make use of  the url   .../login.do?action=add&id=123 in the other
page as a link.
And I want  to get those parameters using: request.getAttribute("action");

request.getAttribute("id");
to get them.

However,it does NOT work.

I would like to know can I use a url like  .../login.do?action=add&id=123

If not,how can I carry two parameters to an action?

Thank you.

--
Why Signature?


Re: Controlling Reset method

2006-06-03 Thread Scott Van Wart

chamal desilva wrote:

For examle let's think there are four Accounts in
accounts vector. The first action displays this list
on a JSP. User clicks on first account and views
details. Then user goes back and clicks on second
account. Then the data of first account object is
reset and gets lost. This is my problem/
If you're viewing the second account, why would you need data for the 
first account?  If it's a problem of losing the customer ID for the 
account, just make sure you populate the customer ID in the action that 
handles the "back" action associated with viewing the account.


- Scott

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



Re: [Struts + Tiles] JSTL problem on WebSphere Application Server 6

2006-06-03 Thread Rafael
actually WAS6 comes with JSTL libraries, so the jars with TLDs are located 
inside WAS6 lib directory.
If I include the taglib directive (<%@ taglib 
uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>) all jstl tags in the 
jsp page works perfectly, but If I include this same directive into a new 
jsp page and use <%@ include tag to include this new jsp page into the jsp 
page that I want to use jstl tags, all jstl pages stopped to work.




-Rafael T Icibaci


- Original Message - 
From: "Martin Gainty" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Saturday, June 03, 2006 10:15 AM
Subject: Re: [Struts + Tiles] JSTL problem on WebSphere Application Server 6



also.. are the tld files located in WEB-INF?
HTH,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Samere, Adam J" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Friday, June 02, 2006 11:36 AM
Subject: RE: [Struts + Tiles] JSTL problem on WebSphere Application Server 
6



I doubt that the include is not working. What version of JSTL are you
using? Do you have taglib entries in web.xml?

Can you explain "JSTL stopped working" a little more extensively?

-Original Message-
From: Rafael [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 11:01 AM
To: Struts Users Mailing List
Subject: [Struts + Tiles] JSTL problem on WebSphere Application Server 6

Hi Guys,

I've an application that uses Struts and Tiles, this application was
running on WebSphere 5.1 for almost 3 years but now when we moved to
WAS6 JSTL stopped working. Let me give an example:

we've a jsp page called taglibs.jsp, in this jsp page we've all the
struts, jstl taglibrary imports. So, when we need struts or JSTL in
another JSP page we just include this taglibs.jsp. Using -> <%@ include
file="/jsp/taglibs.jsp" %> , seems that WAS6 container support JSP 2.0
and somehow this caused the include directive to stop working. I found a
lot of messages in Forums and after I read the JSP 2.0 spec, I decided
to set encoding to each page. Isn't worked because actually include
directive includes content like->  Content  but don't include
taglib directives like the one below.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>


Any ideias ?

Thanks !!

-Rafael T Icibaci


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


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



Controlling Reset method

2006-06-03 Thread chamal desilva
Hi,

As I know the reset method of a form bean is called
automatically when a action tries to add the form bean
to session or retrieve it.

Is there a way that we can stop the reset method being
called.



This is what I am trying to do.

I have two form beans for Customer and Account and two
actions to "view account list of customer" and "view
account details". First action is linked with Customer
bean and it display the list of accounts owned by the
customer. The second action is linked with Account
bean and it shows the details of account selected by
user.

public void Customer extends ActionForm
{
Vector accounts = new Vector(); //Elements of this
vector contains Account beans

//other attributes and methods


}


public void Account extends ActionForm
{
//attributes and methods

}




For examle let's think there are four Accounts in
accounts vector. The first action displays this list
on a JSP. User clicks on first account and views
details. Then user goes back and clicks on second
account. Then the data of first account object is
reset and gets lost. This is my problem/


=

Thanking You,
Chamal.

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



Java class package organization

2006-06-03 Thread Scott Van Wart
How do you folks organize your package layout?  I went with 
com...action, .form, .bean, .db, etc for action 
classes, form beans, other beans, and database entities.  I have 32 
action classes defined, so naturally things are getting a little 
cluttered, and I'd prefer not to expand the package name any further.  
I'm not even close to finishing the project either, so I expect a lot 
more classes :).


- Scott

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



Re: [Shale - Clay] nested properties in @managed-bean-name can't work

2006-06-03 Thread phyopiyo

Hi

I just found out why this is happening.  If you have nested objects under
your managed bean, and if it is a class defined by you,  you must provide
the getter method of that object to return a new instance when the object is
null.  

I got the solution from Rolodex example !

Thanks for providing a very good example in Rolodex, just a little bit hard
for new comer to know what's going on inside that Rolodex example. 
Nonetheless, rolodex is the best example to explore.

Regards,
Phyo
--
View this message in context: 
http://www.nabble.com/-Shale---Clay--nested-properties-in-%40managed-bean-name-can%27t-work-t1727504.html#a4699691
Sent from the Struts - User forum at Nabble.com.


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



Re: Validation 'depends' attribute order, and 'validwhen'

2006-06-03 Thread Scott Van Wart

Jakub Milkiewicz wrote:
If you are thinking of creating custom validator remember that even if 
your
custom validator fails it doesn't mean that your form is invalid! You 
must

remember to add ActionError/ActionMessage to ActionErrors/ActionMessages
passed as a parameter to yor validator.


Wow, thanks for pointing this out, I hadn't realized that.  So if I want 
to stop processing validators in the chain, but still consider the form 
valid, I just return Boolean.FALSE in my plugin validator, but don't put 
anything into the passed ActionMessages... thanks for the tips!


- Scott

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



Re: Validation 'depends' attribute order, and 'validwhen'

2006-06-03 Thread Jakub Milkiewicz

Hi
As far as i remeber It works as a chain. Struts processes validators in
depends attribute from left to right.
If a validator fails (returns false) struts doesn't process the next one.
If you are thinking of creating custom validator remember that even if your
custom validator fails it doesn't mean that your form is invalid! You must
remember to add ActionError/ActionMessage to ActionErrors/ActionMessages
passed as a parameter to yor validator.
If you are thinking of creation new validators that is to be used in depends
chain maybe you will be interested in my solution:
I created my own 2 validators : gotoNextIf, skipNextIf. Both are derived
from ValidWhen validator but gives me great flexibility in depends chain.
GotoNextIf evaluates condition and if its true it returns true and control
is passed to next validator in a chain.
SkipNext does the same job but returns false if condition is met and next
validators in a chains are skipped.
The condition i use is the same as used in validwhen test expression
(currently i modified it a little bit to support UTF-8 in string literals)
The most important: Both validators DO NOT add any entries to
ActionErrors/ActionMessages so they act only as propagation or cut point in
a chain.
You may wonder why i have created 2 validators with similiar functionality
and not utilize any ! in test condition. The problem is that antlr gramma
which is used in test condition in validwhen validator is quite weird and
non-intuitive.
I


milus
2006/6/3, Scott Van Wart <[EMAIL PROTECTED]>:


I've been looking through guides and such online, but I'm not really
clear how the validations work.  For example, the JavaDoc for
org.apache.struts.validator.FieldChecks.validateLong says it returns
"true if valid, false otherwise.", but if the checked value can be
converted to java.lang.Long, it returns the value itself, rather than
Boolean.TRUE or Boolean.FALSE.  I want to combine my own pluggable
validators with the 'validwhen' validator, but I'm not sure of the order:

- When multiple validators are listed in the 'depends' attribute, are
all validators called, or are they called in order until one returns
Boolean.TRUE or some other value?
- Must all validators return Boolean.TRUE, or some other value, or must
at least one return this value?

Thanks,
  Scott

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




Re: internalization validation.xml

2006-06-03 Thread Jakub Milkiewicz

Hi
Nobody answered me, so i decided to find a solution myself...
If you want to have UTF-8 characters support in string literals (like in
example i gave in previous mail), and you are not interestested in having
utf8 support in identifiers (like UTF8 characters in property names) you
need to follow the steps:
1. get struts sources.
2. in org\apache\struts\validator\validwhen directory there is
ValidWhenParser.g file that is used to generate lexer and parsers (antlr
stuff).
Find class ValidWhenLexer extends Lexer line and add extra line in options :
charVocabulary = '\u0001' .. '\uFFFE';
I am using struts 1.2.8  so after modyfication it looks like following:
class ValidWhenLexer extends Lexer;

options {
k=2;
charVocabulary = '\u0001' .. '\uFFFE';
caseSensitive=false;
defaultErrorHandler=false;
}
As far as i know antlr in version 2.7.2 supports UTF-8 characters from range
: '\u0001' - '\uFFFE'.
3. readme.txt contains instructions how to generate new ValidWhenLexer.java
ValidWhenParser.java ValidWhenParserTokenTypes.java
ValidWhenParserTokenTypes.txt files.You can use ValidWhen.java  as it is
from struts distribution but remember to modify it to make it use these new
generated files - modify imports.
4. The last thing it to modify validation-rules.xml to instruct struts to
use new validwhen validator i.e. to point it to our modified ValidWhen.java
I hope it will help someone...



2006/5/28, Jakub Milkiewicz <[EMAIL PROTECTED]>:


Hi
I am using struts validator to validate my form. I have a problem with
validwhen when i use non english characters in comparison section.
I tried:


test
(*this* == 'dowód')


or


test
(*this* == 'dowód')



But still it doesn't work.I always got a message on my console :
594cb546 ValidWhen E org.apache.struts.validator.validwhen.ValidWhen
ValidWhen Error for field ' documentIdentity' - line 1:16: expecting ''',
found 'ó'

I use struts 1.2.9, which is shipped vith validator 1.1.4
Can anyone help me.



Re: Strange problem:Validator can NOT validate Integer ?!

2006-06-03 Thread M.Liang Liu

Yup.

That's OK.

I just wondering why the validation is omitted if I define the field as
Integer or int.

Defining all the fields as String may be a general way .


Thanks.
On 6/4/06, M.Liang Liu <[EMAIL PROTECTED]> wrote:


I test the " integer " depends and it works well in a single page.

There must be something to do with the setCoustomer.do.

I am trying to define  the  field  as String ,NOT Integer.

Just waiting...

On 6/4/06, M.Liang Liu <[EMAIL PROTECTED]> wrote:
>
> I have got a strange problem as following:
>   I would like to use DispatchAction for one of my use case named
> customer and I create a setCustomer.do action to init the hidden
> property---methodToCall.
> Then that action execute method  returns mapping.findFordward
> ("continue");
>
> The continue page makes use of the same ActionForm as  setCustomer.do.
>
> There is an  fields which should be required,integer in the
> next page(namely continued page).
>
> however,no validation for that property and it would be 0 if other
> fields fails.
>
> Required,date for other fields are just OK.But the integer validation
> can NOT work as expected.
>
> p.s If I put a string not integer to that field,it would be 0 in the
> end.
>
> Any advice?
>
>
> The problem are strange to me and I  want to know the solution.
>
> Thanks for reading and looking forward to u.
> --
> Why Signature?
>



--
Why Signature?





--
Why Signature?


Re: Strange problem:Validator can NOT validate Integer ?!

2006-06-03 Thread M.Liang Liu

I test the " integer " depends and it works well in a single page.

There must be something to do with the setCoustomer.do.

I am trying to define  the  field  as String ,NOT Integer.

Just waiting...
On 6/4/06, M.Liang Liu <[EMAIL PROTECTED]> wrote:


I have got a strange problem as following:
  I would like to use DispatchAction for one of my use case named customerand I 
create a setCustomer
.do action to init the hidden property---methodToCall.
Then that action execute method  returns mapping.findFordward("continue");

The continue page makes use of the same ActionForm as  setCustomer.do.

There is an  fields which should be required,integer in the
next page(namely continued page).

however,no validation for that property and it would be 0 if other fields
fails.

Required,date for other fields are just OK.But the integer validation can
NOT work as expected.

p.s If I put a string not integer to that field,it would be 0 in the end.

Any advice?


The problem are strange to me and I  want to know the solution.

Thanks for reading and looking forward to u.
--
Why Signature?





--
Why Signature?


Strange problem:Validator can NOT validate Integer ?!

2006-06-03 Thread M.Liang Liu

I have got a strange problem as following:
 I would like to use DispatchAction for one of my use case named
customerand I create a setCustomer
.do action to init the hidden property---methodToCall.
Then that action execute method  returns mapping.findFordward("continue");

The continue page makes use of the same ActionForm as  setCustomer.do.

There is an  fields which should be required,integer in the next
page(namely continued page).

however,no validation for that property and it would be 0 if other fields
fails.

Required,date for other fields are just OK.But the integer validation can
NOT work as expected.

p.s If I put a string not integer to that field,it would be 0 in the end.

Any advice?


The problem are strange to me and I  want to know the solution.

Thanks for reading and looking forward to u.
--
Why Signature?


[Shale - Clay] nested properties in @managed-bean-name can't work

2006-06-03 Thread phyopiyo

Hi 

I could not get/set property values of nested properties in my managed bean.
I am using normal HTML to reference to JSF components defined in my
clay-config.xml.   Here is the code fragment.



...//supporing HTMLs code here

   
  Mock password
   
   
  
   
   
  Mock Error
Message
   

...//supporing HTMLs code here









   
   
   
   








public class TestBean extends AbstractViewController{

   private NestedClass nestedProperty;
 
   public NestedClass getNestedProperty(){
  return nestedProperty;
   }

   public void setNestedProperty(NestedClass nested){
  nestedProperty = nested;
   }

   // ... all other related methods like 'save', 'canel' etc.
}


public class NestedClass{

   private String testObj;
   
   public String getTestObj(){
  return testObj;
   }

   public void setTestObj(String test){
  testObj = test;
   }
}


testBean

com.test.TestBean

request



I knew that we must use managed-beans in xxx$yyy  format, if the URL is like
http://localhost:8080/myapplication/xxx/yyy.html.  But my case here is using
http://localhost:8080/myapplication/testBean.html.  Therefore, I gave my
managed-bean name 'testBean' without any $ character.

When i submit the form, I am getting '  "testObj": Error during model data
update.  ' error message.  When I try out other immediate properties (e.g.
@managed-bean-name.propertyOne ), i can set/gett it perfectly.  The error
only happen when i used nested properties (e.g.
@managed-bean-name.propertyOne.littleNestedProperty).

Is there any thing that I need to do to solve this problem? I have already
read through and study the 'rolodex' example came along with Shale.  But it
is too confusing and could not understand it because there are so many
components defined inside and i lost track.  I also found that Rolodex
sample can successfully use nested bean properties from managed-bean.  but i
just can't do it and can't find the reason why... 

thank you for spending your precious time to read my mail


Regards to all,
Phyo


--
View this message in context: 
http://www.nabble.com/-Shale---Clay--nested-properties-in-%40managed-bean-name-can%27t-work-t1727504.html#a4693586
Sent from the Struts - User forum at Nabble.com.


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



Re: [Struts + Tiles] JSTL problem on WebSphere Application Server 6

2006-06-03 Thread Martin Gainty

also.. are the tld files located in WEB-INF?
HTH,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Samere, Adam J" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Friday, June 02, 2006 11:36 AM
Subject: RE: [Struts + Tiles] JSTL problem on WebSphere Application Server 6


I doubt that the include is not working. What version of JSTL are you
using? Do you have taglib entries in web.xml?

Can you explain "JSTL stopped working" a little more extensively?

-Original Message-
From: Rafael [mailto:[EMAIL PROTECTED]
Sent: Friday, June 02, 2006 11:01 AM
To: Struts Users Mailing List
Subject: [Struts + Tiles] JSTL problem on WebSphere Application Server 6

Hi Guys,

I've an application that uses Struts and Tiles, this application was
running on WebSphere 5.1 for almost 3 years but now when we moved to
WAS6 JSTL stopped working. Let me give an example:

we've a jsp page called taglibs.jsp, in this jsp page we've all the
struts, jstl taglibrary imports. So, when we need struts or JSTL in
another JSP page we just include this taglibs.jsp. Using -> <%@ include
file="/jsp/taglibs.jsp" %> , seems that WAS6 container support JSP 2.0
and somehow this caused the include directive to stop working. I found a
lot of messages in Forums and after I read the JSP 2.0 spec, I decided
to set encoding to each page. Isn't worked because actually include
directive includes content like->  Content  but don't include
taglib directives like the one below.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>


Any ideias ?

Thanks !!

-Rafael T Icibaci


-
The information contained in this message may be privileged,
confidential, and protected from disclosure. If the reader of this
message is not the intended recipient, or any employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.

Thank you. Paychex, Inc.


-
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: Console

2006-06-03 Thread James Holmes
Hi Abhimanyu,

The problem you are encountering is probably happening because Struts
Console stores the window size settings for the application in a
configuration file. Somehow your window size has been reduced to a size that
cannot be displayed. If you remove the Struts Console configuration file,
the window will go back to the default size.

The file you need to delete is:

C:\Documents and Settings\James Holmes\StrutsConsole.cfg

Of course, you will need to substitute "James Holmes" with your computer
login.

James

-Original Message-
From: Abhimanyu Koul [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 02, 2006 5:40 AM
To: Struts Mailing list
Subject: Console

hi!
I have a problem in running struts console. The application just not starts
up. i use windows 2000. it used to work fine till yesterday but from the
last 10 hours it is not working. i tried to reboot, reinstall, reinstall jre
but to no avail. 
the struts console window appears in the taskbar but it does not start up.
please help me. i am in a fix.

Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Dani Compound,
158, Vidyanagari Marg,
Kalina, Santacruz (East),
Mumbai - 400 098
Mobile : +91 9819510090


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



Re: Struts dependency versions

2006-06-03 Thread Frank W. Zammetti

Hi Scott,

That information can usually be found in the manifest.mf file.  For 
instance, the commons-digester jar that shipped with Struts 1.2.4 shows:


Manifest-Version: 1.0
Created-By: Apache Ant 1.5.1
Extension-Name: org.apache.commons.digester
Specification-Title: "Jakarta Commons Digester"
Specification-Vendor: "Apache Software Foundation"
Specification-Version: "1.5"
Implementation-Title: "org.apache.commons.digester"
Implementation-Vendor: "Apache Software Foundation"
Implementation-Version: "1.5"

The Implementation-Version is what you want I believe.

Frank

Scott Van Wart wrote:
I have Struts 1.2.9, and I need to step through the source of some of 
its dependencies.  Couple questions:


- How can I find the versions of the dependencies distributed with the 
Struts binary? (ie: commons-validator, commons-logging, etc.).  I've 
tried unzipping the JAR files shipped with the Struts binary, but I 
can't find any version information in them.
- If the Struts dependancies are out-of-date (ie: the latest Struts 
doesn't include binary copies of its latest dependencies), can I safely 
download the latest binaries of its dependencies and expect the Struts 
binary distribution to run safely?


- Scott

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



Struts dependency versions

2006-06-03 Thread Scott Van Wart
I have Struts 1.2.9, and I need to step through the source of some of 
its dependencies.  Couple questions:


- How can I find the versions of the dependencies distributed with the 
Struts binary? (ie: commons-validator, commons-logging, etc.).  I've 
tried unzipping the JAR files shipped with the Struts binary, but I 
can't find any version information in them.
- If the Struts dependancies are out-of-date (ie: the latest Struts 
doesn't include binary copies of its latest dependencies), can I safely 
download the latest binaries of its dependencies and expect the Struts 
binary distribution to run safely?


- Scott

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