Re: tag writers resources?

2008-01-29 Thread Joachim Ansorg

Hi Darren,
the example that I posted is just for JSP. But if you look at the 
struts2 examples it shouldn't be that hard to make a tag usable in 
freemarker or velocity as well.
As you can see the information available on writing native Struts2 tags 
is quite hard to find.
The most important reason for me writing a S2 tag has been the 
evaluation of the ognl expressions. But as Dale wrote the TagUtils class 
can probably be used for that in the standard JSP tags.


Joachim


This gives me something to start with.   Time to dig into the struts2
source code to help me grok the sample you've provided.


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



Re: [struts] tag writers resources?

2008-01-29 Thread Joachim Ansorg

Dale,
this is useful information for me. Thanks for pointing this out.
I'll make use of this class, I think.

Joachim
P.P.S:  If your question is really how do i evaluate tag arguments 
that are really ognl expressions, then TagUtils.getStack() is probably 
what you're looking for:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/TagUtils.html 



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



Re: [STRUTS2] Error in Dojo / Howto update Dojo

2008-01-29 Thread Julien RICHARD
I use Struts 2.0.11 and i have an dojo error when i wants to used textearea
with Ajax theme (this create an richtext box).*
After little research, this is an bug in dojo resolved in 2007/11.
Dojo works perfectly for other features in my code, so i need to update the
dojo in the struts core.
Currently i have integrated FCKEditor instead.

Regards,

On Jan 29, 2008 6:37 AM, ravi_eze [EMAIL PROTECTED] wrote:


 which version are u using??

 i think u are getting error like dojo not defined. If yes then read the
 following

 u need to make dojo available do the following steps:

 1. explode struts core.jar
 2. create a folder in the war : struts
 3. search for ajax,dojo,niftycorners,simple,xhtml in the exploded jars
 (step
 1)
 4. copy them all into the struts folder (step 2)

 start teh tomcat.

 view sourcet the page u are tring to use.. u will see the js files its
 tryuing to fetch from the server.. the above steps make sure that they all
 exist on the server..

 hope this helps.

 ravi


 Julien RICHARD-2 wrote:
 
  Hi,
 
  I'm new in the mailing list, so hi to all users.
  Little presentation : french java struts2 developer.
 
  I have a question. I want to use richtext box with dojo (textarea
  theme=ajax) but i cant. In fact, the embedded version of dojo have a
  error
  and i need to update the dojo version. How can i make this with simple
  operation ?
 
  Thanks for your answers.
 
 

 --
 View this message in context:
 http://www.nabble.com/-STRUTS2--Error-in-Dojo---Howto-update-Dojo-tp15132308p15152849.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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




-- 
RICHARD Julien,
UNILOG


Where did the target attribute go in the a-tag?

2008-01-29 Thread niels

There is no target attribute in de a-tag:
http://struts.apache.org/2.x/docs/a.html

I am a newbie, and want to open de link in another (specified) browser  
window..


How to overcome this?

Niels

Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Johnson nickel

Hi Friends,

I am using Struts 2 application for my project. Before I was used Struts 1
when compare to this

Struts 2 is reduced lot of configuration problems. I have use the Annotation
validation to validate the
Username and password fields in my Login page.

Code:
 
   
@RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName=username,message=UserName
is required)
public String getUsername() {
  return username;
   }



Same as For password also ,

When i have submit the Login button, the Error messages is displaying
Repeated. I have spend lot of time
on this issue. Can u anybody give me the solution.

Thanks and Regards,
Johnson
-- 
View this message in context: 
http://www.nabble.com/Error-messages-is-repeated-Using-Struts-2-Annotation-validation-tp15157319p15157319.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread niels

Thanks David,

but according to the TLD target is not a valid attribute for tag url

Niels


On Jan 29, 2008, at 12:44 PM, David Tercero wrote:



Hi niels,

  you can generate a html anchor, using the s:url tag to generate  
the href

url,

s:url ...  target=...some text

hope this helps.




niels-15 wrote:


There is no target attribute in de a-tag:
http://struts.apache.org/2.x/docs/a.html

I am a newbie, and want to open de link in another (specified)  
browser

window..

How to overcome this?

Niels



--
View this message in context: 
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15157668.html
Sent from the Struts - User mailing list archive at Nabble.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: Where did the target attribute go in the a-tag?

2008-01-29 Thread David Tercero

Hi niels,

   you can generate a html anchor, using the s:url tag to generate the href
url,

s:url ...  target=...some text 

hope this helps.




niels-15 wrote:
 
 There is no target attribute in de a-tag:
 http://struts.apache.org/2.x/docs/a.html
 
 I am a newbie, and want to open de link in another (specified) browser  
 window..
 
 How to overcome this?
 
 Niels
 

-- 
View this message in context: 
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15157668.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Problem setting id property of texfield tag

2008-01-29 Thread Julien RICHARD
Do you tried :

s:textfield id=stockTotal_%{house.id} value=%{house.number}/

On Jan 29, 2008 12:32 PM, David Tercero [EMAIL PROTECTED] wrote:


 Hi all,

   I'm  having troubles setting the id property in a textfield tag. I use
 the version 2.0.11

   The case is I'm not able to introduce a variable value into the id
 property, I mean:

 s:textfield
s:param name=idstockTotal_${house.id}/s:param
s:param name=namestockList[${house.id}].number/s:param
s:param name=value${house.number}/s:param
 /s:textfield

   I generate several textfields like this one and I need to reference it
 in
 javascript (that's because i need to set the id property). Using the param
 tag doesn't work for the id, but goes right for the name and value
 propertys.

   I tried several ways but none of them seems to work.

 Any help would be appreciated.
 --
 View this message in context:
 http://www.nabble.com/Problem-setting-id-property-of-texfield-tag-tp15157521p15157521.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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




-- 
RICHARD Julien,
UNILOG


Struts2 2.0.11 Validation with DWR

2008-01-29 Thread Julien RICHARD
I need some help with DWR.

I have find and follow an example of utilisation of DWR for struts2
validation.
this link : http://java-x.blogspot.com/2006/11/struts-2-validation.html

Im really new about DWR and this example doesn't work for me. I think DWR is
the correct way for me to ckeck my form in ajax but this example make null
execption and not working.

If someone have some times to help me for my first step in DWR, will be
appreciated ;)

Regards,
-- 
RICHARD Julien,


Re: browse old posts?

2008-01-29 Thread Julien RICHARD
Will be usefull for me too.
Thanks.

On Jan 29, 2008 3:31 PM, Mazhar, Osman (Home Office) [EMAIL PROTECTED]
wrote:

 Hello,



 Before I start asking questions, I wanted to know if there is a way to
 browse existing posts to see if my questions have already been answered.



 So, is there a way to look at old posts?



 - Osman


 __
 This e-mail has been scanned by The Leukemia  Lymphoma Society Managed
 Email Content Service, provided by Verizon Business.

 NOTICE: This message, including all attachments transmitted with it, is
 for the use of the addressee only. It may contain proprietary, confidential
 and/or legally privileged information. No confidentiality or privilege is
 waived or lost by any mistransmission. If you are not the intended
 recipient, you must not, directly or indirectly, use, disclose, distribute,
 print or copy any part of this message. If you believe you have received
 this message in error, please delete it and all copies of it from your
 system and notify the sender immediately by reply e-mail. Thank you.




