Author Login
Post Reply
user Digest 23 May 2008 09:39:18 -0000 Issue 8046
Topics (messages 186721 through 186745):
Re: Tomcat 6.0 + struts 1.1 => are they compatible?
186721 by: jklcom99
186734 by: Antonio Petrelli
Re: Request/session timeout when exporting very large files
186722 by: Laurie Harper
186728 by: Al Sutton
186739 by: Simon Sew
186740 by: Simon Sew
Re: unclear behavior of submit-control
186723 by: Laurie Harper
186725 by: Alec C4
186726 by: Dave Newton
186735 by: Alec C4
Re: Simple 'show empty form' flow
186724 by: hernan gonzalez
Re: Error limiting the size file upload
186727 by: Yousri BENDI ABDALLAH
How to find jars not used in the project ??
186729 by: A. Lotfi
186736 by: Dustin S.
Re: model conversation scope doesn' t work as property in a base action class
186730 by: Gabriel Belingueres
186732 by: Canny Duck
Re: Hello all: Date Validation... An old issue, i guess...
186731 by: Gabriel Belingueres
186733 by: Milan Milanovic
Re: Struts 2: After validation fail, how to change the returning result name to other than INPUT?
186737 by: Phan, Hienthuc T
Re: Action executed many times
186738 by: Márcio Gurgel
Problem with implementation of pagination with display tag in Struts2
186741 by: Varun Deep
186742 by: Engr. Jherald Gerome Lacambra
Re: Page the waiting / Páginas de espera
186743 by: Eduardo Solanas
Re: Writing valid OGNL
186744 by: ravi_eze
Struts 2 + SmartURLs Plugin- Root Redirect no Longer Working
186745 by: Pandolf
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_186721.ezm (zipped)It's complaining
java.lang.NoClassDefFoundError: javax/el/ExpressionFactory.
Not sure if it's related.
Paul Benedict-2 wrote:
>
> Why wouldn't they be compatible?
>
>
>>
>> Did you ever get an answer to your question?
>>
>> What does one need to do to migrate an existing jsp project(struts 1.1)
>> to
>> Tomcat 6?
>>
>>
>> ojasrege wrote:
>> >
>> > We have a web jsp project that we are upgrading to Tomcat 6.0.
>> >
>> > We have run into a few technical errors, and so I'm wondering whether
>> or
>> > not there are any issues in moving a struts 1.1 project to Tomcat 6.0.
>> >
>> > Does anyone know if there is anything that I'll have to rework to move
>> to
>> > tomcat 6.0?
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Tomcat-6.0-%2B-struts-1.1-%3D%3E-are-they-compatible--tp13635488p17407892.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)
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186734.ezm (zipped)2008/5/22 jklcom99 <jeff_k_lu@(protected)>:.
>
> It's complaining
java.lang.NoClassDefFoundError: javax/el/ExpressionFactory.
> Not sure if it's related.
Probably you are using Struts EL tags. Simply don't use them, use
non-EL tags instead, EL expression will work anyway because Tomcat (as
every JSP 2.x does) understands them.
Antonio

Attachment:
user_186722.ezm (zipped)Al Sutton wrote:
> You may find that your app server, the clients browser, or any proxy
> in-between may timeout irrespective of what you do in your webapp.
If the timeout occurs during the PDF generation, before the response
begins being streamed back, maybe. But as long as there is response data
being transmitted, no timeout should occur at the connection level. A
session timeout is an app-server function, anyhow; clients and proxies
know nothing about the session.
Simon, is the timeout occuring during the request for the PDF, while it
is being generated and before the action begins transmitting it? Or is
the PDF downloaded successfully with the next request failing because
the session timed out during the download?
L.
> If the file takes so long to generate is there any reason why your not
> pre-generating it, caching it and serving it as a static file?
>
> Al.
>
> ----- Original Message ----- From: "Simon Sew" <simon_sew@(protected)>
> To: <user@(protected)>
> Sent: Thursday, May 22, 2008 7:32 AM
> Subject: Request/session timeout when exporting very large files
>
>
>> Hi,
>> I'm having this request/session timeout problem.
>>
>> My page have a link to generate and export pdf file. The problem is
>> sometimes the generated file is very huge (100MB++) and it takes quite
>> some time to export it (30 to 90 minutes). How do I prevent it from
>> timeout when it is exporting at that time?
>>
>> I tried session.setMaxInactiveInterval() but it's not working.
>>
>> Thx.
>>

