Re: ParamPrepareParamsStack interceptor , how does this work???

2008-06-30 Thread Jeromy Evans

Lukasz Lenart wrote:


You should use prepare() to prepopulate lists / comboboxs/ etc not to
create your domain objects.


Regards
  
The OP's approach is appropriate when using the param-prepare-params 
pattern.  Sometimes it's essential that the domain objects are 
instantiated/loaded in a prepare method prior to setting their params. 
eg. #1. if it's impossible for S2 to instantiate it (when there's no 
default constructor or an unknown concrete type).
eg. #2.where a parameter is required to load the domain object prior to 
setting its it's params


For the OP:
You haven't indicated whether you're using a getter (getProduct()) or 
ModelDrivenProduct. It appears to me that your problem is unrelated to 
the paramsPrepareParams stack and more related to your parameters name.


The first invocation of the params interceptor will set all params of 
your action (productId, name, color etc).  In this case, a Product does 
not exist but the productId is set.

The prepare method is invoked and your Product created loaded.
The second invocation of the params interceptor will set all params of 
your action again (productid, name, color).  In this case a Product does 
exist, but you're not setting its own parameters.


I suspect you haven't applied the ModelDrivenProduct interface.  You 
need to use that if you want to call your parameter name.


Otherwise you need a getProduct() method with param names such as 
product.name and product.color.


regards,
Jeromy Evans


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



Re: ParamPrepareParamsStack interceptor , how does this work???

2008-06-30 Thread Lukasz Lenart
Upss! My mistake, I should read documentation much more careful ;-)
Thanks Jeromy for explanation!


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

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



action param-element not working ?

2008-06-30 Thread Hanson Char
Hi,

I tried to inject some values to an action via the param-element, but it
doesn't seem to be working.  See example config below.  I set a breakpoint
with a debugger, and the setter methods of the two properties (minValue and
maxDecimalPlaces) don't ever get invoke, even though the myMethod did.  Is
this a known issue, or should I open up a JIRA issue ?

(I am using struts-2.0.11.1 and therefore xwork-2.0.4.)

Thanks,
Hanson

struts
package name=mypackage extends=struts-default
action name=MyAction_myMethod
class=my.action.MyAction
method=myMethod

!--
  The param-element doesn't seem to be working;
  So using the default values in the class for now.
--
param name=minValue0/param
param name=maxDecimalPlaces2/param
interceptor-ref name=fileUpload
param name=maximumSize10/param
param name=allowedTypestext/plain/param
/interceptor-ref
interceptor-ref name=basicStack /
result name=input/jsp/MyPage.jsp/result
result name=success/jsp/RetroCharge.jsp/result
/action


Validation doubt

2008-06-30 Thread Narayana S
Hi,

as per my understanding, we can implement validations in struts 2 in the
following ways...

1. overriding validate() method in Action class
2. writing ActionClass-validation.xml file
3. using validator annotations

validate method implements declarative security, ActionClass-valication.xml
is  seperating validation logic  from  action class .

what is the  clear difference between these 3 approaches?

and how can i implement client side validations in struts 2?


Struts2 - OGNL Calling static method

2008-06-30 Thread Ramanathan RV
Hello

I wish to call a static method from the view and make the results available
to my view. I believed I would have to do something like this to achieve
that :

s:set name=docs scope=request
value=@[EMAIL PROTECTED](product)/

The above piece of code indeed calls the method. But the result doesnt get
set on the variable as expected. Am I missing something here?

-- 
Thanks
Ram


for review - split content type handler manager in REST plugin

2008-06-30 Thread Jeromy Evans
Could someone with an interest in the REST plugin please glance at the 
changes I've committed for WW-2641


The change allows a different content-type in the request than the 
response.  This was added specifically to allow a x-www-form-urlencoded 
request with a response in a different content-type (eg. the common case 
of posting a form via XHR and receiving an application/json response).


A new ContentTypeHandler is added for x-www-form-urlencoded and the 
ContentTypeHandlerManager's functionality split to get a handler for the 
request and response separately.  The ContentTypeHandlerManager also 
allows handlers to be registered by mime-type and/or extension. I'm 
happy with it but want to ensure it doesn't conflict with other plans.  
I've kept in mind that in the future the manager may check the accepts 
header for the response content-type.


Thanks,
Jeromy Evans

https://issues.apache.org/struts/browse/WW-2641


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



Re: Struts2 - OGNL Calling static method

2008-06-30 Thread Jeromy Evans

Ramanathan RV wrote:

Hello

I wish to call a static method from the view and make the results available
to my view. I believed I would have to do something like this to achieve
that :

s:set name=docs scope=request
value=@[EMAIL PROTECTED](product)/

The above piece of code indeed calls the method. But the result doesnt get
set on the variable as expected. Am I missing something here?

  


Provided static method access is enabled (off by default), the line 
above will work.