-- 
RICHARD Julien,
UNILOG


Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread Dave Newton
- Original Message 
 From: niels [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Tuesday, January 29, 2008 8:00:16 AM
 Subject: Re: Where did the target attribute go in the a-tag?
 
 David,
 
 I don't understand what you mean by anchor
 imagine the next situation.


s:url action=foo id=fooUrl/
a href=s:property value='#fooUrl'/ target=_blank.../a


Dave




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



Re: Problem setting id property of texfield tag

2008-01-29 Thread David Tercero

Hi, thanks for the anwer.

   It is a bit complicated, because house.id is not in the value stack but
in the page context. I use JSTL tag to complement the struts ones, so
sometimes the property is in the page context.

   With the version 2.0.9 you could use the ${} expressions (Expression
Language), but not in the 2.0.11. Recently I updated my application from
2.0.9 to 2.0.11, and realized s: tags with EL expressions caused an
exception.

   I can't reference house.id as an OGNL expression because house is not in
the stack value. The main problem seems to be I can't give the id property a
value using the s:param tag, what it's not exposed in the struts2
documentation.

   I've tested something simillar

s:set name=tmpIds:param
name=valuestockTotal_${house.id}/s:param/s:set
s:textfield id=stockTotal_%{#tmpId} value=.../

   but this generate a dump of the value stack (like toString method):

id=stockTotal_{. valueStack dump .}


Thanks in advance.





Julien RICHARD-2 wrote:
 
 Do you tried :
 
 s:textfield id=stockTotal_%{house.id} value=%{house.number}/
 
 On Jan 29, 2008 12:32 PM, David Tercero [EMAIL PROTECTED] wrote:
 

 Hi all,

   I'm  having troubles setting the id property in a textfield tag. I use
 the version 2.0.11

   The case is I'm not able to introduce a variable value into the id
 property, I mean:

 s:textfield
s:param name=idstockTotal_${house.id}/s:param
s:param name=namestockList[${house.id}].number/s:param
s:param name=value${house.number}/s:param
 /s:textfield

   I generate several textfields like this one and I need to reference it
 in
 javascript (that's because i need to set the id property). Using the
 param
 tag doesn't work for the id, but goes right for the name and value
 propertys.

   I tried several ways but none of them seems to work.

 Any help would be appreciated.
 --
 View this message in context:
 http://www.nabble.com/Problem-setting-id-property-of-texfield-tag-tp15157521p15157521.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 -- 
 RICHARD Julien,
 UNILOG
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-setting-id-property-of-texfield-tag-tp15157521p15161516.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Problem setting id property of texfield tag

2008-01-29 Thread David Tercero

Hi, it works fine :clap:, Dave you are a crack ;-)

Thank you very much =)


newton.dave wrote:
 
 From: David Tercero [EMAIL PROTECTED]
 It is a bit complicated, because house.id is not in the value
 stack but in the request.
 
 
 ...
 
 
 #attr will also search the request scope.
 
 
 Dave
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-setting-id-property-of-texfield-tag-tp15157521p15162594.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

Thanks Dave.

In fact, my problem relate to an interceptor stack problem.
If I use the defautStack, it works.
But if I do the following it does not:

action name=toHtml method=toHtml
class=com.tchegbe.demo.action.ToHtmlActions
interceptor-ref name=servletConfig/
interceptor-ref name=fileUpload/
interceptor-ref name=params/
interceptor-ref name=validation/
resulttoHtmlUtilityViewDef/result
/action


newton.dave wrote:
 
 specdev2 [EMAIL PROTECTED] wrote:
 My action is extending ActionSupport and overriding the
 validate method. However, the validate method is not 
 being called.
 
 
 1. Are you using the default interceptor stack? 
 2. Have you configured any interceptors for the action in question?
 
 
 I have set the form tag validate attribute to true, but 
 it makes no difference.
 
 
 s:form...'s validate attribute does not control server-side validation
 (unless you're using the ajax theme, I guess).
 
 
 Dave
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15162591.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Problem setting id property of texfield tag

2008-01-29 Thread Dave Newton
From: David Tercero [EMAIL PROTECTED]
 It is a bit complicated, because house.id is not in the value
 stack but in the request.


...


#attr will also search the request scope.


Dave




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



Re: Problem setting id property of texfield tag

2008-01-29 Thread Dave Newton
From: David Tercero [EMAIL PROTECTED]
 It is a bit complicated, because house.id is not in the value
 stack but in the page context.


The #attr expression will search the various JEE scopes, so the OGNL 
expression #attr.house.id should find the house.id value in page scope.


http://struts.apache.org/2.x/docs/ognl.html


Dave




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



Re: just a simple onclick

2008-01-29 Thread Chris Pat
Hi Dave
It is really plain vanilla.  I just set some form values.  What is impossible 
is that the very same onclick call placed in the html:submit/ tag works 
perfectly.  It calls the function, the values are set and inaddition it submits 
the form.  I want to separate that and first call the function then manually 
call the submit for testing and experimentation.  Why I cant get the same call 
to work from the html:button/ onclick tag is beyond me.  I hope you can help, 
because the semantics says it should be trivial and simply work.

Dave Newton [EMAIL PROTECTED] wrote: From: Chris Pat 
 I have a simple  [onclick handler] 
 and it just does not fire the function.


What does the generated HTML look like? What does the JavaScript function look 
like, and have you put an alert(...) in the function to ensure it isn't being 
called? Since you're not returning the function's return value from the 
onclick attribute the browser will still do normal button processing in 
addition to calling the function.


Dave




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




Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

Ok, I found the issue.

The Workflow Interceptor is the one that calls validate.
Hence, that's the interceptor I needed.

The application now works fine.

Thanks for all the help Dave.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163616.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Laurie Harper
That would seem to suggest that the validation interceptor relies on 
some work done by one of the interceptors you've removed from your 
stack, no? Try listing all the validators that are in the default stack 
and then commenting out the ones you don't want, one at a time, until 
you identify which one you need to retain.


L.

specdev2 wrote:

A break point in debug mode.
Again, I get to the break point if I use the default stack as follow:

action name=toHtml method=toHtml
class=com.tchegbe.demo.action.ToHtmlActions
interceptor-ref name=defaultStack/

result name=inputtoHtmlUtilityViewDef/result
/action


newton.dave wrote:

From: specdev2 [EMAIL PROTECTED]

There is just no logical reason as to why my stack would not work.


Oh.



Again, here is my stack:


What evidence do you have that your validate() method isn't being called?


Dave




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








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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

Dave,

I have to disagree with you on customizing the interceptors.
It is just sloppy to use a generic stack that calls every interceptor.
Important issues also get lost when you do that.

The true issue with Struts2 is the poor documentation.
Worst is the fact that some of the defaults just aren't smart.

I really wish there was a way to group actions for the purpose of applying
default stacks without being forced to define a namespace or overriding  the
default stack of an existing namespace.


newton.dave wrote:
 
 From: specdev2 [EMAIL PROTECTED]
 The action validate() method gets called properly by the Workflow
 Interceptor.
 http://struts.apache.org/2.x/docs/workflow-interceptor.html
 
 
 Oh, you're right [for that version of XWork].
 
 
 You'll need to change that when you upgrade S2, though; current XWork does
 not work this way.
 
 
 While I can appreciate the desire to optimize your interceptor stacks
 you are configuring yourself into a corner and are opening your
 application up to potential issues as the framework evolves.
 
 
 IMO it's not worth it.
 
 
 Dave
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15164612.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: specdev2 [EMAIL PROTECTED]
 The action validate() method gets called properly by the Workflow
 Interceptor.
 http://struts.apache.org/2.x/docs/workflow-interceptor.html


Oh, you're right [for that version of XWork].


You'll need to change that when you upgrade S2, though; current XWork does not 
work this way.


While I can appreciate the desire to optimize your interceptor stacks you are 
configuring yourself into a corner and are opening your application up to 
potential issues as the framework evolves.


IMO it's not worth it.


Dave




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



Re: How does one get the validate method to be called?

2008-01-29 Thread Musachy Barroso
workflow interceptor used to call validate in 2.0.x, on 2.1
validate is called by the validation interceptor.

musachy

On Jan 29, 2008 12:02 PM, specdev2 [EMAIL PROTECTED] wrote:

 Just to clarify, the following works as desired:

 action name=toHtml method=toHtml
 class=com.tchegbe.demo.action.ToHtmlActions
 interceptor-ref name=servletConfig/
 interceptor-ref name=fileUpload/
 interceptor-ref name=params/
 interceptor-ref name=workflow/
 result name=inputtoHtmlUtilityViewDef/result
 /action

 The action validate() method gets called properly by the Workflow
 Interceptor.
 http://struts.apache.org/2.x/docs/workflow-interceptor.html
 --
 View this message in context: 
 http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163957.html

 Sent from the Struts - User mailing list archive at Nabble.com.


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





-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
Reviewing your action configuration from a few emails ago; you've defined the 
interceptor as validation but the interceptor is actually named 
interceptor. If you use the correct interceptor name does it work?


Dave

- Original Message 
 From: specdev2 [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Tuesday, January 29, 2008 11:43:18 AM
 Subject: Re: How does one get the validate method to be called?
 
 
 A break point in debug mode.
 Again, I get to the break point if I use the default stack as follow:
 
 
 class=com.tchegbe.demo.action.ToHtmlActions
 
 toHtmlUtilityViewDef
 
 
 
 newton.dave wrote:
  
  From: specdev2 
  There is just no logical reason as to why my stack would not work.
  
  
  Oh.
  
  
  Again, here is my stack:
  
  
  What evidence do you have that your validate() method isn't
 being
 
 called?
  
  
  Dave
  
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -- 
 View this message in
 context:
 
 http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--
 tp15160502p15163537.html
 Sent from the Struts - User mailing list archive at Nabble.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: just a simple onclick

2008-01-29 Thread Dave Newton
From: Chris Pat [EMAIL PROTECTED]
 What is impossible is that the very same onclick call placed 
 in the tag works perfectly.


This word, impossible, I do not think it means what you think it means.


Without actually answering my questions it'll be impossible for me to help any 
further.


Dave


 Dave Newton  wrote:
 What does the generated HTML look like? What does the
 JavaScript function look like, and have you put an 
 alert(...) in the function to ensure it isn't being 
 called? Since you're not returning the function's
 return value from the onclick attribute the browser 
 will still do normal button processing in addition 
 to calling the function.





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



struts2 forms and css

2008-01-29 Thread xianwinwin

hi there,

I wonder how to change the font style of my form. Currently it is in a
simple 'Times New Roman' and I would like to have it differently (say
verdana).

the jsp page looks like this (below) and I wonder where the code should be
embedded? 


%@ include file=/pages/layouts/taglibs.jsp %
h2 class=menu id=titleAdd new Entity/h2
%@ include file=tabMenu.jsp %body class=section-1


s:form action=customize validate=true

s:textfield name=name label=Legal Name /  
s:textarea rows=5 cols=25 name=comment2 label=Comment /   

s:submit action=customize_insert label=Insert align=center /
 
/s:form
-- 
View this message in context: 
http://www.nabble.com/struts2-forms-and-css-tp15164776p15164776.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: specdev2 [EMAIL PROTECTED]
 The Workflow Interceptor is the one that calls validate.
 Hence, that's the interceptor I needed.


No it isn't. The validator interceptor calls validate().


The workflow interceptor checks to see if there are any error messages on the 
action and goes (by default) to the input result if there are.


Dave




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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

A break point in debug mode.
Again, I get to the break point if I use the default stack as follow:

action name=toHtml method=toHtml
class=com.tchegbe.demo.action.ToHtmlActions
interceptor-ref name=defaultStack/
result name=inputtoHtmlUtilityViewDef/result
/action


newton.dave wrote:
 
 From: specdev2 [EMAIL PROTECTED]
 There is just no logical reason as to why my stack would not work.
 
 
 Oh.
 
 
 Again, here is my stack:
 
 
 What evidence do you have that your validate() method isn't being called?
 
 
 Dave
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163537.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

I also have this:

interceptors
interceptor-stack name=emptyStack
interceptor-ref name=empty/
/interceptor-stack
/interceptors

default-interceptor-ref name=emptyStack/

So:
1. I override the default stack.
2. I specify the exact interceptor(s) I need per action.

This is to avoid useless processing.
There is a fix in the work (a dtd fix) that will enable me to have a truely
empty stack.
Currently, the dtd forces you to define at least one interceptor whereas
there is no requirement to have an interceptor in a given stack.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163494.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: specdev2 [EMAIL PROTECTED]
 There is just no logical reason as to why my stack would not work.


Oh.


 Again, here is my stack:


What evidence do you have that your validate() method isn't being called?


Dave




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



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread Laurie Harper

niels wrote:

There is no target attribute in de a-tag:
http://struts.apache.org/2.x/docs/a.html


Correct, there isn't such an attribute. The Struts 2.0.9 documentation 
for that tag lists a 'targets' attribute, but that's related to the Ajax 
theme and doesn't do what you're looking for.


I am a newbie, and want to open de link in another (specified) browser 
window..


How to overcome this?


Dave's solution (using a vanilla a tag) is the correct way to do this.

L.


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



Re: just a simple onclick

2008-01-29 Thread Dave Newton
From: Chris Pat [EMAIL PROTECTED]
 I have a simple html:button... [onclick handler] 
 and it just does not fire the function.


What does the generated HTML look like? What does the JavaScript function look 
like, and have you put an alert(...) in the function to ensure it isn't being 
called? Since you're not returning the function's return value from the 
onclick attribute the browser will still do normal button processing in 
addition to calling the function.


Dave




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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

This is the default stack:

interceptor-stack name=defaultStack
interceptor-ref name=exception/
interceptor-ref name=alias/
interceptor-ref name=servletConfig/
interceptor-ref name=prepare/
interceptor-ref name=i18n/
interceptor-ref name=chain/
interceptor-ref name=debugging/
interceptor-ref name=profiling/
interceptor-ref name=scopedModelDriven/
interceptor-ref name=modelDriven/
interceptor-ref name=fileUpload/
interceptor-ref name=checkbox/
interceptor-ref name=staticParams/
interceptor-ref name=params
  dojo\..*
/interceptor-ref
interceptor-ref name=conversionError/
interceptor-ref name=validation
input,back,cancel,browse
/interceptor-ref
interceptor-ref name=workflow
input,back,cancel,browse
/interceptor-ref
/interceptor-stack


There is just no logical reason as to why my stack would not work.

Again, here is my stack:
action name=toHtml method=toHtml
class=com.tchegbe.demo.action.ToHtmlActions
interceptor-ref name=servletConfig/
interceptor-ref name=fileUpload/
interceptor-ref name=params/
interceptor-ref name=validation/
result name=inputtoHtmlUtilityViewDef/result
/action

servletConfig, fileUpload, and params are called just fine.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163199.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



just a simple onclick

2008-01-29 Thread Chris Pat
Hello
I have a simple html:button property=test value=TestMe 
onclick=testFunction()/ in a html:form set.

and it just does not fire the function.  However if I make the same onclick 
call in a html:submit it calls the function perfectly.  Can someone explain?  
It is not typos, I have copied and pasted perfectly.  I am nonplused.  tia.


Re: best way to handle multiple buttons in a form?

2008-01-29 Thread Laurie Harper

Jason Dolinger wrote:

Hi all,

I'm new to Struts 2 (and Struts in general), and I'm having a hard time 
figuring out how to handle the simple case of multiple buttons within a form.  
The method I'm trying to use is described in the Struts 2 cookbook here:  
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html.

I've copied these verbatim (along with a small struts.xml to wire them up), and both button boolean fields always remain false.  Should this work?  I'm using Struts 2.0.11.  There's always the route of using Javascript to detect which button was clicked, but I'd rather avoid it if not necessary.  



Are you sure you copied the example code faithfully? It should work as 
advertised. Post your action mapping configuration and the action 
code/JSP markup you're actually using; maybe there's a simple mistake in 
there someone can spot.


I've also seen mention of a Struts LookupDispatcher or MapDispatcher.  Is there something similar in Struts 2?  


There are no direct equivalents of those classes in Struts2 because they 
 aren't needed. The Struts2 core includes mechanisms that allow you to 
achieve the same things more directly. See, for example, the 'method' 
attribute on action mappings and on the s:form and s:submit tags.


L.


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



Re: [S2] Starter application in IE Firefox

2008-01-29 Thread Laurie Harper

hezjing wrote:

Hi

I created Struts2 starter application as shown below,

   mvn archetype:create
   -DgroupId=com.fdar.apress.s2
   -DartifactId=app
   -DarchetypeGroupId=org.apache.struts
   -DarchetypeArtifactId=struts2-archetype-starter
   -DarchetypeVersion=2.0.9-SNAPSHOT
   -DremoteRepositories=http://people.apache.org/maven-snapshot-repository

then, I modified pom.xml and changed the dependencies to JUnit 4.4 and
Struts 2.0.11.

When loaded the application in Firefox, I can see the menu bar (Menu
1, Menu 2 and etc) displayed on the top.

When loaded the application in IE 6.0, the same menu bar is missing!

Do you what could be the problem?


Did everything work before you updated the dependencies? If so, did you 
check the release notes for 2.0.11 [1] to see if any changes may be 
needed in the starter app code?


L.

[1] http://struts.apache.org/2.0.11/docs/release-notes-2011.html


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
specdev2 [EMAIL PROTECTED] wrote:
 My action is extending ActionSupport and overriding the
 validate method. However, the validate method is not 
 being called.


1. Are you using the default interceptor stack? 
2. Have you configured any interceptors for the action in question?


 I have set the form tag validate attribute to true, but 
 it makes no difference.


s:form...'s validate attribute does not control server-side validation 
(unless you're using the ajax theme, I guess).


Dave




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



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread Dave Newton
David Tercero wrote:
 Dave Newton wrote:
 s:url action=foo id=fooUrl/
 If you do that, the url will be printed on the html page.


No it won't.


I prefer this method primarily for s:a... tags since I can avoid using the 
s:property.../ tag for s:a...'s href attribute (if I use JSP EL I can 
avoid s:property.../ for a... as well) since s:a... will evaluate href:


s:url action=foo id=fooUrl/
s:a href=%{#fooUrl}.../s:a


Dave




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



Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread David Tercero

Hi,

   Something simillar happens to me when i started with Struts 2. I use
appfuse and I realized that a message displays just above the field I'd
validated, and where I included a messages.jsp (this jsp displays the action
and error messages), usually at the top of the html page.

   To solve this I supressed the field messages (those that are displayed
above the field) rewriting the tag templates. Struts gives you the chance to
override the templates they provide. I created a tree at WEB-INF level just
like they are in the struts2-core library (template/css_xhtml/...). The
files you put there will overwrite the Struts2 ones, and change the default
behaviour of the tags.

Regards.


Johnson nickel wrote:
 
 Hi Friends,
 
 I am using Struts 2 application for my project. Before I was used Struts 1
 when compare to this
 
 Struts 2 is reduced lot of configuration problems. I have use the
 Annotation validation to validate the
 Username and password fields in my Login page.
 
 Code:
  

 @RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName=username,message=UserName
 is required)
 public String getUsername() {
   return username;
}
 
 
 
 Same as For password also ,
 
 When i have submit the Login button, the Error messages is displaying
 Repeated. I have spend lot of time
 on this issue. Can u anybody give me the solution.
 
 Thanks and Regards,
 Johnson
 

-- 
View this message in context: 
http://www.nabble.com/Error-messages-is-repeated-Using-Struts-2-Annotation-validation-tp15157319p15160651.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: browse old posts?

2008-01-29 Thread Dave Newton
http://struts.apache.org/mail.html


There are about a half-dozen archives listed there.


Dave

- Original Message 
 From: Mazhar, Osman (Home Office) [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Tuesday, January 29, 2008 9:31:42 AM
 Subject: browse old posts?
 
 Hello,
 
  
 
 Before I start asking questions, I wanted to know if there is a way to
 browse existing posts to see if my questions have already
 been
 
 answered.
 
  
 
 So, is there a way to look at old posts?
 
  
 
 - Osman
 
 
 __
 This e-mail has been scanned by The Leukemia  Lymphoma Society
 Managed
 
 Email Content Service, provided by Verizon Business.
 
 NOTICE: This message, including all attachments transmitted with it,
 is
 
 for the use of the addressee only. It may contain
 proprietary,
 
 confidential and/or legally privileged information. No confidentiality
 or
 
 privilege is waived or lost by any mistransmission. If you are not
 the
 
 intended recipient, you must not, directly or indirectly, use,
 disclose,
 
 distribute, print or copy any part of this message. If you believe
 you
 
 have received this message in error, please delete it and all copies
 of
 
 it from your system and notify the sender immediately by reply
 e-mail.
 
 Thank you.
 
 



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



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread David Tercero

If you do that, the url will be printed on the html page. You can put it all
together:

lt;a href=lt;s:url action=foo id=fooUrl/gt;
target=_blankgt;...lt;/agt;

You can use a html anchor (lt;a href=gt;), and use the s:url tag to
provide the url. This is the way I usually code the links in my web
applications.

Regards.




newton.dave wrote:
 
 - Original Message 
 From: niels [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Tuesday, January 29, 2008 8:00:16 AM
 Subject: Re: Where did the target attribute go in the a-tag?
 
 David,
 
 I don't understand what you mean by anchor
 imagine the next situation.
 
 
 s:url action=foo id=fooUrl/
  s:property value='#fooUrl'  target=_blank... 
 
 
 Dave
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15160405.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Dave Newton
--- Johnson nickel [EMAIL PROTECTED] wrote:

@RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName=username,message=UserName
 is required)

For a string field you'll probably want to use the @RequiredStringValidator:
a text field will return an empty string, whereas @RequiredFieldValidator
only checks for null-ness (different from blank-ness).

 Same as For password also ,

*Exactly* the same? (You put the right fieldName for the password field,
right?)

 When i have submit the Login button, the Error messages is displaying
Repeated.

You'll need to provide some JSP and possibly configuration in order to help
diagnose the problem.

Where are the duplicated messages appearing?

Dave



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



Re: AJAX approach

2008-01-29 Thread Pablo Vázquez Blázquez

Hi Jeromy,

Thank you very much for your explanation. I know it was a big question.

Well, I liked your suggestion of having a function with 2 timestamps 
(that´s what I had thougth about), but, for external reasons, it won´t 
be so.


Now, I will have a controller action that will keep at session scope the 
actual state (the whole collection) and, from client, periodically will 
ask the model for the actual state and match previous state with the new 
one. Then, I will get only the differences between them and convert them 
to a json string, which will be returned by the action. In this json 
string I will have the rows that have changed, including those that have 
been deleted or created, so that I can update the table in the document.


I would like to ask you if you know wheter YUI table lets me filter, 
order by column and paginate the table using AJAX (without refreshing 
the page) or doing it client-side. I couldn´t take a look to it yet. Sorry.


Thanks.


Jeromy Evans escribió:

Hi,

You're asking a big question.  What follows is the approach I would 
take.  There's many other approaches you could also try and my 
solution may be too javascript-centric for you.


First, the interface is stateless, so I'd probably have my action 
always accept two timestamp parameters and always output the changes 
that occurred between the start timestamp and end timestamp.  If the 
start timestamp is null you want all data. If the end timestamp is 
null you want most recent.
This would simplify the action down to the single responsibility of 
providing the difference in the data between the start and end timestamp.
If your data changes against something other than time, such as 
revision number, then use that as the arguments.
The table data will need to be decorated with information about the 
timestamp/revision.

I would output the data as JSON or XML, not HTML.

The client (javascript) maintains the state for your user.  It knows 
whether its loaded data yet, the timestamp/revision of the current 
data and controls when to get an update (periodically or triggered).  
I would use a javascript library that includes an ajax datagrid.  
That's a fancy name for a table that can update its data 
asynchronously.  My favourite is YUI 
(http://developer.yahoo.com/yui/datatable/) but there are plenty 
available.
Whatever the implementation, the datagrid will include a data model 
that contains the table data (eg. a RecordSet in YUI) and includes 
methods for updating the table model dynamically.   If you ever used 
Swing, they generally work like Swing's TableModel.


Your responsibility will be to map the changed data into the 
datagrid's model. As the current state and data is in memory (eg. in 
the RecordSet) and the changed data is available from your action's 
result (eg. in XML or a JSON structure) you can iterate through the 
changes and apply each them to the model. As the model is changed, the 
library will update the UI.


Hope that gives you some direction.
regards,
Jeromy Evans

[EMAIL PROTECTED] wrote:

Hi!

I would like to comment you a problem I have now when developing a 
web application using Struts 2.


I have a collection of items, which I want to show in a table. Those 
items have some attributes that change with the time and I would like 
to show the updated state in the view layer. I don´t know very well 
how to achieve this. I suppose I must be polling the web server and 
getting the whole collection each time, but this collection may be 
huge, so I don´t think it would be a nice approach. What I would like 
most would be changing only those attributes that changed from the 
last polling.


Supposing that I have an action at the model layer that returns me a 
collection with only those item that have changed (the first time it 
must return me the whole items), (or maybe, I could have 2 actions: 
one for ask if sth has changed and another one to retrieve the whole 
collection -if sth has changed-), how can I modify the HTML to update 
the shown content? Could I convert the item's collection in the 
controller action to JSON and retrieve it in the jspx? It is, call 
this controller action directly from javascript? Is there an easier 
way to do this using Struts2 or do I have to use AJAX raw?


To sum up:
controller action - model action - returns collectionItem - 
controller action returns jspx where I draw the table. Now how do I 
update this table? The easy way would be using an s:div tag with 
href=action and a timer to update it, but it would involve update 
the whole table.


Any help would be grateful.

Thanks.



http://www.denodo.com

Aviso Legal
Este mensaje es solamente para la persona a la que va dirigido.
Sus contenidos y cualquier archivo adjunto son confidenciales.
Si usted lo ha recibido por error, le rogamos que lo borre y
lo notifique a [EMAIL PROTECTED]
Gracias.

Legal Notice
This message is intended for the 

Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread David Tercero

target belongs to the anchor, not to the s:url tag.




niels-15 wrote:
 
 Thanks David,
 
 but according to the TLD target is not a valid attribute for tag url
 
 Niels
 
 
 On Jan 29, 2008, at 12:44 PM, David Tercero wrote:
 

 Hi niels,

   you can generate a html anchor, using the s:url tag to generate  
 the href
 url,

 s:url ...  target=...some text

 hope this helps.




 niels-15 wrote:

 There is no target attribute in de a-tag:
 http://struts.apache.org/2.x/docs/a.html

 I am a newbie, and want to open de link in another (specified)  
 browser
 window..

 How to overcome this?

 Niels


 -- 
 View this message in context:
 http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15157668.html
 Sent from the Struts - User mailing list archive at Nabble.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15158312.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Problem setting id property of texfield tag

2008-01-29 Thread David Tercero

Hi all,

   I'm  having troubles setting the id property in a textfield tag. I use
the version 2.0.11

   The case is I'm not able to introduce a variable value into the id
property, I mean:

s:textfield
s:param name=idstockTotal_${house.id}/s:param
s:param name=namestockList[${house.id}].number/s:param
s:param name=value${house.number}/s:param
/s:textfield

   I generate several textfields like this one and I need to reference it in
javascript (that's because i need to set the id property). Using the param
tag doesn't work for the id, but goes right for the name and value
propertys.

   I tried several ways but none of them seems to work.

Any help would be appreciated.
-- 
View this message in context: 
http://www.nabble.com/Problem-setting-id-property-of-texfield-tag-tp15157521p15157521.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

Right now, I am forced to define a different namespace for each group of
actions with a different default stack.

Unlike the example discussed thus far, my action definitions don't specify
an interceptor.
The code posted is a little unique in that only this action uses the shown
set of interceptors.

So, this is what I do:
package x-name namespace X - default stack - actions
package y-name  namespace Y - different default stack - actions

I wish I did not have to define a different namespace just to be able to
define different default stacks.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15165239.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



dojo 1.0 DateTextBox and ISO-8601

2008-01-29 Thread Roberto Nunnari

Hi.

I have a form that posts to a ModelDriven Action.
In that form I'm trying to use raw dojo 1.0 DateTextBox, but I have
trouble with the formatting of the date.. According to the
dojo docs, when communicating to/from the server, it uses
ISO-8601.

As java.util.Date doesn't know how to parse ISO-8601
dates, I suppose I'll use a method on the action to parse,
but I'm interested to know how others have solved this
issue. Maybe with an interceptor?

as for formatting the date to initialize the dojo input, here
is the code I put in my jsp:

input type=text name=startDate dojoType=dijit.form.DateTextBox 
required=true value=s:date name=startDate format=-MM-dd / 
size=40//td


Best regards.

--
Robi


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: specdev2 [EMAIL PROTECTED]
 Right now, I am forced to define a different namespace 
 for each group of actions with a different default stack.


Well, yeah...


 I wish I did not have to define a different namespace just to be
 able to define different default stacks.


I'm not sure I know what having different default stacks would look like; 
that doesn't make sense to me.


How would you determine which default stack an action uses? How is that 
different from creating an interceptor stack and using that as the action's 
interceptor-ref.../ element?


It's not like you have to define each interceptor for each action; you can 
create a stack and use that.


Dave




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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: Dave Newton [EMAIL PROTECTED]
 It's not like you have to define each interceptor for each action;
 you can create a stack and use that.


(Or a combination of stacks and individual interceptors.)


Dave




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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

Just to clarify, the following works as desired:

action name=toHtml method=toHtml
class=com.tchegbe.demo.action.ToHtmlActions
interceptor-ref name=servletConfig/
interceptor-ref name=fileUpload/
interceptor-ref name=params/
interceptor-ref name=workflow/
result name=inputtoHtmlUtilityViewDef/result
/action

The action validate() method gets called properly by the Workflow
Interceptor.
http://struts.apache.org/2.x/docs/workflow-interceptor.html
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15163957.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



How does one get the validate method to be called?

2008-01-29 Thread specdev2

Hi,

My action is extending ActionSupport and overriding the validate method.
However, the validate method is not being called.

I have set the form tag validate attribute to true, but it makes no
difference.

What am I missing?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15160502.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread Dave Newton
From: specdev2 [EMAIL PROTECTED]
 I have to disagree with you on customizing the interceptors.
 It is just sloppy to use a generic stack that calls every interceptor.


I guess I'm just sloppy then.


I have a general-purpose interceptor stack that works quite well; I have *very* 
few actions that don't need every interceptor in it. I have more important 
things to do than obsess over interceptor stack definitions for a hundred (or 
whatever) actions, particularly when most would only differ by at most one or 
two interceptors.


 Important issues also get lost when you do that.


Apparently important issues also get lost when you don't.

 I really wish there was a way to group actions for the purpose
 of applying default stacks without being forced to define a 
 namespace or overriding the default stack of an existing namespace.


If you want your own default stack then overriding the default stack seems 
pretty natural to me.


Dave




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



browse old posts?

2008-01-29 Thread Mazhar, Osman (Home Office)
Hello,

 

Before I start asking questions, I wanted to know if there is a way to
browse existing posts to see if my questions have already been answered.

 

So, is there a way to look at old posts?

 

- Osman


__
This e-mail has been scanned by The Leukemia  Lymphoma Society Managed Email 
Content Service, provided by Verizon Business.

NOTICE: This message, including all attachments transmitted with it, is for the 
use of the addressee only. It may contain proprietary, confidential and/or 
legally privileged information. No confidentiality or privilege is waived or 
lost by any mistransmission. If you are not the intended recipient, you must 
not, directly or indirectly, use, disclose, distribute, print or copy any part 
of this message. If you believe you have received this message in error, please 
delete it and all copies of it from your system and notify the sender 
immediately by reply e-mail. Thank you.



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread niels

David,

I don't understand what you mean by anchor
imagine the next situation.

s:url id=url action=getCRUD
s:param name=id value=%{user.id} /
/s:url
s:a href=%{url}edit/s:a


Niels

On Jan 29, 2008, at 1:33 PM, David Tercero wrote:



target belongs to the anchor, not to the s:url tag.




niels-15 wrote:


Thanks David,

but according to the TLD target is not a valid attribute for tag url

Niels


On Jan 29, 2008, at 12:44 PM, David Tercero wrote:



Hi niels,

 you can generate a html anchor, using the s:url tag to generate
the href
url,

s:url ...  target=...some text

hope this helps.




niels-15 wrote:


There is no target attribute in de a-tag:
http://struts.apache.org/2.x/docs/a.html

I am a newbie, and want to open de link in another (specified)
browser
window..

How to overcome this?

Niels



--
View this message in context:
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15157668.html
Sent from the Struts - User mailing list archive at Nabble.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]





--
View this message in context: 
http://www.nabble.com/Where-did-the-target-attribute-go-in-the-a-tag--tp15156349p15158312.html
Sent from the Struts - User mailing list archive at Nabble.com.


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





Re: Struts 2.0.11 Validation and Conversion

2008-01-29 Thread Adam Hardy

Hi Filipe,

what is that regex that you are using in the annotations for setUnixGroupId()?

Is it required? It seems like unnecessary overhead for validating and converting 
a long. Have you tried it without it?


What is the reason for your own NullLongConverter? I guess it's because there is 
no out-of-the-box Struts LongConverter that handles null? (not had the need for 
it myself yet).


The second error seems to come from the parameter coming in as an array. Is 
there an obvious reason why, considering your HTML form?


Perhaps there are clues in the stacktraces.

Regards
Adam

Filipe David Manana on 28/01/08 15:48, wrote:

I am getting errors from Parameters Interceptor while it tries to set
a value for a property.

My JSP is:

 s:form theme=ajax method=post action=add_account
namespace=/lsf/accounts validate=true
s:textfield required=true label=Name name=account.name /
s:textfield label=UNIX GroupID name=account.unixGroupId /
s:submit value=Add onclick=this.form.submit(); /
 /s:form

The action is mapped to the method String add() of the following class:


@Validation
@Conversion
public class AccountAction extends BaseAction
{
   private Account account;
   private Long accountId;


   public void prepare() throws Exception
   {
  if ( accountId == null )
 account = new Account();
  else
 account = AccountManager.findById(accountId);
   }


   public String add() throws Exception
   {
  return SUCCESS;
   }


   public String update() throws Exception
   {
  return SUCCESS;
   }


   @VisitorFieldValidator(message = )
   public Account getAccount()
   {
  return account;
   }


   public void setAccount(Account account)
   {
  this.account = account;
   }


   public Long getAccountId()
   {
  return accountId;
   }

   public void setAccountId(Long accountId)
   {
  this.accountId = accountId;
   }


The definition of the Account class:


@Validation
@Conversion
public class Account
{
   private Long id;
   private String name;
   private Long unixGroupId;

   public Long getId()
   {
  return id;
   }

   public void setId(Long id)
   {
  this.id = id;
   }

   public String getName()
   {
  return name;
   }

   @RequiredStringValidator(message = Account name is required, trim = true)
   public void setName(String name)
   {
  this.name = name;
   }

   public long getUnixGroupId()
   {
  return unixGroupId;
   }

   @TypeConversion(converter = actions.NullLongConverter)
   @ConversionErrorFieldValidator(message = UNIX GroupID must be in
the range 0..65535)
   @RegexFieldValidator( message = UNIX GroupID must be in the range
0..65535, expression = ^\\s*(?:[0-9]{1,6})?\\s*$)
   public void setUnixGroupId(Long unixGroupId)
   {
  this.unixGroupId = unixGroupId;
   }
}

My validator:
public class NullLongConverter extends StrutsTypeConverter
{
   public Object convertFromString(Map context, String[] values, Class toClass)
   {
  Long val = null;

  if ( values != null  values[0] != null  !values[0].equals() )
  {
 try
 {
values[0].trim();
val = Long.parseLong(values[0]);
long v = val.longValue();
if ( v  0 || v  65535 ) val = null;
 }
 catch( Exception ex ) { }
  }
  return val;
   }

   public String convertToString(Map context, Object o)
   {
  if ( o == null ) return null;
  else return o.toString();
   }
}


My action is using the paramsPrepareParamsStack.
I get this exceptions from

[ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor 28
Jan 2008 16:37:50] ParametersInterceptor - [setParameters]: Unexpected
Exception caught setting 'account.unixGroupId' on 'class
actions.lsf.accounts.AccountAction: Error setting expression
'account.unixGroupId' with value '12'

[ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor 28
Jan 2008 16:37:51] ParametersInterceptor - [setParameters
]: Unexpected Exception caught setting 'account.unixGroupId' on 'class
actions.lsf.accounts.AccountAction: Error setting expression
'account.unixGroupId' with value'[Ljava.lang.String;@52f9b2'



Any ideia why this is not working?

By the way, I also tried not using custom conversions / validations,
that is, using the built in conversion mechanisms. I get similar
errors.



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



help with execAndWait

2008-01-29 Thread Mazhar, Osman (Home Office)
Hello,

 

I am trying to use the execAndWait interceptor. My struts.xml looks
like:

 

action name=foo method=input class=org.lls.classA

result name=inputfoo.jsp/result

/action

action name=foo_process method=processFoo class=org.lls.classA

interceptor-ref name=defaultStack/

interceptor-ref name=token/

!--

interceptor-ref name=execAndWait

param name=delay100/param

param name=delaySleepInterval50/param

/interceptor-ref

--   

result name=successfoo-success.jsp/result

result name=waitfoo-wait.jsp/result

result name=inputfoo.jsp/result

result name=invalid.tokenfoo.jsp/result

/action

 

Now in my action class, I have a bean with appropriate getter and setter
methods on it. The foo.jsp has a form which is mapped to attributes of
the bean in the action class. For example, s:textfield
name=myBean.name.../. The form tag looks like s:form
action=foo_process...

 

When I run the application with the given struts.xml above, myBean gets
populated properly in the processFoo method (I'm assuming the Parameter
interceptor does that).

 

However, when I uncomment and try to use the execAndWait interceptor,
for some reason, myBean comes out to be NULL in processFoo().

 

Any help will be appreciated.

 

- Osman

 


__
This e-mail has been scanned by The Leukemia  Lymphoma Society Managed Email 
Content Service, provided by Verizon Business.

NOTICE: This message, including all attachments transmitted with it, is for the 
use of the addressee only. It may contain proprietary, confidential and/or 
legally privileged information. No confidentiality or privilege is waived or 
lost by any mistransmission. If you are not the intended recipient, you must 
not, directly or indirectly, use, disclose, distribute, print or copy any part 
of this message. If you believe you have received this message in error, please 
delete it and all copies of it from your system and notify the sender 
immediately by reply e-mail. Thank you.



RE: [struts] help with execAndWait

2008-01-29 Thread Mazhar, Osman (Home Office)
That is an interesting point. The bean is a hibernate object, however, I
am not retrieving it from the database, but rather only trying to
populate it from the form values. 

So, it's a CREATE operation if you look at it from the CRUD perspective.

After reading on HibernateAndSpringEnabledExecuteAndWaitInterceptor,
what I understand is it would be necessary for objects being populated
from the database (using Hibernate obviously)

Unless I'm mistaken

-Original Message-
From: Dale Newfield [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 1:46 PM
To: Struts Users Mailing List
Subject: Re: [struts] help with execAndWait

Mazhar, Osman (Home Office) wrote:
 I am trying to use the execAndWait interceptor.

If this bean is retrieved from your DB, then it's likely the DB session 
is being closed.

http://wiki.opensymphony.com/display/WW/HibernateAndSpringEnabledExecute
AndWaitInterceptor

-Dale

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


__
This e-mail has been scanned by The Leukemia  Lymphoma Society Managed Email 
Content Service, provided by Verizon Business.

NOTICE: This message, including all attachments transmitted with it, is for the 
use of the addressee only. It may contain proprietary, confidential and/or 
legally privileged information. No confidentiality or privilege is waived or 
lost by any mistransmission. If you are not the intended recipient, you must 
not, directly or indirectly, use, disclose, distribute, print or copy any part 
of this message. If you believe you have received this message in error, please 
delete it and all copies of it from your system and notify the sender 
immediately by reply e-mail. Thank you.



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



Re: [struts] help with execAndWait

2008-01-29 Thread Dale Newfield

Mazhar, Osman (Home Office) wrote:

That is an interesting point. The bean is a hibernate object, however, I
am not retrieving it from the database, but rather only trying to
populate it from the form values.


You should be able to tell from the call stack which interceptors have 
been called--can you verify that parameters is included?


I don't know if including more than one interceptor-ref inside the 
action definition uses all of them (in what order?) or just the last 
one--I always define  the stacks I need separately and just refer to the 
appropriate one within my action definition...



So, it's a CREATE operation if you look at it from the CRUD perspective.

After reading on HibernateAndSpringEnabledExecuteAndWaitInterceptor,
what I understand is it would be necessary for objects being populated
from the database (using Hibernate obviously)


Does this created object contain any references to other DB objects?

-Dale

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



Re: [struts] help with execAndWait

2008-01-29 Thread Dale Newfield

Mazhar, Osman (Home Office) wrote:

I turned debug level logging for struts and xwork packages.
I see that the ParametersInterceptor is being called indeed for both
scenarios (with or without execAndWait)

However, one interesting thing is when I comment out the delay and
delaySleepInterval params from the execAndWait interceptor, I don't
get this problem.

Maybe this problem has to do with timing? Not sure but this is weird...


If you set those parameters in a stack definition, and then refer to 
that stack in the action, what happens?


-Dale

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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

So, as I was saying, I don't like having to define multiple namespaces just
to be able to define a default stack for a different group of actions.

In the last example, if I give package B a namespace, it will work with each
package having its own default stack.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15169391.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: How does one get the validate method to be called?

2008-01-29 Thread specdev2

When you specify a default stack for a package in which an action is part of,
you do not have to specify an interceptor or interceptor stack on the action
mapping.
This makes maintenance far easier.

In any case, I am referring to being able to do this:

package name=A extends=struts-default
   interceptors
interceptor-stack name=emptyStack
   interceptor-ref name=empty/
/interceptor-stack
interceptor-stack name=aGivenStack
   interceptor-ref name=something/
   interceptor-ref name=something2/
/interceptor-stack
/interceptors
default-interceptor-ref name=emptyStack/

action name=action class=my.package.AClass
resultaPage.jsp/result
/action
/package

package name=B extends=A
default-interceptor-ref name=aGivenStack/

action name=action class=my.package.BClass
resultaPage.jsp/result
/action
/package

The only thing preventing being able to do that, is that the default stack
defined in package B will override the default stack define in package A
because they have the same namespace.
-- 
View this message in context: 
http://www.nabble.com/How-does-one-get-the-%22validate%22-method-to-be-called--tp15160502p15169389.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: [struts] help with execAndWait

2008-01-29 Thread Mazhar, Osman (Home Office)
I turned debug level logging for struts and xwork packages.
I see that the ParametersInterceptor is being called indeed for both
scenarios (with or without execAndWait)

However, one interesting thing is when I comment out the delay and
delaySleepInterval params from the execAndWait interceptor, I don't
get this problem.

Maybe this problem has to do with timing? Not sure but this is weird...

-Original Message-
From: Dale Newfield [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 3:21 PM
To: Struts Users Mailing List
Subject: Re: [struts] help with execAndWait

Mazhar, Osman (Home Office) wrote:
 That is an interesting point. The bean is a hibernate object, however,
I
 am not retrieving it from the database, but rather only trying to
 populate it from the form values.

You should be able to tell from the call stack which interceptors have 
been called--can you verify that parameters is included?

I don't know if including more than one interceptor-ref inside the 
action definition uses all of them (in what order?) or just the last 
one--I always define  the stacks I need separately and just refer to the

appropriate one within my action definition...

 So, it's a CREATE operation if you look at it from the CRUD
perspective.
 
 After reading on HibernateAndSpringEnabledExecuteAndWaitInterceptor,
 what I understand is it would be necessary for objects being populated
 from the database (using Hibernate obviously)

Does this created object contain any references to other DB objects?

-Dale

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


__
This e-mail has been scanned by The Leukemia  Lymphoma Society Managed Email 
Content Service, provided by Verizon Business.

NOTICE: This message, including all attachments transmitted with it, is for the 
use of the addressee only. It may contain proprietary, confidential and/or 
legally privileged information. No confidentiality or privilege is waived or 
lost by any mistransmission. If you are not the intended recipient, you must 
not, directly or indirectly, use, disclose, distribute, print or copy any part 
of this message. If you believe you have received this message in error, please 
delete it and all copies of it from your system and notify the sender 
immediately by reply e-mail. Thank you.



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



Re: dojo 1.0 DateTextBox and ISO-8601

2008-01-29 Thread Jeromy Evans

Hi Roberto,

This is precisely what a custom type-converter is for:
http://struts.apache.org/2.x/docs/type-conversion.html

It accepts a string and converts to an object, and vice versa.  It's 
invoked by the conversion interceptor.


However, I thought the default Date converter is already setup to 
convert ISO-8601 strings to java.util.Date and vice versa.  You might 
get a nice surprise if you add a Date property to your model with the 
startDate name.  (The docs mention a locale-dependent date rather than 
ISO-8601 so I may be mistaken though).


Roberto Nunnari wrote:

Hi.

I have a form that posts to a ModelDriven Action.
In that form I'm trying to use raw dojo 1.0 DateTextBox, but I have
trouble with the formatting of the date.. According to the
dojo docs, when communicating to/from the server, it uses
ISO-8601.

As java.util.Date doesn't know how to parse ISO-8601
dates, I suppose I'll use a method on the action to parse,
but I'm interested to know how others have solved this
issue. Maybe with an interceptor?

as for formatting the date to initialize the dojo input, here
is the code I put in my jsp:

input type=text name=startDate dojoType=dijit.form.DateTextBox 
required=true value=s:date name=startDate format=-MM-dd 
/ size=40//td


Best regards.




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



Re: struts2 forms and css

2008-01-29 Thread Laurie Harper

xianwinwin wrote:

hi there,

I wonder how to change the font style of my form. Currently it is in a
simple 'Times New Roman' and I would like to have it differently (say
verdana).

the jsp page looks like this (below) and I wonder where the code should be
embedded? 



%@ include file=/pages/layouts/taglibs.jsp %
h2 class=menu id=titleAdd new Entity/h2
%@ include file=tabMenu.jsp %body class=section-1


s:form action=customize validate=true

s:textfield name=name label=Legal Name /
s:textarea rows=5 cols=25 name=comment2 label=Comment / 

s:submit action=customize_insert label=Insert align=center /
 	 
/s:form


Use CSS to describe the display characteristics (font, etc.) you want, 
and an 'id' or 'cssClass' attribute on the s:form tag to link to the CSS 
rules. Alternatively, use a 'cssStyle' attribute on the s:form tag to 
inline the CSS.


L.


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



Re: AJAX approach

2008-01-29 Thread Jeromy Evans




I would like to ask you if you know wheter YUI table lets me filter, 
order by column and paginate the table using AJAX (without refreshing 
the page) or doing it client-side. I couldn´t take a look to it yet. 
Sorry.


Yes, all that's possible on the client side with the YUI datatable. I 
use all the above features. 

They have some examples for client-side sorting, pagination and XHR.  
Filtering is performed by via the DataTable's RecordSet API

http://developer.yahoo.com/yui/examples/datatable/index.html

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



Re: struts2 forms and css

2008-01-29 Thread xianwinwin

thanks, this solved it

-- 
View this message in context: 
http://www.nabble.com/struts2-forms-and-css-tp15164776p15170582.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [struts] help with execAndWait

2008-01-29 Thread Dale Newfield

Mazhar, Osman (Home Office) wrote:

I am trying to use the execAndWait interceptor.


If this bean is retrieved from your DB, then it's likely the DB session 
is being closed.


http://wiki.opensymphony.com/display/WW/HibernateAndSpringEnabledExecuteAndWaitInterceptor

-Dale

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



Re: Where did the target attribute go in the a-tag?

2008-01-29 Thread niels

Thanks,

This works form me:
s:url id=url  action=getCRUD /
a href=s:property value='#url'/ target=_blank.../a

niels



On Jan 29, 2008, at 5:36 PM, Laurie Harper wrote:


niels wrote:

There is no target attribute in de a-tag:
http://struts.apache.org/2.x/docs/a.html


Correct, there isn't such an attribute. The Struts 2.0.9  
documentation for that tag lists a 'targets' attribute, but that's  
related to the Ajax theme and doesn't do what you're looking for.


I am a newbie, and want to open de link in another (specified)  
browser window..

How to overcome this?


Dave's solution (using a vanilla a tag) is the correct way to do  
this.


L.


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





#request scope

2008-01-29 Thread stanlick

I have a weird situation where I am losing a request parameter inside a loop! 
I understand the scopes and have trouble understanding how a #request scoped
variable could be masked inside a loop!  This outputs my value just fine:

s:property value=#request.model.parentId /

but once inside 

s:iterator value=notes

it no longer contains a value!

Any clues?  Aren't the loop vars scoped to page?

Scott
-- 
View this message in context: 
http://www.nabble.com/-request-scope-tp15171139p15171139.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Struts 2.1.1 and Tiles

2008-01-29 Thread Sanjeev Vijapurapu
Hi,

Has anybody tried using tiles2 with struts 2.1.1? I had a working app
with tiles2 and struts 2.0.9; but when I upgraded to 2.1.1 it just
stopped working.

Stack Trace is:

javax.servlet.jsp.JspException: Error executing tag: JSPException while
including path '/layouts/layout-template.jsp'. ServletException while
including page.

at
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurity
TagSupport.java:80)

at
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSup
port.java:80)

at
org.apache.jsp.security.login_jsp._jspx_meth_tiles_insertDefinition_0(or
g.apache.jsp.security.login_jsp:87)

at
org.apache.jsp.security.login_jsp._jspService(org.apache.jsp.security.lo
gin_jsp:57)

at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper

.java:373)

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:4

70)

at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487

)

at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet

Handler.java:1093)

 

Any pointers on how to resolve this?

 

Thanks



Re: #request scope

2008-01-29 Thread Dave Newton
--- stanlick [EMAIL PROTECTED] wrote:
 I have a weird situation where I am losing a request
 parameter inside a loop! 
 [...]
 s:property value=#request.model.parentId /

Doesn't #request retrieve request *attributes*?

Dave


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



html:text

2008-01-29 Thread Arora, Parvinder
A primitive question:

Can I hide the border which comes around html:text ?

~Parvinder


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



Re: html:text

2008-01-29 Thread Dave Newton
--- Arora, Parvinder [EMAIL PROTECTED] wrote:
 Can I hide the border which comes around html:text ?

CSS; see the styleClass attribute [1]. (It may differ slightly depending on
which version of S1 you're using; I honestly don't recall.)

Dave

[1] http://struts.apache.org/1.x/struts-taglib/tlddoc/html/text.html



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




Re: [S2] Iterator and Index

2008-01-29 Thread Dave Newton
--- bradharris [EMAIL PROTECTED] wrote:
 Any Response to this question?  I'm really hoping this wasn't left out of
 Struts2, but I can't seem to find anything indicating there is support for
 iterative form fields.  This is a pretty big piece to be missing, so
 feedback on the correct approach here would be appreciated.

There is [currently] no automagic support for indexed form fields.
Constructing the names, however, is pretty straight-forward. It's not really
that big of a piece IMO, but it is a minor irritation. File a JIRA if
you're concerned (I don't know if there is one already).

