Author Login
Post Reply
user Digest 1 Jul 2008 11:28:24 -0000 Issue 8118
Topics (messages 188316 through 188345):
JAZN Exception when posting form with ecntype="multipart/form-data"
188316 by: Dimitris Mouchritsas
188345 by: Dimitris Mouchritsas
Re: [S2] adding interceptor to all my actions
188317 by: Pawe³ Wielgus
Where are the @Result,@(protected)
188318 by: Oren Livne
188323 by: Al Sutton
188335 by: Oren Livne
188336 by: Musachy Barroso
Re: Retrieve an hashtable entry within a jsp using struts tag and a bean as the key
188319 by: Ciro Montanino
188322 by: Paolo Niccolò Giubelli
[S2] adding serialVersionUID to actions
188320 by: Gabriel Belingueres
[s] Validity of user session
188321 by: Milan Milanovic
Re: action param-element not working ?
188324 by: Hanson Char
188325 by: Hanson Char
188329 by: Lukasz Lenart
Struts 2 + Ajax and Back Button
188326 by: cree
188327 by: Dave Newton
188328 by: Musachy Barroso
188330 by: cree
188331 by: Owen Berry
188332 by: cree
188344 by: duschhaube
Re: Struts 2 - Repopulate controls when validation fails
188333 by: bob fuller
Unit Testing Struts 2 Actions
188334 by: Greg Lindholm
[S2] Pre-populating Checkboxes
188337 by: David Ogasawara
188342 by: Nuwan Chandrasoma
Re: [struts] Slow performance with Struts2
188338 by: DNewfield
[S2] <sx:head> and the scripts paths
188339 by: Pierre Thibaudeau
188340 by: Musachy Barroso
188341 by: Pierre Thibaudeau
Re: Validation doubt
188343 by: Narayana S
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_188316.ezm (zipped)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
=================================================================================================
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<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>
<p><button type="submit">Save 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
com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:196)
at
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
at
com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:138)
at
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
at
com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
... 4 more
-----
Any ideas what could be wrong?
Thanks
Dimitris

Attachment:
user_188345.ezm (zipped)Dimitris Mouchritsas wrote:
> 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
> =================================================================================================
>
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)"%>
>
> <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>
> <p><button type="submit">Save 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
> com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:196)
>
> at
> com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
>
> at
> com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:138)
>
> at
> com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
>
> at
> com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
>
> at
> com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
>
> at
> com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
>
> at
> com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
>
> ... 4 more
> -----
>
>
> Any ideas what could be wrong?
>
> Thanks
> Dimitris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
I added some code and I can see that I get the filename from the
formbean FormFile. But when it tries to
forward to the next action we get the exception. Any ideas?
Dimitris