Attachment:
user_186728.ezm (zipped) From the initial email it seemed as though it's a two stage process
(stage 1 : generate, stage 2 : export), hence I thought it possible that
an idle time out could occur during the generation phase.
One approach I've seen is that a servlet starts the generation and lets
the user carry on with their interaction with the webapp. Once the
generation is complete the user is emailed a link where they can
download the generated file. All this would, of course, need the
necessary security put over the top to ensure users didn't download each
others files.
Al.
Laurie Harper wrote:
> Al Sutton wrote:
>> You may find that your app server, the clients browser, or any proxy
>> in-between may timeout irrespective of what you do in your webapp.
>
> If the timeout occurs during the PDF generation, before the response
> begins being streamed back, maybe. But as long as there is response
> data being transmitted, no timeout should occur at the connection
> level. A session timeout is an app-server function, anyhow; clients
> and proxies know nothing about the session.
>
> Simon, is the timeout occuring during the request for the PDF, while
> it is being generated and before the action begins transmitting it? Or
> is the PDF downloaded successfully with the next request failing
> because the session timed out during the download?
>
> L.
>
>> If the file takes so long to generate is there any reason why your
>> not pre-generating it, caching it and serving it as a static file?
>>
>> Al.
>>
>> ----- Original Message ----- From: "Simon Sew" <simon_sew@(protected)>
>> To: <user@(protected)>
>> Sent: Thursday, May 22, 2008 7:32 AM
>> Subject: Request/session timeout when exporting very large files
>>
>>
>>> Hi,
>>> I'm having this request/session timeout problem.
>>>
>>> My page have a link to generate and export pdf file. The problem is
>>> sometimes the generated file is very huge (100MB++) and it takes
>>> quite some time to export it (30 to 90 minutes). How do I prevent it
>>> from timeout when it is exporting at that time?
>>>
>>> I tried session.setMaxInactiveInterval() but it's not working.
>>>
>>> Thx.
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment:
user_186739.ezm (zipped)Hmm...
I will try that.
Thx.
Owen Berry <owen.berry@(protected)
session active. Could even show progress on the pdf generation.
On Thu, May 22, 2008 at 8:23 AM, Simon Sew wrote:
> Because we are required to generate the pdf in real time. The data will always be changing from time to time,therefore not suitable to be pre-generated.
>
> Al Sutton wrote: You may find that your app server, the clients browser, or any proxy
> in-between may timeout irrespective of what you do in your webapp.
>
> If the file takes so long to generate is there any reason why your not
> pre-generating it, caching it and serving it as a static file?
>
> Al.
>
> ----- Original Message -----
> From: "Simon Sew"
> To:
> Sent: Thursday, May 22, 2008 7:32 AM
> Subject: Request/session timeout when exporting very large files
>
>
>> Hi,
>> I'm having this request/session timeout problem.
>>
>> My page have a link to generate and export pdf file. The problem is
>> sometimes the generated file is very huge (100MB++) and it takes quite
>> some time to export it (30 to 90 minutes). How do I prevent it from
>> timeout when it is exporting at that time?
>>
>> I tried session.setMaxInactiveInterval() but it's not working.
>>
>> Thx.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186740.ezm (zipped)
The request timeout occurs when it is still generating the pdf. When it finished, the file will be exported to the jsp.
Laurie Harper <laurie@(protected):
> You may find that your app server, the clients browser, or any proxy
> in-between may timeout irrespective of what you do in your webapp.
If the timeout occurs during the PDF generation, before the response
begins being streamed back, maybe. But as long as there is response data
being transmitted, no timeout should occur at the connection level. A
session timeout is an app-server function, anyhow; clients and proxies
know nothing about the session.
Simon, is the timeout occuring during the request for the PDF, while it
is being generated and before the action begins transmitting it? Or is
the PDF downloaded successfully with the next request failing because
the session timed out during the download?
L.
> If the file takes so long to generate is there any reason why your not
> pre-generating it, caching it and serving it as a static file?
>
> Al.
>
> ----- Original Message ----- From: "Simon Sew"
> To:
> Sent: Thursday, May 22, 2008 7:32 AM
> Subject: Request/session timeout when exporting very large files
>
>
>> Hi,
>> I'm having this request/session timeout problem.
>>
>> My page have a link to generate and export pdf file. The problem is
>> sometimes the generated file is very huge (100MB++) and it takes quite
>> some time to export it (30 to 90 minutes). How do I prevent it from
>> timeout when it is exporting at that time?
>>
>> I tried session.setMaxInactiveInterval() but it's not working.
>>
>> Thx.
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186723.ezm (zipped)Alec C4 wrote:
> <s:submit key="some.key.from.resource.bundle" /> throws OgnlException. But
> <s:submit label="submit" /> works fine. what does it means? How to access
> some.key.from.resource.bundle to display it as label?
That's right. What's the exception? We can't tell you what it means if
we don't know what it is...
L.

