Re: I need generic html table structure with theme ajax in struts 2

2008-08-29 Thread MyAshok

Hi Harper,

Thanks for ur quick reply.

Is there any other possibilities or any plugins to make this possible.
Because, I dont want to make ajax theme obselete by extending it by my code.

Applause for the solution,

With Hope,
Ashok.





Laurie Harper wrote:
> 
> MyAshok wrote:
>> Hi all,
>> 
>> Again thanks for ur past replies.
>> 
>> Now, I am in a new issue.
>> 
>> I need to use the ajax theme for two buttons (s:button id=A and s:button
>> id
>> =B). But, as default, each s: tag will create a tr and td tags. I dont
>> want
>> this type of table structure(row by row). I want to customize table
>> structure as that of generic html table.
> 
> You'll need to customize the templates for the 'ajax' theme, or create 
> your own theme based on / extending the 'ajax' theme, to define the 
> markup you want to generate. See here for details:
> 
> http://struts.apache.org/2.0.11.1/docs/themes-and-templates.html
> 
> L.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/I-need-generic-html-table-structure-with-theme-ajax-in-struts-2-tp19202580p19215585.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: Result Annotations

2008-08-29 Thread mujoko mujoko
Annotation Result is a part of of configuration (struts config) that read on
start up and load on startup, I dont think you can use dinamic
value on annotation.

Mujoko


On 8/29/08, rakeshxp <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I am using Result annotations in the following manner ( static way )
> @Results({
> @Result(name = "index", value = "/jsp/en_US/help.jsp")
> })
>
> How can I pass a dynamic value to the result annotation, so that I can
> achieve something like this
> @Results({
> @Result(name = "index", value = "/jsp/${locale}/help.jsp"),
> @Result(name = "show", value = "${show}" )
> })
> public class HelpController {
> private String locale;
> private String show;
> ...
> }
>
> Thanks!
>
> --
> View this message in context:
> http://www.nabble.com/Result-Annotations-tp19214472p19214472.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]
>
>


-- 
Mujoko


[OT] Web app confirm changes

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

Hi!

I have a question nothing to do with struts2, but with web apps design 
and I would be gratefull if you could help me with this problem:


Well, in my app there are some forms. Imagine you click an item to edit 
its configuration. Then, the edition form appears. Then, you change some 
value and click another link (another item, for instance), but *you did 
not submit your changes*. I would like to tell the user that there are 
unsaved changes and if he want to continue or cancel the navigation to 
keep in the form, so he can now submit it. I could do it with a global 
javascript variable "sthChanged", but I would have to modify *each* 
 element to add it an onchange event to set sthChanged=true when 
changes. And, besides that, I would have to modify each link to check 
that variable and execute a confirm javascript dialog if it is true and 
so on...


Is there a better aproximation for this problem? Do you know any 
websites where exist this use case?


Thank you.

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



ServletActionRedirectResult and request params

2008-08-29 Thread Lukasz Lenart
Hi,

I'm trying to pass request params to an action when redirecting, but
I'm getting OgnlException with messages:

   1. org.apache.struts2.dispatcher.ServletActionRedirectResult.employeeId
   2. Caught OgnlException while setting property 'employeeId' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
   3. ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.employeeId


I've followed the API docs [1] and made such configuration:



edit
/employees
-1

list


Any suggestion?


[1] http://struts.apache.org/2.1.2/struts2-core/apidocs/index.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



RE: Re: Ampersand sign problem

2008-08-29 Thread Nayyer Kamran
Hello,

Thanks for your answer. You are right that's what happening. On submission 
input text sterling sign "£" escaped to the "ISO-8859-1" "£" and when try 
to display it again in the same html:text box it escape it again. So how can I 
avoid it what should I do. UTF8 work fine but it put some other constraint like 
database encoding. 

I attached the code: JSP, action class, form class, and Struts config.


I did not find any attribute "escape" in struts user guide can you give me some 
example. I am using struts 1.2.9. 

Thanks for your help.

Regards, 