It's possible that the problem is with the way you're accessing docs 
(are you using %{#docs})?


To enable static method access set the struts2 constant .
struts.ognl.allowStaticMethodAccess=true

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



Re: for review - split content type handler manager in REST plugin

2008-06-30 Thread Jeromy Evans

Jeromy Evans wrote:
Could someone with an interest in the REST plugin please glance at the 
changes I've committed for WW-2641



oops, that was meant for struts-dev.  I'll cross-post there.

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



Re: Validation doubt

2008-06-30 Thread Lukasz Lenart
Hi,

 what is the  clear difference between these 3 approaches?

Annotations and XML allow you to only use defined validators, with
validate() method you can do anything you want, base your validation
on more complicated business rules.


 and how can i implement client side validations in struts 2?

Client side validation will base on validation rules defined with
Annotations and XML files, just add validate=true to your form [1]

[1] http://struts.apache.org/2.1.2/docs/client-side-validation.html


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

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



Re: Validation doubt

2008-06-30 Thread Jeromy Evans

Narayana S wrote:

Hi,

as per my understanding, we can implement validations in struts 2 in the
following ways...

1. overriding validate() method in Action class
  


Use the validate() method for complex validation that cannot be 
implement anywhere else. You want to avoid duplicating validation code 
so this method should be for special cases.



2. writing ActionClass-validation.xml file
  


The XML validation was developed first before Java 5 annotations can be 
assumed.  It is a little more mature than annotations but some people 
doesn't like having to manage more configuration files.




3. using validator annotations

  
The annotations implement much of what is available in XML and avoid the 
separate configuration.  There are some complications when using 
annotations but generally they're fine.  Sometimes I've found the 
validation annotations are longer than the actual code, which is a bad 
thing.  I prefer XML, many people prefer annotations.




and how can i implement client side validations in struts 2?
  


The struts 2 form tags have client-side validation built-in if you set 
validate=true on the form.
What actually happens is that a loop in the form's closing-tag template 
reads the validations from the xml/annotations of your action and 
generates some javascript implementing whatever validation logic it can 
from the client-side.  The benefit is that one validation declaration 
can be used for both client and server-side.  However it can't implement 
all validation logic, it assumes you're using struts2 tags and markup 
for all fields and it generates inline javascript.


See:
http://struts.apache.org/2.0.11.1/docs/client-side-validation.html

regards,
Jeromy Evans


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



Re: action param-element not working ?

2008-06-30 Thread Lukasz Lenart
Hi,

Did you use stack with
interceptor name=staticParams
class=com.opensymphony.xwork2.interceptor.StaticParametersInterceptor/
?


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

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



Struts2 + applicationContext.xml

2008-06-30 Thread Kibo

Hi konference

I use Struts2 + Spring.
I deployed the Struts 2 - Maven Archetype - Starter

In file applicationContext.xml is defined bean - helloWorldAction.

beans
!-- Example of SAF2 action instantiated by Spring --
bean id=helloWorldAction
class=cz.kibo.engine.Engine.HelloWorldAction singleton=false /
/beans

I read that Struts2 expects that each action is a new instance. Therefore is
there : singleton=false

Do I have to defined EVERY action in applicationContext.xml ?

Thanks to help

-
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/Struts2-%2B-applicationContext.xml-tp18192032p18192032.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: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
 Do I have to defined EVERY action in applicationContext.xml ?

Yes if you want to create them by Spring and remember to use name
defined in applicationContext.xml as class in struts.xml


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

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



Re: Struts2 + applicationContext.xml

2008-06-30 Thread Dave Newton
--- On Mon, 6/30/08, Lukasz Lenart wrote:
 Do I have to defined EVERY action in applicationContext.xml ?
 Yes if you want to create them by Spring and remember to
 use name defined in applicationContext.xml as class in struts.xml

Actually, you don't. If you're using Spring as the object factory and are 
auto-wiring by name (which can, on occasion, lead to spectacular debugging 
opportunities) it's not necessary to define the actions, AFAICT.

Dave


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



Re: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
 Actually, you don't. If you're using Spring as the object factory and are 
 auto-wiring by name (which can, on occasion, lead to spectacular debugging 
 opportunities) it's not necessary to define the actions, AFAICT.

But in such way, first action will be created by Struts and then
Spring will inject dependency to it, does it?


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

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



Re: Struts2 + applicationContext.xml

2008-06-30 Thread Dave Newton
--- On Mon, 6/30/08, Lukasz Lenart wrote:
 I said:
 Actually, you don't. If you're using Spring as
 the object factory and are auto-wiring by name 
 (which can, on occasion, lead to spectacular
 debugging opportunities) it's not necessary to 
 define the actions, AFAICT.
 
 But in such way, first action will be created by Struts and
 then Spring will inject dependency to it, does it?

I'm not sure what you're asking, but actions not defined in the Spring config 
file will still be injected by beans that *are* in the Spring config file.

Dave


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



Re: Struts2 + applicationContext.xml

2008-06-30 Thread Lukasz Lenart
 But in such way, first action will be created by Struts and
 then Spring will inject dependency to it, does it?

 I'm not sure what you're asking, but actions not defined in the Spring config 
 file will still be injected by beans that *are* in the Spring config file.

Exactly, first, Struts (default object factory) will create action
object and then it will *ask* Spring to inject depended beans, base on
applicationConfig.xml. I'm just wondering, if there any drawbacks for
this?


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

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



Re: Struts2 + applicationContext.xml

2008-06-30 Thread Frans Thamura
 I'm not sure what you're asking, but actions not defined in the Spring config 
 file will still be injected by beans that *are* in the Spring config file.



i think the idea to make the action package inside spring

i have experience, writing action is another bored repeated job

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



Where does o.a.s2.spring.interceptor.SessionContextAutowiringInterceptor live?

2008-06-30 Thread Dave Newton
It's referenced in the Spring plugin config but I don't see it anywhere.

Thanks,
Dave


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



Re: Spring Security and Struts2 Using tiles

2008-06-30 Thread Alberto A. Flores
I had to put those efforts on the side as it was in a prototype and 
proof of concept phase. However, I have just began (today) to officially 
make serious effort into making it work (if at all possible) for our 
project. I should have a better answer by the end of the day... but any 
feedback would be much appreciated...



JerryK wrote:

I was able to get this working with Acegi, by setting the Dispatcher property
in web.xml
url-pattern/*/url-pattern
dispatcherREQUEST/dispatcher
dispatcherINCLUDE/dispatcher
dispatcherFORWARD/dispatcher
/filter-mapping

But, now when i try this with Spring Security 2.0.1, i am facing the same
problem as you have described here. Have you found any solution so far?



Alberto A. Flores wrote:

Folks,

My understanding is that Spring Security does not secure resources on 
*forwards* (I believe tiles2 do forward/chaining). In an application 
using Struts2, Spring and Tiles2, these forwards work just fine. Has 
anyone had success using these three frameworks together using Spring 
Security? I tried it today and It turned out that the security tag 
(http://www.springframework/security/tags/):


   security:authorization property=principal.username/

never fetches anything. Furthermore, the code:

   SecurityContextHolder.getContext().getAuthentication()

returns null (in the forwarded jsp page). Has anyone know what to do in 
this case? I'm beginning to think I can not use Spring Security at all.


Regards,

--

Alberto A. Flores
http://www.linkedin.com/in/aflores



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





--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Re: Struts2 + applicationContext.xml

2008-06-30 Thread Alberto A. Flores
Have you considered using the @Controller annotation (stereotype) on all 
Struts2 Actions (this way, Spring knows the bean id name). You can 
always control the scoping of the object


@Controller(fooAction)
@Scope(request)
public class MyFooAction {
}

action class=fooAction name=foo/

I found this a cleaner (and easier) way to avoid having to maintain 
another XML for our presentation.



Frans Thamura wrote:

I'm not sure what you're asking, but actions not defined in the Spring config 
file will still be injected by beans that *are* in the Spring config file.




i think the idea to make the action package inside spring

i have experience, writing action is another bored repeated job

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




--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Re: Where does o.a.s2.spring.interceptor.SessionContextAutowiringInterceptor live?

2008-06-30 Thread Musachy Barroso
First time I hear about it, it should be in the spring plugin in any case.

musachy

On Mon, Jun 30, 2008 at 8:41 AM, Dave Newton [EMAIL PROTECTED] wrote:
 It's referenced in the Spring plugin config but I don't see it anywhere.

 Thanks,
 Dave


 -
 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: [S2] adding interceptor to all my actions

2008-06-30 Thread Vanja Petreski
Hello Paweł,

I have workaround:

1) Delete struts-default.xml from struts2 core jar

2) Move them to your application classpath

3) Rename existing struts-default to struts-default-original

4) At the end define your own package and call it struts-default: package
name=struts-default extends=struts-default-original namespace=/ and
put all your settings here (define your interceptors, stacks and set default
interceptor)

5) Delete struts.xml from your application classpath

That's it!

This is ugly, but there is no better solution for this problem right now.
Negative point for S2 team!

V

2008/6/28 Paweł Wielgus [EMAIL PROTECTED]:

 Hi Vanja,
 i din't solve the problem, someone said that package-info is working
 on trunk version (1.1.3 release?), but still it's not like the action
 in subpackage of a package with package-info will receive
 ParentPackage annotation - if i'm wrong i'll be very happy ;-)

 So i'm waiting for next release to give it a try.

 Best greetings,
 Pawel Wielgus.

 On 28/06/2008, Vanja Petreski [EMAIL PROTECTED] wrote:
  Anybody?
 
  package-info.java does not work!
 
  Struts 2.0.11.1
 
  Vanja
 
  2008/6/19 Paweł Wielgus [EMAIL PROTECTED]:
 
  Hi all,
  i'm trying to add my own interceptor to all of my actions.
  I know that i can define new package (default) and redefine default
  interceptor stack and then add @ParentPackage(default) to all my
  actions, but the question is how to do it in one place without having
  to add ParentPackage in all actions or writing configuration in xml?
 
  Best greetings,
  Paweł Wielgus.
 
 



Retrieve an hashtable entry within a jsp using struts tag and a bean as the key

2008-06-30 Thread Paolo Niccolò Giubelli

Hi!
I need a little help. I'm writing a jsp using struts tags and in my 
ActionForm class I put an Hashtable containing keys and values (both are 
pojos).

I can get my hashtable in this way:

bean:define id=ht name=myForm property=productsCategories/

The key is also a bean, obtained through a (working) logic:iterate:
logic:iterate id=product name=myForm property=lastProducts

How can I retrieve a value from ht using product as the key?
I tried as I usually do with hashtables, using
bean:define id=xyz name=ht property=product/ (and then 
bean:writing some properties) but, as I expected, it doesn't work.

Ideas?

Thank you in advance!





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



RE: Struts2 + applicationContext.xml

2008-06-30 Thread Brad A Cupit
Lukasz Lenart wrote:
 Exactly, first, Struts (default object factory) will
 create action object and then it will *ask* Spring
 to inject depended beans, base on applicationConfig.xml.
 I'm just wondering, if there any drawbacks for this?

The only one I can think of is that your actions wouldn't actually be Spring 
managed, so they wouldn't be available for AOP.

The Spring2-Spring plugin will first ask Spring for the action, then, if it's 
not found, the Struts2-Spring plugin will create the action and have it 
autowired with other Spring beans (as you and Dave have mentioned).

An alternative that I'm currently enjoying is what I call zero-config Spring 
and Struts 2. I don't define any Actions in applicationContext.xml nor do I 
define any actions in struts.xml. Spring 2.5 has some incredible classpath 
scanning features, where you can annotate your Spring beans (including Actions) 
with @Component or @Repository, etc, and Spring can pick them up automatically. 
Even better than that, if you have a particular package that you put all your 
actions in, you can tell Spring to configure a bean for each class in that 
package, so you don't even have to annotate those classes.

Combine the above with zero-config and the code behind plugin for Struts 2 
(plus a little bit of magic [1]) and you can have a wonderful environment where 
Spring and Struts pick everything up on their own (meaning, no xml to edit each 
time you want to add an action, DAO, etc.)

[1] https://issues.apache.org/struts/browse/WW-2558#action_43525

Brad Cupit
Louisiana State University - UIS


JAZN Exception when posting form with ecntype=multipart/form-data

2008-06-30 Thread Dimitris Mouchritsas

Hi all,
we've recently upgraded our j2ee application to use struts 1.3.8 and 
we're getting a weird exception when trying to

upload a file. Here's the jsp:

testFileUpload.jsp
=
%@ page contentType=text/html;charset=utf-8%
%@ taglib uri=/WEB-INF/tlds/struts-tiles.tld prefix=tiles%
%@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean%
%@ taglib uri=/WEB-INF/tlds/struts-html.tld prefix=html%
%@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic%

html:xhtml /

html:form method=post action=test/prepareTestFileUpload 
enctype=multipart/form-data 
  p

   label for=Attachment class=w33
   span class=Mandatory*/span Attachment:
   /label
   html:file property=attachment styleId=Attachment 
styleClass=w33 size=40 /

   /p
   pbutton type=submitSave changes/button/p   
/html:form

===
  
Here's the action:


//--
//$Id: PrepareTestFileUploadAction.java,v 1.1 2008/06/30 12:26:53 kshe Exp $
//$Author: kshe $
//$Date: 2008/06/30 12:26:53 $
//$Revision: 1.1 $
//--
package my.company.web.actions.test;

import java.rmi.RemoteException;

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

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;


import my.company.web.actions.common.BaseAction;

import my.company.web.forms.TestUploadForm;

/**
* @custom.security-filter operation=public
*
* @struts.action path=/test/prepareTestFileUpload
*name=testUploadForm input=/test/prepareTestFileUpload
*
* @struts.action-forward name=goForward path=test.file.upload
*/
public class PrepareTestFileUploadAction extends BaseAction {

   private static Logger log = 
Logger.getLogger(PrepareTestFileUploadAction.class);
  


   public PrepareTestFileUploadAction()  {
   super();
   }

   public ActionForward doExecute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
   throws RepException, RemoteException {

   String forward = goForward;
   TestUploadForm testForm = (TestUploadForm)form;

   FormFile file = testForm.getAttachment();

   if (file != null) {
   log.debug(File:  + file.getFileName());
   } else {
   log.debug(File == null);
   }


   return mapping.findForward(forward);
   }
}


It seems we're able to get the filename on the server side, but when it 
tries to go forward

here's the exception we get:

Caused by: javax.servlet.ServletException: JAAS-OC4J: 
JAZNFilter.doFilter - unable to find the current servlet

   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
   at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
   at 
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
   at 
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
   at 
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
   at 
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
   at 

Re: [S2] adding interceptor to all my actions

2008-06-30 Thread Paweł Wielgus
Hello Vanja,
i'm aware of such solution, but as You sad it's a dirty hack
and as for hacks - they tend to work only for a few next releases.

So You have to keep in mind that it will fail in let's say 2.1.4
because of some changes to the stack or interceptors
and thats exactly why we din't make it this way.

You may think i'm too much paranoic about it
but we really had such an issue with interceptors
and overwriting default stack in struts-default.xml

Still S2 is my weapon of choise,
so i'm just waiting for 2.1.3 where it will read ParentPackage fom package,
then maybe i will be able to add searching it up the package tree
or anything else that will do the job.

Best greetings,
Paweł Wielgus.


On 30/06/2008, Vanja Petreski [EMAIL PROTECTED] wrote:
 Hello Paweł,

  I have workaround:

  1) Delete struts-default.xml from struts2 core jar

  2) Move them to your application classpath

  3) Rename existing struts-default to struts-default-original

  4) At the end define your own package and call it struts-default: package
  name=struts-default extends=struts-default-original namespace=/ and
  put all your settings here (define your interceptors, stacks and set default
  interceptor)

  5) Delete struts.xml from your application classpath

  That's it!

  This is ugly, but there is no better solution for this problem right now.
  Negative point for S2 team!

  V

  2008/6/28 Paweł Wielgus [EMAIL PROTECTED]:

   Hi Vanja,
   i din't solve the problem, someone said that package-info is working
   on trunk version (1.1.3 release?), but still it's not like the action
   in subpackage of a package with package-info will receive
   ParentPackage annotation - if i'm wrong i'll be very happy ;-)
  
   So i'm waiting for next release to give it a try.
  
   Best greetings,
   Pawel Wielgus.
  
   On 28/06/2008, Vanja Petreski [EMAIL PROTECTED] wrote:
Anybody?
   
package-info.java does not work!
   
Struts 2.0.11.1
   
Vanja
   
2008/6/19 Paweł Wielgus [EMAIL PROTECTED]:
   
Hi all,
i'm trying to add my own interceptor to all of my actions.
I know that i can define new package (default) and redefine default
interceptor stack and then add @ParentPackage(default) to all my
actions, but the question is how to do it in one place without having
to add ParentPackage in all actions or writing configuration in xml?
   
Best greetings,
Paweł Wielgus.
   
   
  



Where are the @Result,@Results annotations in Struts 2.1.2

2008-06-30 Thread Oren Livne

Dear All,
I am trying to use @Result and @Results with struts 2.1.2 (configured 
via maven dependencies).
I can't find it anywhere. Has it been moved or deprecated? Is there a 
link with more info on that?

Thanks,
Oren

--
===
I can stand brute force, but brute reason is quite unbearable.
-- Oscar Wilde
---
Oren Livne, Ph.D.
RUReady Software Architect
Academic Outreach and Continuing Education, 1901 E South Campus Dr.
Room 2197-D, University of Utah, Salt Lake City, UT 84112-9399
Tel  : (801) 581-6831 Cell: (801) 631-3885 Fax: (801) 585-5414
Email: [EMAIL PROTECTED]  Web:  http://ruready.net/oren
===


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