Dave


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



Re: [S2] Iterator and Index

2008-01-29 Thread bradharris

Any Response to this question?  I'm really hoping this wasn't left out of
Struts2, but I can't seem to find anything indicating there is support for
iterative form fields.  This is a pretty big piece to be missing, so
feedback on the correct approach here would be appreciated.

-- 
View this message in context: 
http://www.nabble.com/-S2--Iterator-and-Index-tp9946320p15171908.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Struts 2.1.1 and Tiles

2008-01-29 Thread Dave Newton
--- Sanjeev Vijapurapu [EMAIL PROTECTED] wrote:
 It's actually because of the standard taglib. I am using core taglib for
 some use case and if I remove that code it works fine. But what I am not
 able to understand is that why does struts2.0.9 works fine with it where
 as struts 2.1.1 doesnt

Without the JSP that you believe is causing the problem it will be much, much
harder to help you.

Dave


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



RE: Struts 2.1.1 and Tiles

2008-01-29 Thread Sanjeev Vijapurapu
It's actually because of the standard taglib. I am using core taglib for
some use case and if I remove that code it works fine. But what I am not
able to understand is that why does struts2.0.9 works fine with it where
as struts 2.1.1 doesnt

-Original Message-
From: Sanjeev Vijapurapu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 2:48 PM
To: user@struts.apache.org
Subject: Struts 2.1.1 and Tiles