-Original Message-
From: Laurie Harper [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 28, 2008 7:35 PM
To: user@struts.apache.org
Subject: Re: Ampersand sign problem

Can you post a code sample of what you are doing? html:text will only 
escape its output once, so perhaps you are passing it a string that has 
already been converted into the character entity form (£)?

You could try escape="false", but I'd suggest understanding what's going 
on first so you're confident that you aren't opening up 
cross-site-scripting or other Javascript injection vulnerabilities by 
doing so.

L.

Nayyer Kamran wrote:
> Hello,
> 
>  
> 
> I am trying to use "ISO-8859-1" char set in my web application. But when I 
> try to display "?" sign using html:text field it displays "£". If I look 
> at the HTML source there I see that "&" is escaped by the character entity 
> "&" so now instead of "£" the value is "£" .  Where as if I 
> use simple input field to display this value it work fine. 
> 
>  
> 
> I believe this is because html:text tag escaping "&" sign.  How I can avoid 
> this multiple escaping.
> 
>  
> 
> I am using jbossAS 4.0.5, Struts 1.2.9.
> 
>  
> 
> Any help will be appreciated. 
> 
>  
> 
> Regards, 
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 
> ***
> This email and any files transmitted with it are intended solely for the use 
> of the individual or entity to whom they are addressed, and may contain 
> confidential and/or proprietary information. Therefore, any dissemination, 
> distribution or copy of this email or such attached files, or the information 
> contained herein and therein, should be appropriately restricted. 
>  
> If you have received this email in error please notify the sender immediately 
> by return email and kindly delete this message and all attachments..
> ***
> 
> 
> 



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



















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

Re: Result Annotations

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, rakeshxp wrote:
> I am using Result annotations in the following manner (static way )
> @Results({
> @Result(name = "index", value =
> "/jsp/en_US/help.jsp")
> })
> 
> How can I pass a dynamic value to the result annotation, so
> that I can achieve something like this 
>
> @Results({
> @Result(name = "index", value = "/jsp/${locale}/help.jsp"),
> @Result(name = "show", value = "${show}" )
> })
> public class HelpController {
> private String locale;
> private String show;
> ...
> }

By either (a) providing getLocale()/getShow() methods or making locale/show 
public.

The other response saying it wasn't possible is incorrect; while it's true that 
the annotations are scanned on startup, the value is evaluated at runtime. See 
[1] for more information; annotations share the same ability.

Dave

[1] Parameters in configuration results
http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html


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



Re: Result Annotations

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, mujoko mujoko wrote:
> Annotation Result is a part of of configuration (struts
> config) that read on start up and load on startup, I dont 
> think you can use dinamic value on annotation.

XML configuration files are also loaded on startup. The basic result 
configuration page [1] has a section on how to create dynamic results; the same 
applies for annotations.

Dave

[1] Result configuration
http://struts.apache.org/2.x/docs/result-configuration.html


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



Re: [OT] Web app confirm changes

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, Pablo Vázquez Blázquez wrote:
> I could do it with a global javascript variable "sthChanged", 
> but I would have to modify *each*  element to add it an 
> onchange event to set sthChanged=true when changes.

One-liner of JavaScript to add an onchange handler to all input elements (or 
all input elements of a specific class) to change the variable. Another line to 
add an onclick to all links on a page to have them call a method to see if 
anything had changed.

At least if you're using a half-way decent JavaScript library. I'd focus your 
efforts on JavaScript/DOM related lists or groups.

Dave


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



Re: ServletActionRedirectResult and request params

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, Lukasz Lenart wrote:
> I'm trying to pass request params to an action when
> redirecting, but I'm getting OgnlException with messages:
> 
>1.
> org.apache.struts2.dispatcher.ServletActionRedirectResult.employeeId
>2. Caught OgnlException while setting property
> 'employeeId' on type
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
>3. ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.employeeId
> 
> 
> I've followed the API docs [1] and made such configuration:
> 
> 
> 
> edit
> /employees
> -1
> 
> list
> 
> 
> Any suggestion?

This is old, known behavior. Does it still work?

(What do the Javadocs have to do with this?)

See JIRA issues [1,2].

Dave

[1] https://issues.apache.org/struts/browse/WW-1714
[2] https://issues.apache.org/struts/browse/WW-2600


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



Re: Result Annotations

2008-08-29 Thread rakeshxp

Awesome. This worked!

Thanks!


newton.dave wrote:
> 
> --- On Fri, 8/29/08, rakeshxp wrote:
>> I am using Result annotations in the following manner (static way )
>> @Results({
>> @Result(name = "index", value =
>> "/jsp/en_US/help.jsp")
>> })
>> 
>> How can I pass a dynamic value to the result annotation, so
>> that I can achieve something like this 
>>
>> @Results({
>> @Result(name = "index", value = "/jsp/${locale}/help.jsp"),
>> @Result(name = "show", value = "${show}" )
>> })
>> public class HelpController {
>> private String locale;
>> private String show;
>> ...
>> }
> 
> By either (a) providing getLocale()/getShow() methods or making
> locale/show public.
> 
> The other response saying it wasn't possible is incorrect; while it's true
> that the annotations are scanned on startup, the value is evaluated at
> runtime. See [1] for more information; annotations share the same ability.
> 
> Dave
> 
> [1] Parameters in configuration results
> http://struts.apache.org/2.x/docs/parameters-in-configuration-results.html
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Result-Annotations-tp19214472p19220361.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: Ampersand sign problem

2008-08-29 Thread Nayyer Kamran
Hello,

 

Thanks for your information I think the struts.properties file is Struts2 
feature. Is there any other way to set this property in sturts.

 

Regards, s

 

 

 



From: Gareth Davies [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 29, 2008 12:52 PM
To: Nayyer Kamran
Subject: FW: Ampersand sign problem

 

FYI





From: [EMAIL PROTECTED]
To: user@struts.apache.org
Subject: RE: RE: Re: Ampersand sign problem
Date: Fri, 29 Aug 2008 11:50:02 +

Try using this in your struts.properties file:
 
struts.i18n.encoding=ISO-8859-1 
 
cheers
 
G
 



From: Nayyer Kamran [mailto:[EMAIL PROTECTED]
Sent: Fri 8/29/2008 12:24
To: Laurie Harper
Cc: user@struts.apache.org
Subject: RE: Re: Ampersand sign problem



Hello,

Thanks for your answer. You are right that's what happening. On submission 
input text sterling sign "Ј" escaped to the "ISO-8859-1" "£" and when try 
to display it again in the same html:text box it escape it again. So how can I 
avoid it what should I do. UTF8 work fine but it put some other constraint like 
database encoding.

I attached the code: JSP, action class, form class, and Struts config.


I did not find any attribute "escape" in struts user guide can you give me some 
example. I am using struts 1.2.9.

Thanks for your help.

Regards,


-Original Message-
From: Laurie Harper [mailto:[EMAIL PROTECTED]  ]
Sent: Thursday, August 28, 2008 7:35 PM
To: user@struts.apache.org
Subject: Re: Ampersand sign problem

Can you post a code sample of what you are doing? html:text will only
escape its output once, so perhaps you are passing it a string that has
already been converted into the character entity form (£)?

You could try escape="false", but I'd suggest understanding what's going
on first so you're confident that you aren't opening up
cross-site-scripting or other Javascript injection vulnerabilities by
doing so.

L.

Nayyer Kamran wrote:
> Hello,
>
> 
>
> I am trying to use "ISO-8859-1" char set in my web application. But when I 
> try to display "?" sign using html:text field it displays "£". If I look 
> at the HTML source there I see that "&" is escaped by the character entity 
> "&" so now instead of "£" the value is "£" .  Where as if I 
> use simple input field to display this value it work fine.
>
> 
>
> I believe this is because html:text tag escaping "&" sign.  How I can avoid 
> this multiple escaping.
>
> 
>
> I am using jbossAS 4.0.5, Struts 1.2.9.
>
> 
>
> Any help will be appreciated.
>
> 
>
> Regards,
>
> 
>
> 
>
> 
>
> 
>
>
> ***
> This email and any files transmitted with it are intended solely for the use 
> of the individual or entity to whom they are addressed, and may contain 
> confidential and/or proprietary information. Therefore, any dissemination, 
> distribution or copy of this email or such attached files, or the information 
> contained herein and therein, should be appropriately restricted.
> 
> If you have received this email in error please notify the sender immediately 
> by return email and kindly delete this message and all attachments..
> ***
>
>
>



- --
ML {UFI} 

 



Make a mini you on Windows Live Messenger! Try it Now! 
  



Make a mini you on Windows Live Messenger! Try it Now! 
 



uploadInterceptor - maximumSize ignored!?

2008-08-29 Thread Dario Novakovic
Hello,

I created a file upload action and I need to uplaod big files


104857600

/input.jsp
/upload.jsp


but for some reason, i allways get message that the file is to big if it is 
bigger than 2MB. I did a bit of debugging and it showed that 
FileInterceptor#maximumSize property is correctly set but

if (multiWrapper.hasErrors())

returns true even before maximumSize property is checked.


I guess I have 2 fileUpload interceptors, default one where maximumSize is not 
overriden and mine. Can anyone explain what is going one and how to configure 
my action.


Thanks!


  

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



RE: Ampersand sign problem

2008-08-29 Thread Martin Gainty

hi gareth-

you can config as an entry in struts.xml
http://struts.apache.org/2.x/docs/configuration-files.html
e.g.


is this what you're looking for?
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Subject: RE: Ampersand sign problem
> Date: Fri, 29 Aug 2008 15:07:55 +0100
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: user@struts.apache.org
> 
> Hello,
> 
>  
> 
> Thanks for your information I think the struts.properties file is Struts2 
> feature. Is there any other way to set this property in sturts.
> 
>  
> 
> Regards, s
> 
>  
> 
>  
> 
>  
> 
> 
> 
> From: Gareth Davies [mailto:[EMAIL PROTECTED] 
> Sent: Friday, August 29, 2008 12:52 PM
> To: Nayyer Kamran
> Subject: FW: Ampersand sign problem
> 
>  
> 
> FYI
> 
> 
> 
> 
> 
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: RE: RE: Re: Ampersand sign problem
> Date: Fri, 29 Aug 2008 11:50:02 +
> 
> Try using this in your struts.properties file:
>  
> struts.i18n.encoding=ISO-8859-1 
>  
> cheers
>  
> G
>  
> 
> 
> 
> From: Nayyer Kamran [mailto:[EMAIL PROTECTED]
> Sent: Fri 8/29/2008 12:24
> To: Laurie Harper
> Cc: user@struts.apache.org
> Subject: RE: Re: Ampersand sign problem
> 
> 
> 
> Hello,
> 
> Thanks for your answer. You are right that's what happening. On submission 
> input text sterling sign "Ј" escaped to the "ISO-8859-1" "£" and when 
> try to display it again in the same html:text box it escape it again. So how 
> can I avoid it what should I do. UTF8 work fine but it put some other 
> constraint like database encoding.
> 
> I attached the code: JSP, action class, form class, and Struts config.
> 
> 
> I did not find any attribute "escape" in struts user guide can you give me 
> some example. I am using struts 1.2.9.
> 
> Thanks for your help.
> 
> Regards,
> 
> 
> -Original Message-
> From: Laurie Harper [mailto:[EMAIL PROTECTED]  ]
> Sent: Thursday, August 28, 2008 7:35 PM
> To: user@struts.apache.org
> Subject: Re: Ampersand sign problem
> 
> Can you post a code sample of what you are doing? html:text will only
> escape its output once, so perhaps you are passing it a string that has
> already been converted into the character entity form (£)?
> 
> You could try escape="false", but I'd suggest understanding what's going
> on first so you're confident that you aren't opening up
> cross-site-scripting or other Javascript injection vulnerabilities by
> doing so.
> 
> L.
> 
> Nayyer Kamran wrote:
> > Hello,
> >
> > 
> >
> > I am trying to use "ISO-8859-1" char set in my web application. But when I 
> > try to display "?" sign using html:text field it displays "£". If I 
> > look at the HTML source there I see that "&" is escaped by the character 
> > entity "&" so now instead of "£" the value is "£" .  
> > Where as if I use simple input field to display this value it work fine.
> >
> > 
> >
> > I believe this is because html:text tag escaping "&" sign.  How I can avoid 
> > this multiple escaping.
> >
> > 
> >
> > I am using jbossAS 4.0.5, Struts 1.2.9.
> >
> > 
> >
> > Any help will be appreciated.
> >
> > 
> >
> > Regards,
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> >
> > ***
> > This email and any files transmitted with it are intended solely for the 
> > use of the individual or entity to whom they are addressed, and may contain 
> > confidential and/or proprietary information. Therefore, any dissemination, 
> > distribution or copy of this email or such attached files, or the 
> > information contained herein and therein, should be appropriately 
> > restricted.
> > 
> > If you have received this email in error please notify the sender 
> > immediately by return email and kindly delete this message and all 
> > attachments..
> > ***
> >
> >
> >
> 
> 
> 
> - --
> ML {UFI} 
> 
>  
> 
> 
> 
> Make a mini you on Windows Live Messenger! Try it Now! 
>   
> 
> 
> 
> Make a mini you on Windows Live Messenger! Try it Now! 
>  
> 

_
Get ideas on sharing photos from people like you.  Find new ways to share.
http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008

Re: uploadInterceptor - maximumSize ignored!?

2008-08-29 Thread Dave Newton
Many app servers also have a file upload size limit. For example, IIRC Tomcat 
has a 2M limit by default. [1] may also assist.

Dave

[1] http://struts.apache.org/2.x/docs/file-upload.html

--- On Fri, 8/29/08, Dario Novakovic <[EMAIL PROTECTED]> wrote:

> From: Dario Novakovic <[EMAIL PROTECTED]>
> Subject: uploadInterceptor - maximumSize ignored!?
> To: user@struts.apache.org
> Date: Friday, August 29, 2008, 10:29 AM
> Hello,
> 
> I created a file upload action and I need to uplaod big
> files
> 
>  class="action.UploadAction"
> method="doUpload">
>  name="fileUpload">104857600
>  name="basicStack"/>
>  name="input">/input.jsp
> /upload.jsp
> 
> 
> but for some reason, i allways get message that the file is
> to big if it is bigger than 2MB. I did a bit of debugging
> and it showed that FileInterceptor#maximumSize property is
> correctly set but
> 
> if (multiWrapper.hasErrors())
> 
> returns true even before maximumSize property is checked.
> 
> 
> I guess I have 2 fileUpload interceptors, default one where
> maximumSize is not overriden and mine. Can anyone explain
> what is going one and how to configure my action.
> 
> 
> Thanks!
> 
> 
>   
> 
> -
> 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: There is no Action mapped for namespace / and action name ...

2008-08-29 Thread Stephan Schröder

having the same problem:
i use Struts2.0.11.2. and tomcat 6.0.16.
On my Windows desktop everything works fine. I exported the project as war
and imported it on my Linux laptop (so i can work a little bit in my
hollidays). 
But on the Linux laptop i only get a
"There is no Action mapped for action name index.".
My xml-files are UTF-8 coded on both machines so i have no idea where the
problem is rooted in.
I'm using JRE1.6.0_07 on both machines, setting the compliance level to 1.5
didn't change anything. The tomcat startup shows no problems either.

What libraries did you change?

/Stephan


John Moose wrote:
> 
> re-ordered the libraries and builders, forced JDK compiler compliance to
> 5.0
> ( definitely *not* 6.0 !!) in Eclipse and voila...runs great.  never
> *really* thought it was a Struts2 problem  ; )
> 
> On Tue, Jul 29, 2008 at 9:26 AM, John Moose <[EMAIL PROTECTED]> wrote:
> 
>> A very wierd situation...I have two projects in the Eclipse workspace --
>> Tagging and Dashbd  They both use the REST plugin and follow the naming
>> conventions, etc. Tagging will build, re-deploy and run perfectly. When I
>> close that project and open Dashbd, build, re-deploy and run I get the
>> Action mapping failure as described. Both projects have source files in
>> the
>> "com.myeclipse.ozone" package name(space). Is it possible that there is
>> some
>> very persistent caching going on ??? like over multiple starts and
>> re-starts
>> of Tomcat?  just a WAG...
>>
>> -John
>>
>>
>> On Tue, Jul 29, 2008 at 5:08 AM, Pauli Savolainen <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>> I am having exactly the same problem. I was using Struts 2.1.1,
>>> switched to struts 2.1.2 (including the restful and codebehind
>>> plugins) and started to get this 'no action found' error. I am quite
>>> confident that I did not do anything that should've resulted in this.
>>> Of course I cannot be 100% sure, because I did goof around with my
>>> code a bit, but I checked and rechecked and rerechecked everthing
>>> twice and couldn't find a reason for this behaviour.
>>>
>>> John's web.xml and the stacktrace are identical to mine. I don't
>>> declare any namespaces in my struts.xml packages nor in the login form
>>> from which I try to invoke the login action >> action="/login/execute" method="post">. (Also tried with an
>>> exclamation mark i.e. login!execute) I have a LoginAction.java with an
>>> execute method in the pacakge defined in the web.xml's actionPackages
>>> init parameter. At least this declaration used to send the control to
>>> the LoginAction's execute method. Doesn't do anymore.
>>>
>>> I am using the struts 2.1.2 tiles plugin as well. On my index.jsp I
>>> include a tiles main layout which in turn includes sub-layouts (such
>>> as the login form). I don't know if this has anything got to do with
>>> the problem I'm having.
>>>
>>> So, is a result of something I did wrong or could it be something else?
>>>
>>> Thank you
>>>
>>> Pauli Savolainen
>>>
>>> 2008/7/28 Paul Benedict <[EMAIL PROTECTED]>:
>>> > What's the correct way of writing a good 404 or action not found page?
>>> Does
>>> > s2 have something like a fallback action if nothing can be found?
>>> >
>>> > Paul
>>> >
>>> > On Mon, Jul 28, 2008 at 4:04 PM, Dave Newton <[EMAIL PROTECTED]>
>>> wrote:
>>> >
>>> >> Hmm, I wonder if it was the same issue I was having with 2.1.3 a week
>>> or so
>>> >> ago that I haven't had time to re-visit--so it actually could be the
>>> web.xml
>>> >> (specifically the dispatcher being used) and I may have put my foot
>>> in
>>> my
>>> >> mouth (again).
>>> >>
>>> >> Somebody followed up saying the original FilterDispatcher worked,
>>> though,
>>> >> so maybe not. Hrm.
>>> >>
>>> >> Dave
>>> >>
>>> >> --- On Mon, 7/28/08, John Moose <[EMAIL PROTECTED]> wrote:
>>> >> > and I probably should have included this as well:
>>> >> >
>>> >> > Struts Problem Report
>>> >> >
>>> >> > Struts has detected an unhandled exception:
>>> >> >   *Messages*:
>>> >> > There is no Action mapped for namespace / and action name
>>> >> > dashbd.
>>> >> >  --
>>> >> > Stacktraces *There is no Action mapped for namespace / and
>>> >> > action name
>>> >> > dashbd. - [unknown location]*
>>> >> >
>>> >> >
>>> >> >
>>> >>
>>> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
>>> >> >
>>> >> >
>>> >>
>>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:59)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.rest.RestActionProxyFactory.createActionProxy(RestActionProxyFactory.java:40)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:439)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
>>> >> >
>>> >> >
>>> >>
>>> org.apa

[S2] Problem with list of submit buttons

2008-08-29 Thread Ylva Degerfeldt
Hi everyone,

I have a List of POJOs that I've created, and for every POJO in the
list I'm displaying some UI components corresponding to the properties
of the POJO (textfields and select fields et.c.). I also have some
submit buttons that belong to each row (and indirectly to each POJO),
like "Edit", "Save" and "Remove" buttons. My corresponding Action has
a property for the List and it receives its values the way it should.

My problem is that I need some way to tell the Action which of the
buttons that had been pushed (which one of the "Edit" buttons for
instance), and I don't know how to do that. To be more exact, I'd like
some way to return the #state.index of that iteration/row when a
specific button has been pushed.

I'm also using the "method" tag for calling different methods on the
Action depending on which of the three buttons that was pushed, so
that's not a problem.

I've tried to find more information about the s:submit but I didn't
find anything in "Struts 2 in Action" and the Struts 2 API docs aren't
explaining much either.

I've tried using the "name" and "value" attributes like for other UI
components, like:



but that only caused the index value to be the caption of the button.
So it looks like "value" means something else for submit components
than for other UI components. (It turns into the caption, If a "value"
is specified..)

I've also checked the parameter names I receive from the action, but
apart from the different properties of the List I only receive
"method: Edit" (when an "Edit" button has been pressed). Though I
recall that when not using Struts you could receive the name of the
button as a request parameter, so how do I do that with Struts 2 - and
connect a value to it?

Maybe I could use the "onclick" attribute of s:submit but I don't know
the syntax for sending a value to the Action there. (Isn't that
javascript?)

Can somebody please help me with this?

Thanks in advance!

/Ylva

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



Re: [S2] Problem with list of submit buttons

2008-08-29 Thread James Neff

Ylva Degerfeldt wrote:

Hi everyone,
...

Maybe I could use the "onclick" attribute of s:submit but I don't know
the syntax for sending a value to the Action there. (Isn't that
javascript?)

Can somebody please help me with this?

Thanks in advance!

/Ylva


  

Are you asking on how to get different buttons to do different actions?

If so, then here is what I did:

My JSP:











In the  section:


 function myJavaScriptMethod() {

 document.myForm.action = "/myProject/NewAction.action";

 document.myForm.submit();

 }



And that is how I programmatically set different actions from javascript.

Is there a better way?

--James





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



Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Jim Kiley
If each of the buttons is a Submit button, and you have each row of the
table wrapped in a separate form, you can put a  within each form,
and store/provide the ID of the row within it.

jk

On Fri, Aug 29, 2008 at 11:22 AM, Ylva Degerfeldt <[EMAIL PROTECTED]
> wrote:

> Hi everyone,
>
> I have a List of POJOs that I've created, and for every POJO in the
> list I'm displaying some UI components corresponding to the properties
> of the POJO (textfields and select fields et.c.). I also have some
> submit buttons that belong to each row (and indirectly to each POJO),
> like "Edit", "Save" and "Remove" buttons. My corresponding Action has
> a property for the List and it receives its values the way it should.
>
> My problem is that I need some way to tell the Action which of the
> buttons that had been pushed (which one of the "Edit" buttons for
> instance), and I don't know how to do that. To be more exact, I'd like
> some way to return the #state.index of that iteration/row when a
> specific button has been pushed.
>
> I'm also using the "method" tag for calling different methods on the
> Action depending on which of the three buttons that was pushed, so
> that's not a problem.
>
> I've tried to find more information about the s:submit but I didn't
> find anything in "Struts 2 in Action" and the Struts 2 API docs aren't
> explaining much either.
>
> I've tried using the "name" and "value" attributes like for other UI
> components, like:
>
>  "caption.editbutton" method = "Edit"/>
>
> but that only caused the index value to be the caption of the button.
> So it looks like "value" means something else for submit components
> than for other UI components. (It turns into the caption, If a "value"
> is specified..)
>
> I've also checked the parameter names I receive from the action, but
> apart from the different properties of the List I only receive
> "method: Edit" (when an "Edit" button has been pressed). Though I
> recall that when not using Struts you could receive the name of the
> button as a request parameter, so how do I do that with Struts 2 - and
> connect a value to it?
>
> Maybe I could use the "onclick" attribute of s:submit but I don't know
> the syntax for sending a value to the Action there. (Isn't that
> javascript?)
>
> Can somebody please help me with this?
>
> Thanks in advance!
>
> /Ylva
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


Re: [OT] Web app confirm changes

2008-08-29 Thread Miguel
To acomplish exactly what Dave recomended you, you may use jQuery.
It has precisely the one-liner syntax to make the same change on lots
of elements simultaneously.
http://jquery.com

Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.



On Fri, Aug 29, 2008 at 07:41, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Fri, 8/29/08, Pablo Vázquez Blázquez wrote:
>> I could do it with a global javascript variable "sthChanged",
>> but I would have to modify *each*  element to add it an
>> onchange event to set sthChanged=true when changes.
>
> One-liner of JavaScript to add an onchange handler to all input elements (or 
> all input elements of a specific class) to change the variable. Another line 
> to add an onclick to all links on a page to have them call a method to see if 
> anything had changed.
>
> At least if you're using a half-way decent JavaScript library. I'd focus your 
> efforts on JavaScript/DOM related lists or groups.
>
> 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: [S2] Problem with list of submit buttons

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, James Neff wrote:
>  action="OriginalAction" theme="simple">
> value='button label here'/>
> 
> 
> In the  section:
> function myJavaScriptMethod() {
> document.myForm.action = "/myProject/NewAction.action";
> document.myForm.submit();
> }
> 
> And that is how I programmatically set different actions
> from javascript.
> 
> Is there a better way?

You could use the "action" and "method" properties of  depending 
on your app needs.

Dave


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



Re: [S2] non intuitive OGNL value evaluation?

2008-08-29 Thread Gabriel Belingueres
I wonder if could be added a #param object to the ActionContext that
represent a parameter but returns a String (to avoid those evaluation
issues), after all, the programmer knows if he expect one or many
values in their request parameters and can use either #param or
#parameters as needed.

2008/8/27, Pierre Thibaudeau <[EMAIL PROTECTED]>:
> 2008/8/27 Dave Newton <[EMAIL PROTECTED]>:
> > IIRC it will--OGNL plays some games to try and do what it thinks you want 
> > to;
>
> Microsoft products too try to do what they think you want...
> It's absolutely maddening!
> ;)
>
> -
> 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: [S2] Problem with list of submit buttons

2008-08-29 Thread Ylva Degerfeldt
Thanks all of you for your replies but I'm afraid they're not helping
in this case.

James, It's not about getting different buttons to do different
actions. Like I said, I'm using e.g. method = "Edit" or method =
"Save" for that.

I just need some way to return the index of the object in the list
that a certain row belongs to when one of the row's buttons has been
pushed (Like I said.)

To Jim: I actually started doing this application by having each row
in a separate form but I had to change that because of Theme issues
and because I didn't know how to make the automatic handling of errors
and values work in that case. Please don't ask me to change that again
'cause then I have to change the theme as well and I really don't have
the time to do that! There must be another way.

Dave, you seem to know a whole lot about Struts 2. Is there no way to
take the value of "#state.index" of the s:iterator when a certain
iteration is being processed, connect that to a button and send the
value to an Action property when the button has been pushed?

/Ylva

On Fri, Aug 29, 2008 at 5:37 PM, Jim Kiley <[EMAIL PROTECTED]> wrote:
> If each of the buttons is a Submit button, and you have each row of the
> table wrapped in a separate form, you can put a  within each form,
> and store/provide the ID of the row within it.
>
> jk
>
> On Fri, Aug 29, 2008 at 11:22 AM, Ylva Degerfeldt <[EMAIL PROTECTED]
>> wrote:
>
>> Hi everyone,
>>
>> I have a List of POJOs that I've created, and for every POJO in the
>> list I'm displaying some UI components corresponding to the properties
>> of the POJO (textfields and select fields et.c.). I also have some
>> submit buttons that belong to each row (and indirectly to each POJO),
>> like "Edit", "Save" and "Remove" buttons. My corresponding Action has
>> a property for the List and it receives its values the way it should.
>>
>> My problem is that I need some way to tell the Action which of the
>> buttons that had been pushed (which one of the "Edit" buttons for
>> instance), and I don't know how to do that. To be more exact, I'd like
>> some way to return the #state.index of that iteration/row when a
>> specific button has been pushed.
>>
>> I'm also using the "method" tag for calling different methods on the
>> Action depending on which of the three buttons that was pushed, so
>> that's not a problem.
>>
>> I've tried to find more information about the s:submit but I didn't
>> find anything in "Struts 2 in Action" and the Struts 2 API docs aren't
>> explaining much either.
>>
>> I've tried using the "name" and "value" attributes like for other UI
>> components, like:
>>
>> > "caption.editbutton" method = "Edit"/>
>>
>> but that only caused the index value to be the caption of the button.
>> So it looks like "value" means something else for submit components
>> than for other UI components. (It turns into the caption, If a "value"
>> is specified..)
>>
>> I've also checked the parameter names I receive from the action, but
>> apart from the different properties of the List I only receive
>> "method: Edit" (when an "Edit" button has been pressed). Though I
>> recall that when not using Struts you could receive the name of the
>> button as a request parameter, so how do I do that with Struts 2 - and
>> connect a value to it?
>>
>> Maybe I could use the "onclick" attribute of s:submit but I don't know
>> the syntax for sending a value to the Action there. (Isn't that
>> javascript?)
>>
>> Can somebody please help me with this?
>>
>> Thanks in advance!
>>
>> /Ylva
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>

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



RE: [S2] Problem with list of submit buttons

2008-08-29 Thread Martin Gainty

did you get a chance to look at
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html

kiittää
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


> Date: Fri, 29 Aug 2008 18:10:31 +0200
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: Re: [S2] Problem with list of submit buttons
> 
> Thanks all of you for your replies but I'm afraid they're not helping
> in this case.
> 
> James, It's not about getting different buttons to do different
> actions. Like I said, I'm using e.g. method = "Edit" or method =
> "Save" for that.
> 
> I just need some way to return the index of the object in the list
> that a certain row belongs to when one of the row's buttons has been
> pushed (Like I said.)
> 
> To Jim: I actually started doing this application by having each row
> in a separate form but I had to change that because of Theme issues
> and because I didn't know how to make the automatic handling of errors
> and values work in that case. Please don't ask me to change that again
> 'cause then I have to change the theme as well and I really don't have
> the time to do that! There must be another way.
> 
> Dave, you seem to know a whole lot about Struts 2. Is there no way to
> take the value of "#state.index" of the s:iterator when a certain
> iteration is being processed, connect that to a button and send the
> value to an Action property when the button has been pushed?
> 
> /Ylva
> 
> On Fri, Aug 29, 2008 at 5:37 PM, Jim Kiley <[EMAIL PROTECTED]> wrote:
> > If each of the buttons is a Submit button, and you have each row of the
> > table wrapped in a separate form, you can put a  within each form,
> > and store/provide the ID of the row within it.
> >
> > jk
> >
> > On Fri, Aug 29, 2008 at 11:22 AM, Ylva Degerfeldt <[EMAIL PROTECTED]
> >> wrote:
> >
> >> Hi everyone,
> >>
> >> I have a List of POJOs that I've created, and for every POJO in the
> >> list I'm displaying some UI components corresponding to the properties
> >> of the POJO (textfields and select fields et.c.). I also have some
> >> submit buttons that belong to each row (and indirectly to each POJO),
> >> like "Edit", "Save" and "Remove" buttons. My corresponding Action has
> >> a property for the List and it receives its values the way it should.
> >>
> >> My problem is that I need some way to tell the Action which of the
> >> buttons that had been pushed (which one of the "Edit" buttons for
> >> instance), and I don't know how to do that. To be more exact, I'd like
> >> some way to return the #state.index of that iteration/row when a
> >> specific button has been pushed.
> >>
> >> I'm also using the "method" tag for calling different methods on the
> >> Action depending on which of the three buttons that was pushed, so
> >> that's not a problem.
> >>
> >> I've tried to find more information about the s:submit but I didn't
> >> find anything in "Struts 2 in Action" and the Struts 2 API docs aren't
> >> explaining much either.
> >>
> >> I've tried using the "name" and "value" attributes like for other UI
> >> components, like:
> >>
> >>  >> "caption.editbutton" method = "Edit"/>
> >>
> >> but that only caused the index value to be the caption of the button.
> >> So it looks like "value" means something else for submit components
> >> than for other UI components. (It turns into the caption, If a "value"
> >> is specified..)
> >>
> >> I've also checked the parameter names I receive from the action, but
> >> apart from the different properties of the List I only receive
> >> "method: Edit" (when an "Edit" button has been pressed). Though I
> >> recall that when not using Struts you could receive the name of the
> >> button as a request parameter, so how do I do that with Struts 2 - and
> >> connect a value to it?
> >>
> >> Maybe I could use the "onclick" attribute of s:submit but I don't know
> >> the syntax for sending a value to the Action there. (Isn't that
> >> javascript?)
> >>
> >> Can somebody please help me with this?
> >>
> >> Thanks in advance!
> >>
> >> /Ylva
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Jim Kiley
> > Technical Consultant | Summa
> > [p] 412.258.3346 [m] 412.445.1729
> > http://www.summa-tech.com
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_
Get thousands of games o

Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, Ylva Degerfeldt wrote:
> Dave, you seem to know a whole lot about Struts 2.

Smoke and mirrors, smoke and mirrors... ask anybody.

Submit elements are often a sticky wicket.

The previous suggestion to use JavaScript might be the quickest, by using an 
onclick handler to set the value of a hidden form element and have the action 
check that to see what element of the iterator to operate on.

As mentioned on [1] using the "button" type can help, but (as usual) IE6 makes 
it problematic.

Dave

[1] Submit docs: http://struts.apache.org/2.x/docs/submit.html


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



Re: [S2] Problem with list of submit buttons

2008-08-29 Thread James Neff

Dave Newton wrote:

--- On Fri, 8/29/08, James Neff wrote:
  
action="OriginalAction" theme="simple">
   value='button label here'/>



In the  section:
function myJavaScriptMethod() {
document.myForm.action = "/myProject/NewAction.action";
document.myForm.submit();
}

And that is how I programmatically set different actions
from javascript.

Is there a better way?



You could use the "action" and "method" properties of  depending 
on your app needs.

Dave

  


I learn something new every day from this list. 


Yesterday was about goats, and today it's about 

Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, James Neff wrote:
> Yesterday was about goats, and today it's about 

Re: Reading directory in JSP file (Struts 1.3)

2008-08-29 Thread nabbler12999

Thanks, I see.

nabbler12999 wrote:
> 
> Hello,
> 
> I want to read a directory. But canRead() gives false. How can I do it?
> 
> My code:
> [code]
> <%
> String filename="";
> File dir = new File("files");
> 
> String[] children = dir.list();
> 
> if (children == null) {
>   System.out.println("ERROR\t can read:"+dir.canRead());
>// Either dir does not exist or is not a directory
> } else {
>   Random a = new Random(dir.length());
> 
> filename = children[a.nextInt()];
> 
> }
> 
> request.setAttribute("randomfile",filename);
> 
> %>
> [/code]
> 
> Thanks very much
> 

-- 
View this message in context: 
http://www.nabble.com/Reading-directory-in-JSP-file-%28Struts-1.3%29-tp19167854p19224496.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 with creating default selection values in multiple select

2008-08-29 Thread Scott Lewis

Hi,

I'm relatively new with Struts2, but I'm starting to get a handle on how 
things work.  However, I'm having a problem with creating a "default" 
list of pre-selected values for an  tag when using the 
"multiple=true" option.  It works fine when I use single selection, and 
when the "pre-selected" values are loading by the framework 
automatically, but I can't seem to get a manually-created list to select 
anything.



Here is the struts tag I'm using (altered slightly to remove 
project-specific details):