Attachment:
user_186725.ezm (zipped)
Attachment:
user_186726.ezm (zipped)
Attachment:
user_186735.ezm (zipped)
not working :( but looks like a <s:submit label="submit" />
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186724.ezm (zipped)In any webapp the most typical and simple form flow involves two steps:
(from the serverside point of view)
1) show an empty form for the user to fill the fields
2) receive the data, validate ; if ok, process it and show response page;
if not, show the same previous form with error messages
In Struts2, the standard mapping could be (taken from "Struts2 in action")
<action name="Registration" >
<result>/Registration.jsp</result>
</action>
<action name="Register" class="manning.Register">
<result>/RegistrationSuccess.jsp</result>
<result name="input">/Registration.jsp</result>
</action>
Now, this does not seem very nice to me.
-Two mappings for such a simple case seems a little too much
-Duplication/coupling of the input jsp (Registration.jsp) in the two mappings
-Registration.jsp must specify the Register action name in its form tag
This might be simplified by using a single mapping (the second one), by
giving the action a little more intelligence: "has the user submitted anything?
if not, this is just a request to show the input form; then, return
INPUT; elsewhere,
do as usual".
This can be done (the decision "show the empty form" might involve
asking if there
were any parameters, etc), but where ? I want to make that decision
even before the
validation takes places, so that the empty form does not show some
"field X is required",
hence I guess it would be some interceptor's work.
But before trying to write it, I wanted to asked here if this scenario
has not been
considered, as it seems so common...
--
Hernán J. González
http://hjg.com.ar/

Attachment:
user_186727.ezm (zipped)
Attachment:
user_186729.ezm (zipped)Hi,
We have a big struts project, under WEB-INF\lib we have lot of jar files, lot of them are not used in the code, we are using netbeans5.5, is there any utility to tell you which are the jar files not used in your source code.
Thanks, your help is appreciated.

Attachment:
user_186736.ezm (zipped)This should help you out:
http://www.javalobby.org/java/forums/t100842.html?start=0
On Thu, May 22, 2008 at 2:15 PM, A. Lotfi <majidnakit@(protected):
> Hi,
>
> We have a big struts project, under WEB-INF\lib we have lot of jar files,
> lot of them are not used in the code, we are using netbeans5.5, is there any
> utility to tell you which are the jar files not used in your source code.
>
> Thanks, your help is appreciated.
>
>
>