Hi,

Has anybody tried using tiles2 with struts 2.1.1? I had a working app
with tiles2 and struts 2.0.9; but when I upgraded to 2.1.1 it just
stopped working.

Stack Trace is:

javax.servlet.jsp.JspException: Error executing tag: JSPException while
including path '/layouts/layout-template.jsp'. ServletException while
including page.

at
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurity
TagSupport.java:80)

at
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSup
port.java:80)

at
org.apache.jsp.security.login_jsp._jspx_meth_tiles_insertDefinition_0(or
g.apache.jsp.security.login_jsp:87)

at
org.apache.jsp.security.login_jsp._jspService(org.apache.jsp.security.lo
gin_jsp:57)

at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper

.java:373)

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:4

70)

at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487

)

at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet

Handler.java:1093)

 

Any pointers on how to resolve this?

 

Thanks


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



Re: [S2] Iterator and Index

2008-01-29 Thread Laurie Harper

Dave Newton wrote:

--- bradharris [EMAIL PROTECTED] wrote:

Any Response to this question?  I'm really hoping this wasn't left out of
Struts2, but I can't seem to find anything indicating there is support for
iterative form fields.  This is a pretty big piece to be missing, so
feedback on the correct approach here would be appreciated.


There is [currently] no automagic support for indexed form fields.
Constructing the names, however, is pretty straight-forward. It's not really
that big of a piece IMO, but it is a minor irritation. File a JIRA if
you're concerned (I don't know if there is one already).