Re: Retrieve an hashtable entry within a jsp using struts tag and a bean as the key

2008-06-30 Thread Ciro Montanino
Try to use jstl tag library to read HashTable contents.

On Mon, Jun 30, 2008 at 4:29 PM, Paolo Niccolò Giubelli 
[EMAIL PROTECTED] wrote:

 Hi!
 I need a little help. I'm writing a jsp using struts tags and in my
 ActionForm class I put an Hashtable containing keys and values (both are
 pojos).
 I can get my hashtable in this way:

 bean:define id=ht name=myForm property=productsCategories/

 The key is also a bean, obtained through a (working) logic:iterate:
 logic:iterate id=product name=myForm property=lastProducts

 How can I retrieve a value from ht using product as the key?
 I tried as I usually do with hashtables, using
 bean:define id=xyz name=ht property=product/ (and then bean:writing
 some properties) but, as I expected, it doesn't work.
 Ideas?

 Thank you in advance!





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




-- 
Ciro Montanino
Milano - Italy
Mailto: [EMAIL PROTECTED]


[S2] adding serialVersionUID to actions

2008-06-30 Thread Gabriel Belingueres
Hi,

Is there any value in adding the serialVersionUID to all our actions?
My idea is just to add a @SupressWarning(serial) to each action.

AFAIK, the actions are newly created in each request and are never put
into session or application scope (by Struts itself at least).