Attachment:
user_186730.ezm (zipped)I saw too that in your start.jsp page you used:
<s:property value="model.page" />
Which I don't know if will work. Actions that implements ModelDriven
interface push the model into the value stack, so you don't need to
write "model.page", but only "page".
I will eventually publish my current implementation...
2008/5/22, Canny Duck <duckmailer@(protected)>:
>
> I tried to change to order of the interceptors, but without any success.
> The model is still not set.
>
> You implemented the post-redirect-get pattern in your own implementation?
> Is it possible to publish your implementation?
>
>
> Gabriel Belingueres-2 wrote:
> >
> > I certainly did not use any of these conversation implementations (I
> > decided to write my own) but I suspect that you have defined the
> > interceptors in the opposite order: I think you should first set to
> > execute the defaultStack and then call the conversation interceptor.
> >
> > 2008/5/22, Canny Duck <duckmailer@(protected)>:
> >>
> >> Hi,
> >>
> >> I want to implement a process with more than one step and a model in a
> >> conversation scope.
> >> To realize that I used the Struts 2 scope plugin.
> >>
> >> To implement the post-redirect-get pattern I have a result type of
> >> "redirect-action". This behave is required.
> >>
> >> The attached demo implementation worked fine, if the model property and
> >> the
> >> getter setter method
> >> is part of the called action. But if the model is declared in a
> >> BaseAction,
> >> the model will not be set on the Value Stack
> >> and the property model.page ist no set. It's think it's not a bug in the
> >> scope plugin, because a
> >> tried this
> >> http://www.vitarara.org/cms/struts_2_cookbook/using_a_conversation_scope
> >> ConversationInterceptor and have the same problems.
> >>
> >> Here are the main classes of my demo process. You can test the attached
> >> demo
> >> project to see the problem:
> >>
> >> Action:
> >>
> >> public class TestAction extends BaseAction<Model> {
> >>
> >> // Working version without a BaseAction
> >> //public class TestAction extends ActionSupport {
> >> //
> >> // @In(scope = ScopeType.CONVERSATION)
> >> // @Out(scope = ScopeType.CONVERSATION)
> >> // protected Model model;
> >> //
> >> // public Model getModel() {
> >> // return model;
> >> // }
> >> //
> >> // public void setModel(Model model) {
> >> // this.model = model;
> >> // }
> >>
> >> @Begin
> >> public String start() {
> >> model = new Model();
> >> model.setPage(1);
> >> return SUCCESS;
> >> }
> >>
> >> @End
> >> public String end() {
> >> return "success";
> >> }
> >> }
> >>
> >> BaseAction:
> >>
> >> public class BaseAction<TYPE> extends ActionSupport
> >> {
> >> @In(scope = ScopeType.CONVERSATION)
> >> @Out(scope = ScopeType.CONVERSATION)
> >> protected TYPE model;
> >>
> >> public TYPE getModel() {
> >> return model;
> >> }
> >>
> >> public void setModel(TYPE model) {
> >> this.model = model;
> >> }
> >> }
> >>
> >> Model:
> >>
> >> public class Model
> >> {
> >> private int page;
> >>
> >> public int getPage() {
> >> return page;
> >> }
> >>
> >> public void setPage(int page) {
> >> this.page = page;
> >> }
> >> }
> >>
> >> struts.xml:
> >>
> >> <?xml version="1.0" encoding="UTF-8" ?>
> >> <!DOCTYPE struts PUBLIC
> >> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >> "http://struts.apache.org/dtds/struts-2.0.dtd">
> >>
> >> <struts>
> >>
> >> <constant name="struts.devMode" value="true" />
> >>
> >> <package name="test" namespace="/" extends="struts-default">
> >>
> >> <interceptors>
> >> <interceptor name="bean-scope"
> >> class="com.googlecode.scopeplugin.ScopeInterceptor" />
> >> </interceptors>
> >>
> >> <action name="start" class="example.ui.TestAction" method="start">
> >> <interceptor-ref name="bean-scope" />
> >> <interceptor-ref name="defaultStack" />
> >> <result name="success"
> >> type="redirect-action">/success</result>
> >> </action>
> >>
> >> <action name="success" class="example.ui.TestAction">
> >> <interceptor-ref name="bean-scope" />
> >> <interceptor-ref name="defaultStack" />
> >> <result name="success">/test/start.jsp</result>
> >> </action>
> >>
> >> <action name="end" class="example.ui.TestAction" method="end">
> >> <interceptor-ref name="bean-scope" />
> >> <interceptor-ref name="defaultStack" />
> >> <result name="success">/test/end.jsp</result>
> >> </action>
> >>
> >>
> >> </package>
> >> </struts>
> >>
> >> start.jsp:
> >>
> >> <%@(protected)"%>
> >> <%@(protected)"%>
> >>
> >> <html>
> >> <head>
> >> <title>Start</title>
> >> </head>
> >>
> >> <body>
> >> <s:form action="end">
> >> <!-- page is only set if no base action is used-->
> >> Page: <s:property value="model.page" />
> >> <s:submit value="End" />
> >> </s:form>
> >> </body>
> >> </html>
> >>
> >> http://www.nabble.com/file/p17404381/testapp.zip testapp.zip
> >> --
> >> View this message in context:
> >> http://www.nabble.com/model-conversation-scope-doesn%27-t-work-as-property-in-a-base-action-class-tp17404381p17404381.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)
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/model-conversation-scope-doesn%27-t-work-as-property-in-a-base-action-class-tp17404381p17405367.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_186732.ezm (zipped)
<s:property value="model.page" /> is the correct use, because I don't use the
ModelDriven interface. The conversation object is just called like this.
It would be great if you publish your current implmentation. :-)
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186731.ezm (zipped)java.lang.NoSuchMethodException: setMin(
java.lang.String)
Meaning that dateStart is a String, and should be a Date.
2008/5/22, Milan Milanovic <milanmilanovich@(protected)>:
> Hi,
>
> when I try this I got an exception:
>
> WARN com.opensymphony.xwork2.util.OgnlUtil:369 - Caught OgnlException while setting property 'min' on type '
com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator'.
>
java.lang.NoSuchMethodException: setMin(
java.lang.String)
> at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:810)
> at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
> at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
> at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
> at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
> at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
> at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
> ...
>
> Then I tried in my action class to represent date for datetimepicker field as String (because of format problem), but I got the same error ?
>
> --
> Thx, Milan
>
> Gabriel Belingueres <belingueres@(protected):
> did you tried ${dateStart}?
>
> 2008/5/20, dwarven_axe@(protected) :
> > Hi all, i'm Dome, from Italy, and i'm having my troubles with Date
> > Validation on Struts 2 :|
> >
> > Using xml validation, and need to validate a
> > date.
> >
> > Let's say i have 2 dates taken from html form. I need the second
> > one (if it does exist: it is not mandatory, actually) to be after the
> > first one.
> >
> > Used coding such as:
> >
> >
> >
> >
> >
> >
> >
> > expression">dateStart]]>
>
> >
> > ERROR MESSAGE
> >
> >
> >
> >
> > or
> >
> >
> >
> >
> $dateStart
> (Used
> > also dateStart or #dateStart)
> > ERROR MSG
> >
> >
> >
> > But none worked...
> >
> > Any
> > suggestion?
> >
> >
> > Thanks a lot...
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>

Attachment:
user_186733.ezm (zipped)Yes, but that's not true. dateStart is Date! I tried with String, I tried everything and Struts 2 have serious problems with dates!
Gabriel Belingueres <belingueres@(protected))
Meaning that dateStart is a String, and should be a Date.
2008/5/22, Milan Milanovic :
> Hi,
>
> when I try this I got an exception:
>
> WARN com.opensymphony.xwork2.util.OgnlUtil:369 - Caught OgnlException while setting property 'min' on type '
com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator'.
>
java.lang.NoSuchMethodException: setMin(
java.lang.String)
> at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:810)
> at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)
> at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)
> at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
> at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
> at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
> at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
> ...
>
> Then I tried in my action class to represent date for datetimepicker field as String (because of format problem), but I got the same error ?
>
> --
> Thx, Milan
>
> Gabriel Belingueres wrote:
> did you tried ${dateStart}?
>
> 2008/5/20, dwarven_axe@(protected) :
> > Hi all, i'm Dome, from Italy, and i'm having my troubles with Date
> > Validation on Struts 2 :|
> >
> > Using xml validation, and need to validate a
> > date.
> >
> > Let's say i have 2 dates taken from html form. I need the second
> > one (if it does exist: it is not mandatory, actually) to be after the
> > first one.
> >
> > Used coding such as:
> >
> >
> >
> >
> >
> >
> >
> > expression">dateStart]]>
>
> >
> > ERROR MESSAGE
> >
> >
> >
> >
> > or
> >
> >
> >
> >
> $dateStart
> (Used
> > also dateStart or #dateStart)
> > ERROR MSG
> >
> >
> >
> > But none worked...
> >
> > Any
> > suggestion?
> >
> >
> > Thanks a lot...
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186737.ezm (zipped)Laurie,
Thank you. Your suggestion works great. Very elegant!
-Hien
-----Original Message-----
From: news [mailto:news@(protected)
Sent: Tuesday, May 20, 2008 1:55 PM
To: user@(protected)
Subject: Re: Struts 2: After validation fail, how to change the
returning result name to other than INPUT?
Phan, Hienthuc T wrote:
> Hi,
>
> I have a CustomerAction class. In CustomerAction, I have two methods:
> add and update. I have a CustomerAction-validation.xml to check for
> required fields, etc. My struts.xml looks something like this:
>
> <package name="customer">
> <action name="customer_*"
> class="com.action.CustomerAction" method="{1}">
> <result
> name="create">/customer_create.jsp</result>
> <result
> name="update">/customer_update.jsp</result>
> </action>
> </package>
>
> When the validation fail, I would like it to return to the previous
page
> (either cusomer_create.jsp or customer_update.jsp). However, Struts
> returns result = "input" automatically when the validation fail. How
do
> I change the result from "input" to either "add" or "update"?
>
> A clunky way to solve this problem is to create two actions. That
would
> generate too many classes. Is there a good solution for this problem
of
> mine? Thanks.
How do you know which one to return to? There are a few possibilities,
but if the result name is the same as the method name you could do
something like
<action name="customer_*" method="{1}" ...>
<result name="input">/customer_{1}.jsp"/>
<result name="{1}">/customer_{1}.jsp"/>
</action>
(note that I also collapsed your other two results using the same
technique).
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.

Attachment:
user_186738.ezm (zipped)Hi all,
Jeromy, I'm already using struts 2.1... Seems that this issue persists, or
there's some kind of configuration do fix this?
By the way, I say your project to integrate YUI and Struts 2,
congratulations!
Regards,
Márcio Gurgel
2008/5/4 Jeromy Evans <jeromy.evans@(protected)>:
> Márcio Gurgel wrote:
>
>>
>> Does anyone knows how to prevent this multiple calls from TabbedPanel
>> href?
>>
>> Tanks!
>>
>>
>
> IIRC, it is a known problem in Struts 2.0 that will not be fixed. It was
> fixed in the Dojo plugin in Struts 2.1.
> I don't recall the reason but there was at least one old thread about it
> that you'll be able to find.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186741.ezm (zipped)To all
Hi, I want to implement pagination on my web application, for that I
want to use the "display tag". Can any one tell or suggest the step by
step process needed to implement the "display tag"(means how to
configure the struts2 application). I am using Struts2. I will be very
much thank full to you.
Thanks in advace
Varun

Attachment:
user_186742.ezm (zipped)1. Put the display tag libraries on WEB-INF/lib folder
2. Put the displaytag.tld on WEB-INF folder
3. add the code the ff codes on you web.xml
<jsp-config>
<taglib>
<taglib-uri>http://displaytag.sf.net</taglib-uri>
<taglib-location>displaytag.tld</taglib-location>
</taglib>
</jsp-config>
And now you are good to go.
2008/5/23 Varun Deep <vdeep@(protected)>:
> To all
>
> Hi, I want to implement pagination on my web application, for that I
> want to use the "display tag". Can any one tell or suggest the step by
> step process needed to implement the "display tag"(means how to
> configure the struts2 application). I am using Struts2. I will be very
> much thank full to you.
>
> Thanks in advace
>
> Varun
>
>
--
Jherald Gerome Lacambra

Attachment:
user_186743.ezm (zipped)Hi, it doesn't work, i think its a bug.
my action in struts.xml
<action name="reservasProvinciales" class="ejemplo.pruebaAction">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="execAndWait">
<param name="delay">1000</param>
<param name="delaySleepInterval">1000</param>
</interceptor-ref>
<result>/pages/amarillas/provinciales/pos_loc.jsp</result>
<result name="menuTerminos">/pages/pageprueba1.jsp</result>
<result name="listadoTerminos">/pages/pageprueba2.jsp</result>
</action>
and in ejemplo.pruebaAction in execute method
public String execute() throws Exception {
String coSite=getText(TPIConstants.coSitePAM);
String tipoPam=getText(TPIConstants.tipoPAMProv);
when it calls getText it breaks, if i remove the interceptors tag in
the struts.xml it get the text and works fine
I tried too with this other interceptor in struts-default.xml and fails too :(
<interceptor-stack name="executeAndWaitStack">
<interceptor-ref name="execAndWait">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="execAndWait">
<param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
</interceptor-stack>
any ideas? maybe a bug? thanks
2008/5/22 Giovanni Azua <giaz@(protected)>:
> hi Eduardo,
>
> It would be useful that you posted the struts configuration and all relevant
> snippets. We won't otherwise understand the case you're describing.
>
> Just a wild shot at what you explain sounds like you don't get your
> properties properly assigned to the Action ... is that it? If it is the
> case then please make sure to have the action mapping including not only the
> execAndWait interceptor but also the default stack right before it e.g.
>
> <action name="SimulationRun"
> class="com.sag.optimizer.ui.web.action.simulation.SimulationRunAction">
> <interceptor-ref name="defaultStack"/>
> <interceptor-ref name="execAndWait">
> <param name="delay">1000</param>
> <param name="delaySleepInterval">1000</param>
> </interceptor-ref>
> <result name="wait" type="tiles">webui.simulationWait</result>
> <result name="success" type="tiles">webui.simulationReport</result>
> <result name="input" type="tiles">${ type.equals('COVARIANT') ?
> 'webui.formCovSimulation' : 'webui.formInvSimulation' }</result>
> <result name="error" type="tiles">webui.requestFailed</result>
> </action>
>
> HTH
> regards,
> Giovanni
>
> Eduardo Solanas wrote:
>>
>> Hi Giovanni i have proved the executeAndWaitStack interceptor, and it
>> works well(aiting page works ok) but in my method (in an Action) in
>> wich i have to access with getText to a key in a properties file, and
>> it doesn't work!!!! if i quit the interfeptor it works again, maybe a
>> bug?
>>
>> thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_186744.ezm (zipped)
hi,
i often get into funny problems and am not sure how to fix them for example:
<%@(protected)" ...
<%=constants.static1 %> <!-- gives output as value1 -->
<s:property value="<%=constants.static1%>" <!-- gives output as value1 -->
but when i use :
<s:textfield name="hashmap['<%=constants.static1%>']" <!--doesnt work... -->
i am totally clueless as to what is happening here!!!
some times <s:property value="%{...}" will work...
some times <s:property value=%{#... or some thing}" will only work... and
moreover tracing the ognl evaluation is hardly possible.
so if we have a tool which can help me how the ognl is being evaluated... it
would save me tons and tons of time..... any ideas ??? :(
cheers,
ravi
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_186745.ezm (zipped)
Hi there,
I've recently started using the SmartURLs plugin with Struts 2, particularly
for the extensionless URLs feature, which I've enabled by setting the
struts2 filter to be "org.texturemedia.smarturls.SmartURLsFilter" in my
"web.xml" and setting "struts.action.extension=" in my "struts.properties".
This appears to be working, however it's left me with one undesired side
affect. I used to have an "index.jsp" in the root of my web app that would
redirect to the web app's home page via a "Home.action". "index.jsp" is of
course in my welcome files list in my "web.xml".
Without the SmartURLs plugin, "http://localhost" would redirect to
"http://localhost/Home.action" . This is the behaviour I want.
With the SmartURLS plugin, this no longer works. Instead I get an error and
SmartURLs has tried to redirect me "http://localhost//index.jsp" (note
double slash before index.jsp)
I've got a rather crude way of working around this. Basically I just
created an empty "Home" file in the web app root and then added "Home" to my
welcome files list. This works and I am correctly redirected from
"http://localhost" to "http://localhost/Home" , however it seems like a bit
of a hack job. Is there a better way to do this?
--
Sent from the Struts - User mailing list archive at Nabble.com.