the list/listKey/listValue all seem to work fine, as far as I can see.  
itemId is an integer.


the value of "selectedItems" calls the "getSelectedItems" from an Action 
class I'm using.  The code for that is as follows:


public List getSelectedItems() {
   if (pickedItems == null || pickedItems.size() == 0) {
   List defaultList = new ArrayList();
   defaultList.add(-1);
   return defaultList;
   } else {
   return pickedItems;

   }
   }

pickedItems is sometimes populated automatically by an AJAX-based action 
call, and the list on the screen is refreshed; the previously selected 
items remain selected.  However, when the page first loads, I want it to 
automatically select the "Any Item" option.


I'm using Struts 2.0.11.1

Thanks!

Scott

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



Re: Problem with creating default selection values in multiple select

2008-08-29 Thread Dave Newton
My guess is that the headerKey attribute is always evaluated as a string.

Since you're using a List, even if the string representations are the 
same, it won't match (see [1]).

That's probably worth an "improvement" JIRA if there isn't one in there 
already, although I haven't looked at it to see how easy/hard the change would 
be.

Dave

[1] Select tag: http://struts.apache.org/2.x/docs/select.html

--- On Fri, 8/29/08, Scott Lewis <[EMAIL PROTECTED]> wrote:

> From: Scott Lewis <[EMAIL PROTECTED]>
> Subject: Problem with creating default selection values in multiple select
> To: user@struts.apache.org
> Date: Friday, August 29, 2008, 1:54 PM
> Hi,
> 
> I'm relatively new with Struts2, but I'm starting
> to get a handle on how 
> things work.  However, I'm having a problem with
> creating a "default" 
> list of pre-selected values for an  tag
> when using the 
> "multiple=true" option.  It works fine when I use
> single selection, and 
> when the "pre-selected" values are loading by the
> framework 
> automatically, but I can't seem to get a
> manually-created list to select 
> anything.
> 
> 
> Here is the struts tag I'm using (altered slightly to
> remove 
> project-specific details):
> 
>  headerValue="Any Item"
> id="pickedItem"
> label="Item"
> list="items"
> listKey="itemId"
> listValue="itemVal"
> multiple="true"
> name="pickedItems"
> size="8"
> value="selectedItems"
> />
> 
> the list/listKey/listValue all seem to work fine, as far as
> I can see.  
> itemId is an integer.
> 
> the value of "selectedItems" calls the
> "getSelectedItems" from an Action 
> class I'm using.  The code for that is as follows:
> 
> public List getSelectedItems() {
> if (pickedItems == null || pickedItems.size() == 0)
> {
> List defaultList = new
> ArrayList();
> defaultList.add(-1);
> return defaultList;
> } else {
> return pickedItems;
> }
> }
> 
> pickedItems is sometimes populated automatically by an
> AJAX-based action 
> call, and the list on the screen is refreshed; the
> previously selected 
> items remain selected.  However, when the page first loads,
> I want it to 
> automatically select the "Any Item" option.
> 
> I'm using Struts 2.0.11.1
> 
> Thanks!
> 
> Scott
> 
> -
> 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: [S2] Problem with list of submit buttons