Any ideas of why the ActionSupport class implements java.io.Serializable?

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



[s] Validity of user session

2008-06-30 Thread Milan Milanovic

Hi,

I have an SessionAware-based action class, where I put some variables into
session when user came to the page which is backed up with that action
class. I'm wondering what is validity of that session object, because I'm
not sure if I have possibility to clear user session ? So I need to know
when session will be deleted with all its objects inside ? When user go to
some other page which is not backed-up with this class or some other action
class ?

--
Thx, Milan
-- 
View this message in context: 
http://www.nabble.com/-s--Validity-of-user-session-tp18197953p18197953.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: Retrieve an hashtable entry within a jsp using struts tag and a bean as the key

2008-06-30 Thread Paolo Niccolò Giubelli

I'm sorry, but I'm still unable to do that.
Ciro Montanino ha scritto:

Try to use jstl tag library to read HashTable contents.

On Mon, Jun 30, 2008 at 4:29 PM, Paolo Niccolò Giubelli 
[EMAIL PROTECTED] wrote:


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



Re: Where are the @Result,@Results annotations in Struts 2.1.2

2008-06-30 Thread Al Sutton

http://struts.apache.org/2.1.2/docs/result-annotation.html

Oren Livne wrote:

Dear All,
I am trying to use @Result and @Results with struts 2.1.2 (configured 
via maven dependencies).
I can't find it anywhere. Has it been moved or deprecated? Is there a 
link with more info on that?

Thanks,
Oren




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



Re: action param-element not working ?

2008-06-30 Thread Hanson Char
That works!  Thanks :)

On Mon, Jun 30, 2008 at 1:16 AM, Lukasz Lenart [EMAIL PROTECTED]
wrote:

 Hi,

 Did you use stack with
 interceptor name=staticParams
 class=com.opensymphony.xwork2.interceptor.StaticParametersInterceptor/
 ?


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

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




Re: action param-element not working ?

2008-06-30 Thread Hanson Char
On the other hand, if a param-element is specified in an action, shouldn't
it just work as expected ?  What is the rationale behind requiring the user
to further configure a staticParams interceptor in order to get the
param-element to work ?  Or is this just an accidental/convenient decision ?

Hanson

On Mon, Jun 30, 2008 at 9:14 AM, Hanson Char [EMAIL PROTECTED] wrote:

 That works!  Thanks :)


 On Mon, Jun 30, 2008 at 1:16 AM, Lukasz Lenart 
 [EMAIL PROTECTED] wrote:

 Hi,

 Did you use stack with
 interceptor name=staticParams
 class=com.opensymphony.xwork2.interceptor.StaticParametersInterceptor/
 ?


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

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





Struts 2 + Ajax and Back Button

2008-06-30 Thread cree

Hello All,

I am attempting to resolve the ajax back button problem and have gotten into
a situation.  I am using struts v 2.0.11 and I know it comes with its own
dojotoolkit.  However I cannot find any support for the back button.  I
looked throughout and found dojotoolkit v1.1 and downloaded it.  It has a
back button fix in which I need to use.

When I tried to implement it I used its tutorial code, which includes
importing the version 1.1 dojo.js.  Inside the jsp I am using an s:div
theme=ajax and also including s:head theme=ajax.  When the jsp loads it
has a confliction with the version 1.1 dojo.js and the version of dojo.js
that is in struts 2.0.11.  

I tried to include all the javascript that is necessary to invoke the dojo
1.1 that I downloaded in the other jsp (the jsp that gets loaded when the
s:div href gets called).  And the javascript isnt being loaded or if it is,
it would not go any further then when I load back.js.  

I guess in short I am looking to see if there is any way that I can utilize
the back.js in the other jsp or throughout the two jsp's or if there is
support in struts 2.0.11's dojo toolkit.  

Always, thank you all very much,

Cree
-- 
View this message in context: 
http://www.nabble.com/Struts-2-%2B-Ajax-and-Back-Button-tp18200250p18200250.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 + Ajax and Back Button

2008-06-30 Thread Dave Newton
--- On Mon, 6/30/08, cree [EMAIL PROTECTED] wrote:
 I guess in short I am looking to see if there is any way
 that I can utilize the back.js in the other jsp or throughout 
 the two jsp's or if there is support in struts 2.0.11's dojo toolkit.

S2 currently uses Dojo 0.4.3 (give or take). I'd be surprised if 
mix-and-matching led to anything other than frustration, but I don't know that 
it's impossible.

Dave

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



Re: Struts 2 + Ajax and Back Button

2008-06-30 Thread Musachy Barroso
Just to confirm what Dave said, do not mix Dojo versions. If you need
Dojo 1.x, you are better off not using the s2 ajax tags at all.

musachy

On Mon, Jun 30, 2008 at 1:23 PM, Dave Newton [EMAIL PROTECTED] wrote:
 --- On Mon, 6/30/08, cree [EMAIL PROTECTED] wrote:
 I guess in short I am looking to see if there is any way
 that I can utilize the back.js in the other jsp or throughout
 the two jsp's or if there is support in struts 2.0.11's dojo toolkit.

 S2 currently uses Dojo 0.4.3 (give or take). I'd be surprised if 
 mix-and-matching led to anything other than frustration, but I don't know 
 that it's impossible.

 Dave

 -
 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: action param-element not working ?