Attachment:
user_188317.ezm (zipped)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 <vpetreski@(protected):
> 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 <poulwiel@(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 <vpetreski@(protected):
> > > Anybody?
> > >
> > > package-info.java does not work!
> > >
> > > Struts 2.0.11.1
> > >
> > > Vanja
> > >
> > > 2008/6/19 Paweł Wielgus <poulwiel@(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.
> > >>
> > >
> >
>

Attachment:
user_188318.ezm (zipped)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: olivne@(protected)
===========================================================================

Attachment:
user_188323.ezm (zipped)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
>

Attachment:
user_188335.ezm (zipped)
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>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dojo-plugin</artifactId>
<version>2.1.2</version>
</dependency>
<!-- Tiles 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188336.ezm (zipped)Yes, you are missing struts2-codebehind-plugin.
musachy
On Mon, Jun 30, 2008 at 5:28 PM, olivne <olivne@(protected):
>
> 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>
> <groupId>org.apache.struts</groupId>
> <artifactId>struts2-core</artifactId>
> <version>2.1.2</version>
> </dependency>
> <dependency>
> <groupId>org.apache.struts</groupId>
> <artifactId>struts2-sitemesh-plugin</artifactId>
> <version>2.1.2</version>
> </dependency>
> <dependency>
> <groupId>org.apache.struts</groupId>
> <artifactId>struts2-spring-plugin</artifactId>
> <version>2.1.2</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.struts</groupId>
> <artifactId>struts2-dojo-plugin</artifactId>
> <version>2.1.2</version>
> </dependency>
>
> <!-- Tiles 2 -->
> <dependency>
> <groupId>org.apache.struts</groupId>
> <artifactId>struts2-tiles-plugin</artifactId>
> <version>2.1.2</version>
> </dependency>
>
> <dependency>
> <groupId>org.apache.tiles</groupId>
> <artifactId>tiles-jsp</artifactId>
> <version>2.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: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_188319.ezm (zipped)Try to use jstl tag library to read HashTable contents.
On Mon, Jun 30, 2008 at 4:29 PM, Paolo Niccolò Giubelli <
paoloniccolo.giubelli@(protected):
> 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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Ciro Montanino
Milano - Italy
Mailto: 300503@(protected)

Attachment:
user_188322.ezm (zipped)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 <
> paoloniccolo.giubelli@(protected):

Attachment:
user_188320.ezm (zipped)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?

Attachment:
user_188321.ezm (zipped)
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
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188324.ezm (zipped)That works! Thanks :)
On Mon, Jun 30, 2008 at 1:16 AM, Lukasz Lenart <lukasz.lenart@(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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188325.ezm (zipped)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 <hanson.char@(protected):
> That works! Thanks :)
>
>
> On Mon, Jun 30, 2008 at 1:16 AM, Lukasz Lenart <
> lukasz.lenart@(protected):
>
>> 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: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_188329.ezm (zipped)2008/6/30 Hanson Char <hanson.char@(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/

Attachment:
user_188326.ezm (zipped)
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
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188327.ezm (zipped)--- On Mon, 6/30/08, cree <vint@(protected):
> 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

Attachment:
user_188328.ezm (zipped)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 <newton.dave@(protected):
> --- On Mon, 6/30/08, cree <vint@(protected):
>> 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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_188330.ezm (zipped)
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
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188331.ezm (zipped)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 <vint@(protected):
>
> 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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188332.ezm (zipped)
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.
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188344.ezm (zipped)Hi,
I use dojo 1.1 and struts-dojo-tags at the same time and it works.
her you find the documentation.
http://dojotoolkit.org/book/book-dojo/part-3-javascript-programming-dojo-and-dijit/multiple-versions-dojo-page
cree schrieb:
> 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

Attachment:
user_188333.ezm (zipped)
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: bobfuller30004@(protected)
> To: user@(protected)
> Subject: RE: Struts 2 - Repopulate controls when validation fails
> Date: Thu, 26 Jun 2008 19:52:51 +0000
>
>
> 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: lukasz.lenart@(protected)
> > To: user@(protected)
> > 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 prepare<MethodName>() method
> > also.
> > http://struts.apache.org/2.x/docs/prepare-interceptor.html
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> > From: bobfuller30004@(protected)
> > To: user@(protected)
> > Subject: RE: Struts 2 - Repopulate controls when validation fails
> > Date: Thu, 26 Jun 2008 02:17:36 +0000
> >
> >
> > 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: bobfuller30004@(protected)
> > > To: user@(protected)
> > > Subject: Struts 2 - Repopulate controls when validation fails
> > > Date: Thu, 26 Jun 2008 02:14:28 +0000
> > >
> > >
> > > 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.
> > > http://www.imtalkathon.com?source=TXT_EML_WLH_SeasonOfGiving
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> >
> > _________________________________________________________________
> > The i’m Talkathon starts 6/24/08. For now, give amongst yourselves.
> > http://www.imtalkathon.com?source=TXT_EML_WLH_LearnMore_GiveAmongst
>
> _________________________________________________________________
> Earn cashback on your purchases with Live Search - the search that pays you back!
> http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=earncashback
_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008

Attachment:
user_188334.ezm (zipped)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/

Attachment:
user_188337.ezm (zipped)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

Attachment:
user_188342.ezm (zipped)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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

Attachment:
user_188338.ezm (zipped)
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
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188339.ezm (zipped)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?

Attachment:
user_188340.ezm (zipped)"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
<pierre.thibaudeau@(protected):
> 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

Attachment:
user_188341.ezm (zipped)2008/6/30 Musachy Barroso <musachy@(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/javascript">dojo.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?

Attachment:
user_188343.ezm (zipped)Hi Jeromy and Lukasz,
Thanks for your reply, the information provided by you is
really helpful. i could understand well about validation framework with your
explanation.
Thanks a lot.
On Mon, Jun 30, 2008 at 1:45 PM, Jeromy Evans <
jeromy.evans@(protected):
> 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: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>