2008-08-29 Thread Ylva Degerfeldt
Thank you Dave!
See below..

> The previous suggestion to use JavaScript might be the quickest, by using an 
> onclick handler to set the value of a hidden form element and have the action 
> check that to see what element of the iterator to operate on.
>
> As mentioned on [1] using the "button" type can help, but (as usual) IE6 
> makes it problematic.

Ok, I think the JavaScript way might be the best, since it feels like
"bad web developing" to use something that doesn't work on certain
versions of a browser as common as IE.

I've created the hidden form element and getter+setter for it in the
Action. Now I just need the syntax for setting the value inside
"onclick".
I've tried searching the net for some help on this but since the
matter concerns both JavaScript and Struts 2 I didn't find anything.
Have you got any good links or something that I can use?

Basically, I need to know 3 things:
1. Does the code have to be in a JS method or can it be "right under onclick"?
2. How do I set the reference to the hidden field in JS?
3. How do I set the value of (1) to the value of #state.index in JS?
(Do I keep the '#', do I need %{ } or what?)

I'd be Really Grateful for some more help with this!

/Ylva

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



Re: [OT] Web app confirm changes

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

Thanks both for your replies.

I am using Struts 2 and Dojo 0.4. I don't know jQuery, but I will take 
it a look. Do you recommend me jQuery better Dojo (if it is possible to 
do what I want using Dojo, of course...)?