2008-06-30 Thread Lukasz Lenart
2008/6/30 Hanson Char [EMAIL PROTECTED]:
 On the other hand, if a param-element is specified in an action, shouldn't
 it just work as expected ?  What is the rationale behind requiring the user
 to further configure a staticParams interceptor in order to get the
 param-element to work ?  Or is this just an accidental/convenient decision ?

I don't know, but probably optimization, not all actions use such
parameters, so it's up to you when to use it.


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

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



Re: Struts 2 + Ajax and Back Button

2008-06-30 Thread cree

Thank you all for your replies.

I guess at this point I would ask if there is any back button fix at all
under struts 2?  Or should I go with:


Musachy Barroso wrote:
 
 Just to confirm what Dave said, do not mix Dojo versions. If you need
 Dojo 1.x, you are better off not using the s2 ajax tags at all.
 
 musachy
 
 

Thanks again,

Cree
-- 
View this message in context: 
http://www.nabble.com/Struts-2-%2B-Ajax-and-Back-Button-tp18200250p18201248.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 + Ajax and Back Button

2008-06-30 Thread Owen Berry
Dojo 0.4 back button support:

http://dojotoolkit.org/book/dojo-book-0-4/part-7-utilities/back-button-and-bookmarking

What version of Dojo is included with Struts 2.0.11? Is it 0.4?

On Mon, Jun 30, 2008 at 2:15 PM, cree [EMAIL PROTECTED] wrote:

 Thank you all for your replies.

 I guess at this point I would ask if there is any back button fix at all
 under struts 2?  Or should I go with:


 Musachy Barroso wrote:

 Just to confirm what Dave said, do not mix Dojo versions. If you need
 Dojo 1.x, you are better off not using the s2 ajax tags at all.

 musachy



 Thanks again,

 Cree
 --
 View this message in context: 
 http://www.nabble.com/Struts-2-%2B-Ajax-and-Back-Button-tp18200250p18201248.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: Struts 2 + Ajax and Back Button

2008-06-30 Thread cree



Owen Berry wrote:
 
 Dojo 0.4 back button support:
 
 http://dojotoolkit.org/book/dojo-book-0-4/part-7-utilities/back-button-and-bookmarking
 
 What version of Dojo is included with Struts 2.0.11? Is it 0.4?
 
 

From my readings it supported 0.4.x, dave mentioned possibly 0.4.5.  Thanks
for that link I will read into it a bit and see what I get.
-- 
View this message in context: 
http://www.nabble.com/Struts-2-%2B-Ajax-and-Back-Button-tp18200250p18201396.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 - Repopulate controls when validation fails

2008-06-30 Thread bob fuller

Setting the s:action's ignoreContextParams to true partially resolves the issue 
I am having. Here's my pseudo jsp now...

s:form name=myAction
s:textfield name=foo0/
s:action name=languages ignoreContextParams=true executeResult=true/
s:textfield name=foo1/
s:submit/
/s:form

Now, the troublesome second invocation of MyAction.setFoo1() is not occurring, 
but my issue is only partially resolved because I still do not understand what 
is happening. What is the relationship between s:action and the s:form it is 
inside that causes MyAction.setFoo1() to be invoked 'again' after s:action is 
finished with its execution?

 From: [EMAIL PROTECTED]
 To: user@struts.apache.org
 Subject: RE: Struts 2 - Repopulate controls when validation fails
 Date: Thu, 26 Jun 2008 19:52:51 +
 
 
 The approach I am taking is from the Struts 2 FAQ...
 
 http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
 
 Why should it be avoided?
 
 
  Date: Thu, 26 Jun 2008 08:32:37 +0200
  From: [EMAIL PROTECTED]
  To: user@struts.apache.org
  Subject: Re: Struts 2 - Repopulate controls when validation fails
  
  Hi,
  
  As I know, use of s:action tag should be avoided, the better option is
  to use Preparable interface, you can use prepareMethodName() method
  also.
  http://struts.apache.org/2.x/docs/prepare-interceptor.html
  
  
  Regards
  -- 
  Lukasz
  http://www.lenart.org.pl/
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  From: [EMAIL PROTECTED]
  To: user@struts.apache.org
  Subject: RE: Struts 2 - Repopulate controls when validation fails
  Date: Thu, 26 Jun 2008 02:17:36 +
  
  
  Trying again to give out my pseudo JSP...
  
  s:form name=myAction
  s:textfield name=foo0/
  s:action name=languages executeResult=true/
  s:textfield name=foo1/
  s:submit/
  /s:form
  
   From: [EMAIL PROTECTED]
   To: user@struts.apache.org
   Subject: Struts 2 - Repopulate controls when validation fails
   Date: Thu, 26 Jun 2008 02:14:28 +
   
   
   I'm following the How do we repopulate controls when validation fails 
   FAQ located at...
   
   http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html
   
   Of the two methods it suggests I am trying to use the 'action tag' 
   method. Using the simple example from the FAQ works fine, but once I move 
   beyond the simple and try to drop my Languages control inside the  tag 
   of another action I have problems.
   
   Here's my pseudo JSP (note MyAction)...
   
   
   
   
   
   
   
   
   
   MyAction implements validateable and I am validating foo0 and foo1 inside 
   the validate() method. Here's my validate() code...
   
   public void validate() {
   if (foo0 == null || foo0.length() == 0)
 addFieldError(foo0, Foo0 is required);
   else
 foo0 = foo0 +  VALIDATED;
   
   if (foo1 == null || foo1.length() == 0)
 addFieldError(foo1, Foo1 is required);
   else
 foo1 = foo1 +  VALIDATED; 
   }
   
   The important thing to note about my validation code is that when the 
   validation succeeds the data entered by the user is updated with the word 
   VALIDATED. This may seem like an odd thing to do, but it's part of the 
   requirements of the project I'm working on.
   
   Visiting http://localhost/MyAction/myAction_input.action works great. The 
   page draws, foo0 is empty, the languages control has languages to choose 
   from, foo1 is empty, the submit button appears. Submitting the form is 
   when I get into problems. Here are three submit paths and their results...
   
   1. foo0 is empty, foo1 is empty. click submit. RESULT - foo0 is empty. 
   foo1 is empty. SUCCESS!
   2. foo0 = 'A', foo1 is empty. click submit. RESULT - page redraws. foo0 = 
   'A VALIDATED'. foo1 is empty. SUCCESS!
   3. foo0 is empty, foo1 = 'A'. click submit. RESULT - page redraws. foo0 
   is empty. foo1 = 'A'. FAIL! - foo1 should say 'A VALIDATED'
   
   For some reason MyAction.setFoo1() is being invoked *again* after I set 
   foo1 to 'A VALIDATED' in my validate() code. Why is that happening? I 
   know it has something to do with the Languages control that appears 
   before the foo1 text field, because when I remove the Languages control 
   everything works as expected.
   
   Anyone have any ideas about what the Languages control is doing that is 
   causing my foo1 field to get reset to the original submit value? I'd 
   really like to be able to use the 'action tags' approach for repopulating 
   controls, but 'dropping wherever', as suggested in the FAQ (see link 
   above), does not seem to be as easy as it sounds.
   
   Thanks.
   
   
   
   
   
   
   
   
   

   
   _
   The other season of giving begins 6/24/08. Check out the i’m Talkathon.
   