To be clear, the part that is missing is automatically generating the 
names of the input fields appropriately. You can certainly still use 
collection-backed form fields, you just need a little extra coding in 
your JSP. Something like this:


s:textfield id=name[%{#stat.index}] name=firstname label=...

or

s:textfield name=names[%{#stat.index}].firstname label=...

(I'm not sure off the top of my head which is right, but it'll be 
something along those lines...)


L.


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



Re: [S2] Starter application in IE Firefox

2008-01-29 Thread hezjing
Hi

OK, the same problem occured even before the dependencies are modified.
The following are the steps I performed,

1) Create the starter application
 mvn archetype:create
-DgroupId=com.fdar.apress.s2
-DartifactId=app
-DarchetypeGroupId=org.apache.struts
-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=2.0.9-SNAPSHOT
-DremoteRepositories=http://people.apache.org/maven-snapshot-repository

2) Run the starter application
 mvn jetty:run

3) Open Firefox and goto http://localhost:8080/app

4) Open IE 6.0 and goto http://localhost:8080/app


The menu is displayed on top of the page in Firefox, but NOT in the IE 6.0.
Can you reproduce the same problem?


On 1/29/08, Laurie Harper [EMAIL PROTECTED] wrote:
 hezjing wrote:
  Hi
 
  I created Struts2 starter application as shown below,
 
 mvn archetype:create
 -DgroupId=com.fdar.apress.s2
 -DartifactId=app
 -DarchetypeGroupId=org.apache.struts
 -DarchetypeArtifactId=struts2-archetype-starter
 -DarchetypeVersion=2.0.9-SNAPSHOT
 -DremoteRepositories=http://people.apache.org/maven-snapshot-repository
 
  then, I modified pom.xml and changed the dependencies to JUnit 4.4 and
  Struts 2.0.11.
 
  When loaded the application in Firefox, I can see the menu bar (Menu
  1, Menu 2 and etc) displayed on the top.
 
  When loaded the application in IE 6.0, the same menu bar is missing!
 
  Do you what could be the problem?

 Did everything work before you updated the dependencies? If so, did you
 check the release notes for 2.0.11 [1] to see if any changes may be
 needed in the starter app code?

 L.

 [1] http://struts.apache.org/2.0.11/docs/release-notes-2011.html


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