Miguel escribió:

To acomplish exactly what Dave recomended you, you may use jQuery.
It has precisely the one-liner syntax to make the same change on lots
of elements simultaneously.
http://jquery.com

Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.



On Fri, Aug 29, 2008 at 07:41, Dave Newton <[EMAIL PROTECTED]> wrote:
  

--- On Fri, 8/29/08, Pablo Vázquez Blázquez wrote:


I could do it with a global javascript variable "sthChanged",
but I would have to modify *each*  element to add it an
onchange event to set sthChanged=true when changes.
  

One-liner of JavaScript to add an onchange handler to all input elements (or 
all input elements of a specific class) to change the variable. Another line to 
add an onclick to all links on a page to have them call a method to see if 
anything had changed.

At least if you're using a half-way decent JavaScript library. I'd focus your 
efforts on JavaScript/DOM related lists or groups.

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]


  



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



Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, Ylva Degerfeldt wrote:
> Basically, I need to know 3 things:
> 1. Does the code have to be in a JS method or can it be
> "right under onclick"?

Doesn't matter, but since you have to both set the form field and submit the 
form it's likely to be cleaner to put it in a JavaScript method. Matter of 
preference.

> 2. How do I set the reference to the hidden field in JS?

Any JavaScript/DOM tutorial/documentation will explain that.

> 3. How do I set the value of (1) to the value of #state.index
> in JS? (Do I keep the '#', do I need %{ } or what?)

Not sure what you mean here; you'd use standard OGNL syntax:



Dave

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



Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Ylva Degerfeldt
Thanks again!

About the value (Question 3) I just wasn't sure I could use OGNL when
writing JavaScript but Ok. I get it.

I also found this example:
http://www.developertutorials.com/tutorials/javascript/change-form-field-values-050522/page1.html

The only thing that's left to fix now (I think) is finding a way to
reference the form field correctly. I have Not found this in any
tutorial.
It seems like it should be something like:

x.NameOfForm.NameOfHiddenField.value = INPUTVAL

The part that I called "x" is the part that I don't understand.
Should it be the name of the JSP or what?

/Ylva

On Fri, Aug 29, 2008 at 8:54 PM, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Fri, 8/29/08, Ylva Degerfeldt wrote:
>> Basically, I need to know 3 things:
>> 1. Does the code have to be in a JS method or can it be
>> "right under onclick"?
>
> Doesn't matter, but since you have to both set the form field and submit the 
> form it's likely to be cleaner to put it in a JavaScript method. Matter of 
> preference.
>
>> 2. How do I set the reference to the hidden field in JS?
>
> Any JavaScript/DOM tutorial/documentation will explain that.
>
>> 3. How do I set the value of (1) to the value of #state.index
>> in JS? (Do I keep the '#', do I need %{ } or what?)
>
> Not sure what you mean here; you'd use standard OGNL syntax:
>
> 
>
> 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]



[OT] Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, Ylva Degerfeldt wrote:
> About the value (Question 3) I just wasn't sure I could
> use OGNL when writing JavaScript but Ok. I get it.

Just to be precise: you're not really using OGNL "when writing JavaScript". 
You're embedding OGNL in the "onclick" attribute which, when evaluated, 
produces legal JavaScript. OGNL and JavaScript are *completely* unrelated.

> x.NameOfForm.NameOfHiddenField.value = INPUTVAL
> 
> The part that I called "x" is the part that I don't 
> understand. Should it be the name of the JSP or what?

Keep searching; this is DOM/JavaScript 101. Personally I'd use a JavaScript 
library, but it's not really necessary for a simple use-case like this.

Dave


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



problem in s:a tag xmlhttptransport error callback failed:[object Error]

2008-08-29 Thread MyAshok






Hi all,

Pls help me asap.

On click on the Url.

Hai


I got an error showing in debug mode xmlhttptransport error callback
failed:[object Error]

this same line is working in some other jsp. I think the current issue might
be because of the line  is placed inside s:iterator. This is just a
extra info.

please asap

With Hope and thanks,
Ashok. 
-- 
View this message in context: 
http://www.nabble.com/problem-in-s%3Aa-tag-xmlhttptransport-error-callback-failed%3A-object-Error--tp19226349p19226349.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 with creating default selection values in multiple select