Unit Testing Struts 2 Actions

2008-06-30 Thread Greg Lindholm
I've spent a lot of time in the debugger over the last few days trying to 
figure out how to unit test struts 2 actions with the Interceptor stack so that 
validation and results configuration etc. were also tested.

I wrote a unit test helper class and posted it and a description here Unit 
Testing Struts 2 Actions [1] hopefully others will find this helpful.

[1] http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/




  

Re: Where are the @Result,@Results annotations in Struts 2.1.2

2008-06-30 Thread olivne

Dear Al,

I know about this url, but it doesn't work for me. Am I missing a maven
dependency? Here are my struts dependencies in my maven pom.xml :

...
!-- Struts 2 --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version2.1.2/version
/dependency
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-sitemesh-plugin/artifactId
version2.1.2/version
/dependency
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-spring-plugin/artifactId
version2.1.2/version
/dependency

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-dojo-plugin/artifactId
version2.1.2/version
/dependency

!-- Tiles 2 --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-tiles-plugin/artifactId
version2.1.2/version
/dependency

dependency
groupIdorg.apache.tiles/groupId
artifactIdtiles-jsp/artifactId
version2.0.6/version
/dependency
...



Al Sutton wrote:
 
 http://struts.apache.org/2.1.2/docs/result-annotation.html
 
 Oren Livne wrote:
 Dear All,
 I am trying to use @Result and @Results with struts 2.1.2 (configured 
 via maven dependencies).
 I can't find it anywhere. Has it been moved or deprecated? Is there a 
 link with more info on that?
 Thanks,
 Oren
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Where-are-the-%40Result%2C%40Results-annotations-in-Struts-2.1.2-tp18197518p18204760.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 are the @Result,@Results annotations in Struts 2.1.2

2008-06-30 Thread Musachy Barroso
Yes, you are missing struts2-codebehind-plugin.

musachy

On Mon, Jun 30, 2008 at 5:28 PM, olivne [EMAIL PROTECTED] wrote:

 Dear Al,

 I know about this url, but it doesn't work for me. Am I missing a maven
 dependency? Here are my struts dependencies in my maven pom.xml :

 ...
!-- Struts 2 --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version2.1.2/version
/dependency
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-sitemesh-plugin/artifactId
version2.1.2/version
/dependency
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-spring-plugin/artifactId
version2.1.2/version
/dependency

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-dojo-plugin/artifactId
version2.1.2/version
/dependency

!-- Tiles 2 --
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-tiles-plugin/artifactId
version2.1.2/version
/dependency

dependency
groupIdorg.apache.tiles/groupId
artifactIdtiles-jsp/artifactId
version2.0.6/version
/dependency
 ...



 Al Sutton wrote:

 http://struts.apache.org/2.1.2/docs/result-annotation.html

 Oren Livne wrote:
 Dear All,
 I am trying to use @Result and @Results with struts 2.1.2 (configured
 via maven dependencies).
 I can't find it anywhere. Has it been moved or deprecated? Is there a
 link with more info on that?
 Thanks,
 Oren



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




 --
 View this message in context: 
 http://www.nabble.com/Where-are-the-%40Result%2C%40Results-annotations-in-Struts-2.1.2-tp18197518p18204760.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]



[S2] Pre-populating Checkboxes

2008-06-30 Thread David Ogasawara
Hello,

I'm new to Struts 2 and I was wondering how to pre-populate checkboxes
with values from a database (or even hard-coded values).  I am iterating
through an arraylist of hashmaps (description, type_cd) to create the
checkboxes in the form.  I then create a string array with the values
from a database to pre-populate, but it's not working.  

* When the checkboxes are checked and the form is submitted, I am able
to capture the values (String array) properly.


JSP:
s:iterator value=all_type_codes
s:checkbox name=type_cd fieldValue=%{type_cd}/
s:property value=description/
  br
/s:iterator



Action Page:
public String[] getType_cd() {
return type_cd;
}
public void setType_cd(String[] type_cd) {
this.type_cd = type_cd;
}

// this is a test
type_cd = new String[3];
type_cd[0] = EQ;
type_cd[1] = SF;
type_cd[2] = SS;



Any help would be greatly appreciated!

-Dave

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



Re: [struts] Slow performance with Struts2

2008-06-30 Thread DNewfield

yorlick kilroy wrote:
 thx! you made my day :-) that did the trick!
 replacing freemarker 2.3.8 with 2.3.13 speeded up my application by almost
 100%