-- 

Hez

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



s:if test with empty String

2008-01-29 Thread quinquin2209

Hi All,

I have an array of String members... where member[0] is the member id and
member[1] is the member's name.

In the jsp, I want to display member[1] if it is not empty, or member[0] if
member[1] is empty.

s:if test=%{members[#status.index][1]} == '' 
s:property value=%{distinctIssuePartyId[#status.index][0]}/ 

/s:if
s:else
s:property value=%{distinctIssuePartyId[#status.index][1]}/
/s:else

However, the else logic is executed no matter member[1] is empty or not.

How can I test with empty string?

Thanks in advance

Queenie
-- 
View this message in context: 
http://www.nabble.com/s%3Aif-test-with-empty-String-tp15174836p15174836.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: #request scope

2008-01-29 Thread WongTseng
in S2, inside iteration, the item object is push onto the VS, so just
remove the pound key.


-- 
Best Regards
Wong Tseng

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



Re: struts1 and struts2 together

2008-01-29 Thread nagendrabvvs

Hi Frank,
Could i ask you a favour?

As i am also trying to migrate our project to struts2 from struts1.1.
I am in need of help regarding this. 
can i use both struts1 and struts2 together?

So hope you have got knowledge in this, and as iam new to struts2, If
possible could you please give me some important points to do migration for
my existing project. 

Any help regarding this is most appreciable,
Thanks a lot in advance,
Nagendra
-- 
View this message in context: 
http://www.nabble.com/struts1-and-struts2-together-tp15035931p15175909.html
Sent from the Struts - User mailing list archive at Nabble.com.


Re: #request scope

2008-01-29 Thread Dave Newton
--- WongTseng [EMAIL PROTECTED] wrote:
 in S2, inside iteration, the item object is push onto the VS, so just
 remove the pound key.

Accessing a request attribute, however, still requires the # because it's a
named value on the stack, not simply a pushed action or the current object of
an iterator.

Dave


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



AW: struts1 and struts2 together

2008-01-29 Thread Otto, Frank
hi nagendra,

yes, you can use struts1 and struts2 together. take a look at:

http://www.infoq.com/articles/converting-struts-2-part1

it's a good tutorial to migrate a app to struts2.

kind regards,

frank

 -Ursprüngliche Nachricht-
 Von: nagendrabvvs [mailto:[EMAIL PROTECTED]
 Gesendet: Mittwoch, 30. Januar 2008 06:46
 An: user@struts.apache.org
 Betreff: Re: struts1 and struts2 together
 
 
 
 Hi Frank,
 Could i ask you a favour?
 
 As i am also trying to migrate our project to struts2 from 
 struts1.1.
 I am in need of help regarding this. 
 can i use both struts1 and struts2 together?
 
 So hope you have got knowledge in this, and as iam new to struts2, If
 possible could you please give me some important points to do 
 migration for
 my existing project. 
 
 Any help regarding this is most appreciable,
 Thanks a lot in advance,
 Nagendra
 -- 
 View this message in context: 
 http://www.nabble.com/struts1-and-struts2-together-tp15035931p
15175909.html
Sent from the Struts - User mailing list archive at Nabble.com.


Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Johnson nickel

Thanks for your quick response,

 In my Login.jsp,
  s:textfield name=username label=UserName /
  s:password name=spassword label=Password /
  input type=image src=../images/Login.gif value=Login

Instead of using s:submit value=Login/, I used html  image tag .
 If i used s:submit it works fine. 





newton.dave wrote:
 
 --- Johnson nickel [EMAIL PROTECTED] wrote:

 @RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName=username,message=UserName
 is required)
 
 For a string field you'll probably want to use the
 @RequiredStringValidator:
 a text field will return an empty string, whereas @RequiredFieldValidator
 only checks for null-ness (different from blank-ness).
 
 Same as For password also ,
 
 *Exactly* the same? (You put the right fieldName for the password field,
 right?)
 
 When i have submit the Login button, the Error messages is displaying
 Repeated.
 
 You'll need to provide some JSP and possibly configuration in order to
 help
 diagnose the problem.
 
 Where are the duplicated messages appearing?
 
 Dave
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Error-messages-is-repeated-Using-Struts-2-Annotation-validation-tp15157319p15176802.html
Sent from the Struts - User mailing list archive at Nabble.com.


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