2008-08-29 Thread Scott Lewis
Thanks, that was definitely it; I checked by using a value I know is in 
the "items" list instead of -1, and it ended up as the default.


I appreciate the help!

Scott

Dave Newton wrote:

My guess is that the headerKey attribute is always evaluated as a string.

Since you're using a List, even if the string representations are the 
same, it won't match (see [1]).

That's probably worth an "improvement" JIRA if there isn't one in there 
already, although I haven't looked at it to see how easy/hard the change would be.

Dave

[1] Select tag: http://struts.apache.org/2.x/docs/select.html

--- On Fri, 8/29/08, Scott Lewis <[EMAIL PROTECTED]> wrote:

  

From: Scott Lewis <[EMAIL PROTECTED]>
Subject: Problem with creating default selection values in multiple select
To: user@struts.apache.org
Date: Friday, August 29, 2008, 1:54 PM
Hi,

I'm relatively new with Struts2, but I'm starting
to get a handle on how 
things work.  However, I'm having a problem with
creating a "default" 
list of pre-selected values for an  tag
when using the 
"multiple=true" option.  It works fine when I use
single selection, and 
when the "pre-selected" values are loading by the
framework 
automatically, but I can't seem to get a
manually-created list to select 
anything.



Here is the struts tag I'm using (altered slightly to
remove 
project-specific details):




the list/listKey/listValue all seem to work fine, as far as
I can see.  
itemId is an integer.


the value of "selectedItems" calls the
"getSelectedItems" from an Action 
class I'm using.  The code for that is as follows:


public List getSelectedItems() {
if (pickedItems == null || pickedItems.size() == 0)
{
List defaultList = new
ArrayList();
defaultList.add(-1);
return defaultList;
} else {
return pickedItems;

}
}

pickedItems is sometimes populated automatically by an
AJAX-based action 
call, and the list on the screen is refreshed; the
previously selected 
items remain selected.  However, when the page first loads,
I want it to 
automatically select the "Any Item" option.


I'm using Struts 2.0.11.1

Thanks!

Scott

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



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


Re: problem in s:a tag xmlhttptransport error callback failed:[object Error]

2008-08-29 Thread MyAshok

hi,

I got it, when i removed the indicator, it works cool.

anyhow thanks for everybody who looks into it.

With regards,
ashok

MyAshok wrote:
> 
> 
> 
> 
> 
> 
> Hi all,
> 
> Pls help me asap.
> 
> On click on the Url.
> 
>  showLoadingText="false" targets="mainpage">Hai
> 
> 
> I got an error showing in debug mode xmlhttptransport error callback
> failed:[object Error]
> 
> this same line is working in some other jsp. I think the current issue
> might be because of the line  is placed inside s:iterator. This is
> just a extra info.
> 
> please asap
> 
> With Hope and thanks,
> Ashok. 
> 

-- 
View this message in context: 
http://www.nabble.com/problem-in-s%3Aa-tag-xmlhttptransport-error-callback-failed%3A-object-Error--tp19226349p19226538.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]



REST Showcase 2.1.2

2008-08-29 Thread stanlick

Is there a reason the lifecycle will not create the model object Order on
action instantiation?  I notice it is being constructed during the Action
initialization and without it, fails in the create method with a NPE.  How
much different is the lifecycle when using the REST plug-in?

-- 
View this message in context: 
http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19228759.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: REST Showcase 2.1.2

2008-08-29 Thread Musachy Barroso
Lifecycle is the same: up to you. There is no specific reason why it needs
to be like that. (you know the struts style: many ways of doing the same
thing)

musachy

On Fri, Aug 29, 2008 at 7:05 PM, stanlick <[EMAIL PROTECTED]> wrote:

>
> Is there a reason the lifecycle will not create the model object Order on
> action instantiation?  I notice it is being constructed during the Action
> initialization and without it, fails in the create method with a NPE.  How
> much different is the lifecycle when using the REST plug-in?
>
> --
> View this message in context:
> http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19228759.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


Re: REST Showcase 2.1.2

2008-08-29 Thread stanlick

So what do you suppose is the special missing sauce?  I see Spring inject my
service bean into the action but not the model!  Very strange indeed. 
Public setter method, bean wiring by autodetect... really has me scratching
my head.  Also, what's with the ModelDriven refreshModelBeforeResult?  I
haven't seen that one before!  Don't see it in the 
http://struts.apache.org/2.x/docs/model-driven-interceptor.html guide   Is
this a guide/version deal?

Scott




Musachy Barroso wrote:
> 
> Lifecycle is the same: up to you. There is no specific reason why it needs
> to be like that. (you know the struts style: many ways of doing the same
> thing)
> 
> musachy
> 
> On Fri, Aug 29, 2008 at 7:05 PM, stanlick <[EMAIL PROTECTED]> wrote:
> 
>>
>> Is there a reason the lifecycle will not create the model object Order on
>> action instantiation?  I notice it is being constructed during the Action
>> initialization and without it, fails in the create method with a NPE. 
>> How
>> much different is the lifecycle when using the REST plug-in?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19228759.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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19229294.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: REST Showcase 2.1.2

2008-08-29 Thread Dave Newton
--- On Fri, 8/29/08, stanlick <[EMAIL PROTECTED]> wrote:
> Also, what's with the ModelDriven refreshModelBeforeResult?  I
> haven't seen that one before!  Don't see it in the 
> http://struts.apache.org/2.x/docs/model-driven-interceptor.html
> guide   Is this a guide/version deal?

It hasn't been documented yet, AFAIK. It was put it due to an old JIRA issue. I 
think it came up originally because of the double call to getModel() in the 
interceptor or something?

Dave


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



Re: [S2] RestfulActionMappers and Namespace

2008-08-29 Thread alvins

I just tried it with latest struts and is still a problem - is there a Jira
for this or maybe its been fixed and I am using it wrong?

Alvin


Kyle Adams wrote:
> 
> 
> Musachy Barroso wrote:
>> 
>> Does it work with only zero conf? (no RestfulActionMapper)
>> 
> 
> Yup.  Works if I turn off RestfulActionMapper (zero conf still used) and
> works if I turns off the namespace (zero conf still used).  Just doesn't
> work if all three are in effect.
> 
> Kyle
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--RestfulActionMappers-and-Namespace-tp10090004p19229826.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: REST Showcase 2.1.2

2008-08-29 Thread stanlick

So any ideas why the model is being created inside the action and not
injected by the framework?

private Order model = new Order();



newton.dave wrote:
> 
> --- On Fri, 8/29/08, stanlick <[EMAIL PROTECTED]> wrote:
>> Also, what's with the ModelDriven refreshModelBeforeResult?  I
>> haven't seen that one before!  Don't see it in the 
>> http://struts.apache.org/2.x/docs/model-driven-interceptor.html
>> guide   Is this a guide/version deal?
> 
> It hasn't been documented yet, AFAIK. It was put it due to an old JIRA
> issue. I think it came up originally because of the double call to
> getModel() in the interceptor or something?
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19229834.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: REST Showcase 2.1.2

2008-08-29 Thread stanlick

Also, what is the naming convention for validation xml files using the Code
Behind/REST plug-in?

I've tried several combinations of naming, but none seem to work.  


-- 
View this message in context: 
http://www.nabble.com/REST-Showcase-2.1.2-tp19228759p19229925.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: REST Showcase 2.1.2

2008-08-29 Thread Jeromy Evans

stanlick wrote:

So any ideas why the model is being created inside the action and not
injected by the framework?

private Order model = new Order();

  


I think Don was just being lazy in the quick example ;-)
I load or create the model in the appropriate prepare method.  All that 
matters is that is exists (is non-null) prior to properties being set 
because it uses ModelDriven.



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



Re: [S2] RestfulActionMappers and Namespace

2008-08-29 Thread alvins

Sorry guys this has been fixed - just some notes on behavior which may help
others (should maybe be added to wiki) -

- If you want a blank namespace - do not use "/" as your namespace in your
struts xml's or in namespace notation. Inconsistent behavior starts to
occur.
- If you want a specific namespace - e.g. /v1 - you must ensure your
namespace has prefixed slash i.e. "/v1" otherwise it will not work.

Alvin


alvins wrote:
> 
> I just tried it with latest struts and is still a problem - is there a
> Jira for this or maybe its been fixed and I am using it wrong?
> 
> Alvin
> 
> 
> Kyle Adams wrote:
>> 
>> 
>> Musachy Barroso wrote:
>>> 
>>> Does it work with only zero conf? (no RestfulActionMapper)
>>> 
>> 
>> Yup.  Works if I turn off RestfulActionMapper (zero conf still used) and
>> works if I turns off the namespace (zero conf still used).  Just doesn't
>> work if all three are in effect.
>> 
>> Kyle
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--RestfulActionMappers-and-Namespace-tp10090004p19230169.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+Portlet: processAction() get called, but not render()

2008-08-29 Thread wzx

Hi,

I'm building a portlet with Jahia (Jetspeed), Struts.
This portlet runs normally in one portal page, but in another portal page, I
can only show the first "page", when clicking on a link for showing a second
page, the portlet shows nothing, so I get an empty box.

The logs show that in this case, only processAction() is called, no render()
follows. We use org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher as
portlet wrapper of our Struts application:

2008-08-29 20:48:45,250: INFO  [org.jahia.bin.Jahia] - Processed
[/jahia/Jahia/s
ite/netfoo/op/edit/pid/604] user=[root] ip=[127.0.0.1] in [719ms]
Action parameter found. pathInfo = /site/netfoo/op/edit/_ns/YnNlcnZhaXJfYWxs
OjpTdHJ1dHMyIFRlc3QgUG9ydGxldDo6NjBjZDJmM2E6MTFjMGU3ZjViZjc6LTdmZWJ8YzB8ZDB8ZXN0
cnV0cy5wb3J0bGV0Lm1vZGU9MT12aWV3fGVzdHJ1dHMucG9ydGxldC5hY3Rpb249MT0vc2VydmFpci9z
ZXJ2YWlyVmlld3xldGVtcGxhdGVEaXI9MT10ZW1wbGF0ZXxldGhlbWU9MT1zaW1wbGU_/cache/bypas
s/j2action/true/appid/24288_166/pid/604
[DEBUG] Jsr168Dispatcher - Entering processAction
[DEBUG] PortletRequestMap - Dumping request parameters:
[DEBUG] PortletRequestMap - center = SIEGE
[DEBUG] PortletRequestMap - struts.portlet.mode = view
[DEBUG] PortletRequestMap - struts.portlet.action = /foo/fooView
[DEBUG] PortletRequestMap - templateDir = template
[DEBUG] PortletRequestMap - theme = simple
[DEBUG] PortletRequestMap - service =
[DEBUG] PortletRequestMap - lastname =
[DEBUG] PortletRequestMap - firstname =
[DEBUG] PortletRequestMap - method:searchResult = Rechercher
[DEBUG] PortletSessionMap - Dumping session info:
[DEBUG] Jsr168Dispatcher - serviceAction
[DEBUG] Jsr168Dispatcher - Creating action proxy for name = fooView, namespa
ce = /foo
[DEBUG] FileUploadInterceptor - Bypassing /foo/ fooView
[DEBUG] AnnotationValidationInterceptor - Validating /foo/fooView with m
ethod searchResult.

do searchResult

it is done
[DEBUG] PortletResult - Executing result in Event phase
[DEBUG] PortletResult - Setting event render parameter: /foo/resultview.jsp
[DEBUG] Jsr168Dispatcher - Leaving processAction
2008-08-29 20:48:52,718: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate.prompt in bundle
jahiatemplates.com
mon for locale fr:Can't find resource for bundle
java.util.PropertyResourceBundl
e, key quickValidate.prompt
2008-08-29 20:48:52,734: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,734: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,734: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,890: INFO  [org.jahia.bin.Jahia] - Processed
[/jahia/Jahia/s
ite/netfoo/op/edit/_ns/YnNlcnZhaXJfYWxsOjpTdHJ1dHMyIFRlc3QgUG9ydGxldDo6NjBjZ
DJmM2E6MTFjMGU3ZjViZjc6LTdmZWJ8YzB8ZDB8ZXN0cnV0cy5wb3J0bGV0Lm1vZGU9MT12aWV3fGVzd
HJ1dHMucG9ydGxldC5hY3Rpb249MT0vc2VydmFpci9zZXJ2YWlyVmlld3xldGVtcGxhdGVEaXI9MT10Z
W1wbGF0ZXxldGhlbWU9MT1zaW1wbGU_/cache/bypass/j2action/true/appid/24288_166/pid/6
04] user=[root] ip=[127.0.0.1] in [640ms]
2008-08-29 20:48:52,953: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate.prompt in bundle
jahiatemplates.com
mon for locale fr:Can't find resource for bundle
java.util.PropertyResourceBundl
e, key quickValidate.prompt
2008-08-29 20:48:52,953: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,953: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,953: WARN 
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:53,062: INFO  [org.jahia.bin.Jahia] - Processed
[/jahia/Jahia/s
ite/netfoo/op/edit/_ns/YXNlcnZhaXJfYWxsOjpTdHJ1dHMyIFRlc3QgUG9ydGxldDo6NjBjZ
DJmM2E6MTFjMGU3ZjViZjc6LTdmZWJ8YzB8ZDB8ZXN0cnV0cy5wb3J0bGV0Lm1vZGU9MT12aWV3fGVzd
HJ1dHMucG9ydGxldC5hY3Rpb249MT1yZW5kZXJEaXJlY3R8ZXN0cnV0cy5wb3J0bGV0LmV2ZW50QWN0a
W9uPTE9dHJ1ZQ__/cache/bypass/appid/24288_166/pid/604] user=[root]
ip=[127.0

Re: There is no Action mapped for namespace / and action name ...

2008-08-29 Thread simson

I had the same problem and the indication on the following link helped me:

http://www.roseindia.net/tutorialhelp/comment/58280
regards,
Simson



Stephan Schröder wrote:
> 
> having the same problem:
> i use Struts2.0.11.2. and tomcat 6.0.16.
> On my Windows desktop everything works fine. I exported the project as war
> and imported it on my Linux laptop (so i can work a little bit in my
> hollidays). 
> But on the Linux laptop i only get a
> "There is no Action mapped for action name index.".
> My xml-files are UTF-8 coded on both machines so i have no idea where the
> problem is rooted in.
> I'm using JRE1.6.0_07 on both machines, setting the compliance level to
> 1.5 didn't change anything. The tomcat startup shows no problems either.
> 
> What libraries did you change?
> 
> /Stephan
> 
> 
> John Moose wrote:
>> 
>> re-ordered the libraries and builders, forced JDK compiler compliance to
>> 5.0
>> ( definitely *not* 6.0 !!) in Eclipse and voila...runs great.  never
>> *really* thought it was a Struts2 problem  ; )
>> 
>> On Tue, Jul 29, 2008 at 9:26 AM, John Moose <[EMAIL PROTECTED]> wrote:
>> 
>>> A very wierd situation...I have two projects in the Eclipse workspace --
>>> Tagging and Dashbd  They both use the REST plugin and follow the naming
>>> conventions, etc. Tagging will build, re-deploy and run perfectly. When
>>> I
>>> close that project and open Dashbd, build, re-deploy and run I get the
>>> Action mapping failure as described. Both projects have source files in
>>> the
>>> "com.myeclipse.ozone" package name(space). Is it possible that there is
>>> some
>>> very persistent caching going on ??? like over multiple starts and
>>> re-starts
>>> of Tomcat?  just a WAG...
>>>
>>> -John
>>>
>>>
>>> On Tue, Jul 29, 2008 at 5:08 AM, Pauli Savolainen <
>>> [EMAIL PROTECTED]> wrote:
>>>
 Hi,

 I am having exactly the same problem. I was using Struts 2.1.1,
 switched to struts 2.1.2 (including the restful and codebehind
 plugins) and started to get this 'no action found' error. I am quite
 confident that I did not do anything that should've resulted in this.
 Of course I cannot be 100% sure, because I did goof around with my
 code a bit, but I checked and rechecked and rerechecked everthing
 twice and couldn't find a reason for this behaviour.

 John's web.xml and the stacktrace are identical to mine. I don't
 declare any namespaces in my struts.xml packages nor in the login form
 from which I try to invoke the login action >>> action="/login/execute" method="post">. (Also tried with an
 exclamation mark i.e. login!execute) I have a LoginAction.java with an
 execute method in the pacakge defined in the web.xml's actionPackages
 init parameter. At least this declaration used to send the control to
 the LoginAction's execute method. Doesn't do anymore.

 I am using the struts 2.1.2 tiles plugin as well. On my index.jsp I
 include a tiles main layout which in turn includes sub-layouts (such
 as the login form). I don't know if this has anything got to do with
 the problem I'm having.

 So, is a result of something I did wrong or could it be something else?

 Thank you

 Pauli Savolainen

 2008/7/28 Paul Benedict <[EMAIL PROTECTED]>:
 > What's the correct way of writing a good 404 or action not found
 page?
 Does
 > s2 have something like a fallback action if nothing can be found?
 >
 > Paul
 >
 > On Mon, Jul 28, 2008 at 4:04 PM, Dave Newton <[EMAIL PROTECTED]>
 wrote:
 >
 >> Hmm, I wonder if it was the same issue I was having with 2.1.3 a
 week
 or so
 >> ago that I haven't had time to re-visit--so it actually could be the
 web.xml
 >> (specifically the dispatcher being used) and I may have put my foot
 in
 my
 >> mouth (again).
 >>
 >> Somebody followed up saying the original FilterDispatcher worked,
 though,
 >> so maybe not. Hrm.
 >>
 >> Dave
 >>
 >> --- On Mon, 7/28/08, John Moose <[EMAIL PROTECTED]> wrote:
 >> > and I probably should have included this as well:
 >> >
 >> > Struts Problem Report
 >> >
 >> > Struts has detected an unhandled exception:
 >> >   *Messages*:
 >> > There is no Action mapped for namespace / and action name
 >> > dashbd.
 >> >  --
 >> > Stacktraces *There is no Action mapped for namespace / and
 >> > action name
 >> > dashbd. - [unknown location]*
 >> >
 >> >
 >> >
 >>
 com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
 >> >
 >> >
 >>
 com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:59)
 >> >
 >> >
 >>
 org.apache.struts2.rest.RestActionProxyFactory.createActionProxy(RestActionProxyFactory.java:40)
 >> >
 >> >
 >>
 org.apache.strut

Re: [S2] RestfulActionMappers and Namespace

2008-08-29 Thread alvins

More notes - 
- If you are using tiles or even jsp (I think) and have the same name folder
as a namespace your rest urls will not execute the action


alvins wrote:
> 
> Sorry guys this has been fixed - just some notes on behavior which may
> help others (should maybe be added to wiki) -
> 
> - If you want a blank namespace - do not use "/" as your namespace in your
> struts xml's or in namespace notation. Inconsistent behavior starts to
> occur.
> - If you want a specific namespace - e.g. /v1 - you must ensure your
> namespace has prefixed slash i.e. "/v1" otherwise it will not work.
> 
> Alvin
> 
> 
> alvins wrote:
>> 
>> I just tried it with latest struts and is still a problem - is there a
>> Jira for this or maybe its been fixed and I am using it wrong?
>> 
>> Alvin
>> 
>> 
>> Kyle Adams wrote:
>>> 
>>> 
>>> Musachy Barroso wrote:
 
 Does it work with only zero conf? (no RestfulActionMapper)
 