Could you re-run your OGNL 2.6.11 vs. 2.7.2 tests with freemarker 2.3.13 in
place, and see if the upgrade is still a performance downgrade as your
previous tests indicated?  (Did you include javassist?)

-Dale
-- 
View this message in context: 
http://www.nabble.com/Slow-performance-with-Struts2-tp18092204p18206304.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]



[S2] sx:head and the scripts paths

2008-06-30 Thread Pierre Thibaudeau
I am playing with Struts 2.1.2.   (I have seen several other related topics
on this mailing list but nothing quite explicitely about what follows.)

I add the following tag inside the head:

sx:head baseRelativePath=../scripts/dojo debug=true cache=false
compressed=false /

Unsurprisingly, this yields the following in the html:

script language=JavaScript type=text/javascript
// Dojo configuration
djConfig = { isDebug: true, bindEncoding: UTF-8, baseRelativePath:
../scripts/dojo, baseScriptUri: ../scripts/dojo, parseWidgets : false };
/script
script language=JavaScript type=text/javascript
src=../scripts/dojo/dojo.js.uncompressed.js/script

So far so good.  The problem is what follows:

script language=JavaScript type=text/javascript
src=/myapp/struts/ajax/dojoRequire.js/script
link rel=stylesheet href=/myapp/struts/xhtml/styles.css
type=text/css/
script language=JavaScript src=/myapp/struts/utils.js
type=text/javascript/script
script language=JavaScript src=/myapp/struts/xhtml/validation.js
type=text/javascript/script
script language=JavaScript src=/myapp/struts/css_xhtml/validation.js
type=text/javascript/script

Where do these paths come from?  I certainly don't have a struts/ folder
inside my WebRoot...  Wasn't the baseRelativePath parameter of the
sx:head tag supposed to deal with that kind of issues?  Is there a way of
customizing this?


Re: [S2] sx:head and the scripts paths

2008-06-30 Thread Musachy Barroso
struts maps to a folder inside the struts-core jar. Those files are
used for validation and are not related to dojo (nothing to do with
head tag)

musachy

On Mon, Jun 30, 2008 at 10:01 PM, Pierre Thibaudeau
[EMAIL PROTECTED] wrote:
 I am playing with Struts 2.1.2.   (I have seen several other related topics
 on this mailing list but nothing quite explicitely about what follows.)

 I add the following tag inside the head:

 sx:head baseRelativePath=../scripts/dojo debug=true cache=false
 compressed=false /

 Unsurprisingly, this yields the following in the html:

 script language=JavaScript type=text/javascript
 // Dojo configuration
 djConfig = { isDebug: true, bindEncoding: UTF-8, baseRelativePath:
 ../scripts/dojo, baseScriptUri: ../scripts/dojo, parseWidgets : false };
 /script
 script language=JavaScript type=text/javascript
 src=../scripts/dojo/dojo.js.uncompressed.js/script

 So far so good.  The problem is what follows:

 script language=JavaScript type=text/javascript
 src=/myapp/struts/ajax/dojoRequire.js/script
 link rel=stylesheet href=/myapp/struts/xhtml/styles.css
 type=text/css/
 script language=JavaScript src=/myapp/struts/utils.js
 type=text/javascript/script
 script language=JavaScript src=/myapp/struts/xhtml/validation.js
 type=text/javascript/script
 script language=JavaScript src=/myapp/struts/css_xhtml/validation.js
 type=text/javascript/script

 Where do these paths come from?  I certainly don't have a struts/ folder
 inside my WebRoot...  Wasn't the baseRelativePath parameter of the
 sx:head tag supposed to deal with that kind of issues?  Is there a way of
 customizing this?




-- 
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: [S2] sx:head and the scripts paths

2008-06-30 Thread Pierre Thibaudeau
2008/6/30 Musachy Barroso [EMAIL PROTECTED]:

 struts maps to a folder inside the struts-core jar. Those files are
 used for validation and are not related to dojo (nothing to do with
 head tag)


Thank you, Musachy, for the head's up!

Though I must add that, within that setup, javascript throws a dojo not
defined error on the following line:

script language=JavaScript
type=text/javascriptdojo.hostenv.writeIncludes(true);/script

Maybe I should add that ../scripts/dojo (as refered to by baseRelativePath)
contains the latest release of dojo.  Is that a problem?


Re: [S2] Pre-populating Checkboxes

2008-06-30 Thread Nuwan Chandrasoma

Hi,

This is how i do it, i have implemented the prepreable interface in my 
action and in prepare method, i populate the list i wanted to display in 
as check box values.


eg:-

   private List skills;  


   public List getSkills() {
   return skills;
   }

   public void prepare() throws Exception {
   skills = new ArrayList();
   skills.add(Java);
   skills.add(C#);
   skills.add(Spring);
   skills.add(Struts 2);
   }

in jsp i have this tag and which will render 4 check boxes.

s:checkboxlist name=skill list=skills/

Thanks,

Nuwan



David Ogasawara wrote:

Hello,

I'm new to Struts 2 and I was wondering how to pre-populate checkboxes
with values from a database (or even hard-coded values).  I am iterating
through an arraylist of hashmaps (description, type_cd) to create the
checkboxes in the form.  I then create a string array with the values
from a database to pre-populate, but it's not working.  


* When the checkboxes are checked and the form is submitted, I am able
to capture the values (String array) properly.


JSP:
s:iterator value=all_type_codes
s:checkbox name=type_cd fieldValue=%{type_cd}/
s:property value=description/
  br
/s:iterator



Action Page:
public String[] getType_cd() {
return type_cd;
}
public void setType_cd(String[] type_cd) {
this.type_cd = type_cd;
}

// this is a test
type_cd = new String[3];
type_cd[0] = EQ;
type_cd[1] = SF;
type_cd[2] = SS;



Any help would be greatly appreciated!

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