>>> 
>>> Yup.  Works if I turn off RestfulActionMapper (zero conf still used) and
>>> works if I turns off the namespace (zero conf still used).  Just doesn't
>>> work if all three are in effect.
>>> 
>>> Kyle
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--RestfulActionMappers-and-Namespace-tp10090004p19230238.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: Extending EJBInjection interceptor

2008-08-29 Thread David N. Arnold
On Wed, Aug 27, 2008 at 3:46 AM, Alexander Baetz
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> i'm currently working on a new Interceptor for EJB Injection on Actions. I
> allready extendet it to work on fields and methods. But since i dont like to
> make my own Annotation type i wanted to use the javax.ejb.ejb anotation.

I tried to do something similar once and came to the conclusion that
it is not a good idea.

> the annotation used by the ejb3-plugin for struts 2 has a field that
> determines if the bean is statefull or stateless. I don't have this bean, so
> how do i determine for the injection if the bean is statefull?

Basically, you don't.  The best you can do (and someone please correct
me if I'm wrong) is do a JNDI lookup the first time you need the
session bean and then store its reference in the HttpSession.  That's
the only way to make stateful session beans work at all and it doesn't
hurt stateless session beans.

Now this creates two problems.  1) You're dumping crap in the session,
which is bad for all the usual reasons and 2) stateful session beans
aren't guaranteed to be thread-safe.  That means if someone
double-posts a form they could end up with an error page.  It also may
cause problems with AJAX pages creating multiple concurrent requests.

These are major headaches that JBoss Seam was specifically designed to
address.  Now just to be clear, JSF makes me gag and I'm not trying to
pimp a framework I've never used.  What I am saying though, is that if
EJB 3 is a requirement for your app, Struts may not be the best
choice.

I'd be curious to hear if anyone has really pulled off good Java EE 5
integration.  I'd guess that the majority around here are using Spring
or Guice instead.

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



[S2] REST Plugin + Validation

2008-08-29 Thread alvins

Hi guys,

I have been wrestling with the REST plugin for the last couple of days and
have posted some notes in another thread.

I have hit a problem which I need a little help with. Basically in my REST
controller I have a create and update method as per the REST guidelines. I
need separate validations for each of these which I do via annotating the
methods respectively. 

A problem arises as I need to separate INPUT results in the case of
validation failure 0 one for the create and one for the update but of course
this is not doable.

It is similar to a problem described here -
http://www.nabble.com/S2%3A-input-by-method-for-validations-tp13611246p13611246.html.
 

Any ideas?
-- 
View this message in context: 
http://www.nabble.com/-S2--REST-Plugin-%2B-Validation-tp19230629p19230629.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+Portlet: processAction() get called, but not render()

2008-08-29 Thread Nils-Helge Garli Hegvik
What does your JSP look like? Also, have you checked _all_ your server
logs for errors? Check your server log directory and look through all
the logs.

Nils-H


-- Forwarded message --
From: wzx <[EMAIL PROTECTED]>
Date: Sat, Aug 30, 2008 at 5:39 AM
Subject: Struts+Portlet: processAction() get called, but not render()
To: user@struts.apache.org



Hi,

I'm building a portlet with Jahia (Jetspeed), Struts.
This portlet runs normally in one portal page, but in another portal page, I
can only show the first "page", when clicking on a link for showing a second
page, the portlet shows nothing, so I get an empty box.

The logs show that in this case, only processAction() is called, no render()
follows. We use org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher as
portlet wrapper of our Struts application:

2008-08-29 20:48:45,250: INFO  [org.jahia.bin.Jahia] - Processed
[/jahia/Jahia/s
ite/netfoo/op/edit/pid/604] user=[root] ip=[127.0.0.1] in [719ms]
Action parameter found. pathInfo = /site/netfoo/op/edit/_ns/YnNlcnZhaXJfYWxs
OjpTdHJ1dHMyIFRlc3QgUG9ydGxldDo6NjBjZDJmM2E6MTFjMGU3ZjViZjc6LTdmZWJ8YzB8ZDB8ZXN0
cnV0cy5wb3J0bGV0Lm1vZGU9MT12aWV3fGVzdHJ1dHMucG9ydGxldC5hY3Rpb249MT0vc2VydmFpci9z
ZXJ2YWlyVmlld3xldGVtcGxhdGVEaXI9MT10ZW1wbGF0ZXxldGhlbWU9MT1zaW1wbGU_/cache/bypas
s/j2action/true/appid/24288_166/pid/604
[DEBUG] Jsr168Dispatcher - Entering processAction
[DEBUG] PortletRequestMap - Dumping request parameters:
[DEBUG] PortletRequestMap - center = SIEGE
[DEBUG] PortletRequestMap - struts.portlet.mode = view
[DEBUG] PortletRequestMap - struts.portlet.action = /foo/fooView
[DEBUG] PortletRequestMap - templateDir = template
[DEBUG] PortletRequestMap - theme = simple
[DEBUG] PortletRequestMap - service =
[DEBUG] PortletRequestMap - lastname =
[DEBUG] PortletRequestMap - firstname =
[DEBUG] PortletRequestMap - method:searchResult = Rechercher
[DEBUG] PortletSessionMap - Dumping session info:
[DEBUG] Jsr168Dispatcher - serviceAction
[DEBUG] Jsr168Dispatcher - Creating action proxy for name = fooView, namespa
ce = /foo
[DEBUG] FileUploadInterceptor - Bypassing /foo/ fooView
[DEBUG] AnnotationValidationInterceptor - Validating /foo/fooView with m
ethod searchResult.

do searchResult

it is done
[DEBUG] PortletResult - Executing result in Event phase
[DEBUG] PortletResult - Setting event render parameter: /foo/resultview.jsp
[DEBUG] Jsr168Dispatcher - Leaving processAction
2008-08-29 20:48:52,718: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate.prompt in bundle
jahiatemplates.com
mon for locale fr:Can't find resource for bundle
java.util.PropertyResourceBundl
e, key quickValidate.prompt
2008-08-29 20:48:52,734: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,734: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,734: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,890: INFO  [org.jahia.bin.Jahia] - Processed
[/jahia/Jahia/s
ite/netfoo/op/edit/_ns/YnNlcnZhaXJfYWxsOjpTdHJ1dHMyIFRlc3QgUG9ydGxldDo6NjBjZ
DJmM2E6MTFjMGU3ZjViZjc6LTdmZWJ8YzB8ZDB8ZXN0cnV0cy5wb3J0bGV0Lm1vZGU9MT12aWV3fGVzd
HJ1dHMucG9ydGxldC5hY3Rpb249MT0vc2VydmFpci9zZXJ2YWlyVmlld3xldGVtcGxhdGVEaXI9MT10Z
W1wbGF0ZXxldGhlbWU9MT1zaW1wbGU_/cache/bypass/j2action/true/appid/24288_166/pid/6
04] user=[root] ip=[127.0.0.1] in [640ms]
2008-08-29 20:48:52,953: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate.prompt in bundle
jahiatemplates.com
mon for locale fr:Can't find resource for bundle
java.util.PropertyResourceBundl
e, key quickValidate.prompt
2008-08-29 20:48:52,953: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,953: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:52,953: WARN
[org.jahia.taglibs.resourcebundle.ResourceBundleT
ag] - Error accessing resource quickValidate in bundle jahiatemplates.common
for
 locale fr:Can't find resource for bundle java.util.PropertyResourceBundle,
key
quickValidate
2008-08-29 20:48:53,062: INFO  [org.ja

Re: I need generic html table structure with theme ajax in struts 2

2008-08-29 Thread Laurie Harper
If you don't want to deal with customizing themes, you could switch to 
an existing theme that gives you the markup you want and use Dojo (or 
whatever Javascript framework you prefer) to implement the functionality 
provided by the 'ajax' theme yourself. But extending and customizing 
themes is pretty easy and straight forward; it's nothing to be afraid of.


L,,

MyAshok wrote:

Hi Harper,

Thanks for ur quick reply.

Is there any other possibilities or any plugins to make this possible.
Because, I dont want to make ajax theme obselete by extending it by my code.

Applause for the solution,

With Hope,
Ashok.





Laurie Harper wrote:

MyAshok wrote:

Hi all,

Again thanks for ur past replies.

Now, I am in a new issue.

I need to use the ajax theme for two buttons (s:button id=A and s:button
id
=B). But, as default, each s: tag will create a tr and td tags. I dont
want
this type of table structure(row by row). I want to customize table
structure as that of generic html table.
You'll need to customize the templates for the 'ajax' theme, or create 
your own theme based on / extending the 'ajax' theme, to define the 
markup you want to generate. See here for details:


http://struts.apache.org/2.0.11.1/docs/themes-and-templates.html

L.


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








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



Re: [OT] Re: [S2] Problem with list of submit buttons

2008-08-29 Thread Laurie Harper

Dave Newton wrote:

x.NameOfForm.NameOfHiddenField.value = INPUTVAL

The part that I called "x" is the part that I don't 
understand. Should it be the name of the JSP or what?


Keep searching; this is DOM/JavaScript 101. Personally I'd use a JavaScript 
library, but it's not really necessary for a simple use-case like this.



I find myself with a few spare bones, so I'll throw one to Ylva ;-) Try 
document.forms.NameOfForm... of document.getElementById('NameOfForm')...


L.


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