Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 9 Jul 2009 13:42:13 -0000 Issue 8742

user-digest-help

2009-07-09


Author LoginPost Reply

user Digest 9 Jul 2009 13:42:13 -0000 Issue 8742

Topics (messages 200534 through 200551):

Re: Commercial framework based on struts2.
 200534 by: Martin Gainty
 200535 by: dusty

Re: Confusing with convention plugin
 200536 by: dusty

Re: caching Java objects
 200537 by: dusty

exceute() method in action class didn't called
 200538 by: jayadevan
 200540 by: Lukasz Lenart
 200541 by: jayadevan
 200544 by: Lukasz Lenart

Re: [s2] Custom field validator with params containing OGNL expression
 200539 by: Lukasz Lenart

Re: dynamic return when validation failed
 200542 by: mailtolouis2020-struts.yahoo.com
 200543 by: mailtolouis2020-struts.yahoo.com
 200545 by: Oscar Alvarez
 200546 by: Jim Kiley
 200550 by: Greg Lindholm

<s:actionerrors> not displaying errors!
 200547 by: Kavita Mehta
 200549 by: Robert Graf-Waczenski
 200551 by: Kavita Mehta

Re: How is the max file size controlled for file uploads in Struts 1.3.8?
 200548 by: Frank Russo

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_200534.ezm (zipped)

> From: wesw@(protected)
> To: user@(protected)
> Subject: Re: Commercial framework based on struts2.
> Date: Wed, 8 Jul 2009 21:37:24 -0400
>
> On Wednesday 08 July 2009 00:00:49 dusty wrote:
> > I know a guy who knows a guy that ported Icefaces to Struts2 + stuff you
> > probably need and don't know it. He even has a ponytail. He wants
> > eleventy thousand dollars.
> >
> > sharath wrote:
> > > Dear All,
> > >
> > >   I'm looking for chimerical framework which is built on top of struts2,
> > > with having AJAX support tags. I know struts2 comes with DOJO but we need
> > > to write lot of coding which we'd like to avoid and we are planning to
> > > purchase chimerical product with support.
> > >
> > >   Similar to Icefaces which is build on JSF technology.
> > >
> > >   Can anyone please let me know. If you have price details then please
> > > include that also...
> > >
> > > Thanks,
> > > Sharath.
> > >
> > >  
>
> If the money is right, I'll build you one. You tell me what you want and I'll
> tell you how much it'll cost.
>
> -Wes

and I'll do it for half of that
do we have to grow a ponytail?
-Martin
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

Attachment: user_200535.ezm (zipped)

JSF programming requires a ponytail, so when in Rome.....In order to really
get inside the head of The Fail, you use a random XML document generator and
generate 10,000 files and then try to wrestle that into a functioning web
app.



mgainty wrote:
>
>
>> From: wesw@(protected)
>> To: user@(protected)
>> Subject: Re: Commercial framework based on struts2.
>> Date: Wed, 8 Jul 2009 21:37:24 -0400
>>
>> On Wednesday 08 July 2009 00:00:49 dusty wrote:
>> > I know a guy who knows a guy that ported Icefaces to Struts2 + stuff
>> you
>> > probably need and don't know it. He even has a ponytail. He wants
>> > eleventy thousand dollars.
>> >
>> > sharath wrote:
>> > > Dear All,
>> > >
>> > >   I'm looking for chimerical framework which is built on top of
>> struts2,
>> > > with having AJAX support tags. I know struts2 comes with DOJO but we
>> need
>> > > to write lot of coding which we'd like to avoid and we are planning
>> to
>> > > purchase chimerical product with support.
>> > >
>> > >   Similar to Icefaces which is build on JSF technology.
>> > >
>> > >   Can anyone please let me know. If you have price details then
>> please
>> > > include that also...
>> > >
>> > > Thanks,
>> > > Sharath.
>> > >
>> > >  
>>
>> If the money is right, I'll build you one. You tell me what you want and
>> I'll
>> tell you how much it'll cost.
>>
>> -Wes
>
> and I'll do it for half of that
> do we have to grow a ponytail?
> -Martin
>>
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
> _________________________________________________________________
> Insert movie times and more without leaving Hotmail®.
> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009
>

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



Attachment: user_200536.ezm (zipped)

Let the record the response was non-responsive.  Struts is trying to call
index() on your action. Since you likely don't have index() in your action
it seems likely that the REST plugin is in your path and is trying to
auto-map a URL to the index() method of a registered Controller.

So lets try again. Are you using the REST plugin?  What URL are you
navigating to that throws this error. What annotations are you using?


Leegorous wrote:
>
> The other examples are doing well.
> So.
>
> On Wed, Jul 8, 2009 at 10:48 PM, Musachy Barroso<musachy@(protected):
>> do you have the REST plguin in your lib dir?
>>
>> musachy
>>
>> On Tue, Jul 7, 2009 at 11:26 PM, Leegorous<leegorous@(protected):
>>> Hi,
>>>
>>> I'm new here.
>>> I follow the http://struts.apache.org/2.x/docs/convention-plugin.html
>>> Some examples are not working in my case.
>>> like the simplest one, no action exist, always throws
>>>
>>> java.lang.IllegalArgumentException: The index() is not defined in
>>> action class com.opensymphony.xwork2.ActionSupport
>>>
>>> And the example in Chaining section is throwing the same exception.
>>>
>>> I start the project from struts2-archetype-blank, just delete the
>>> original strust2 config
>>> Do anybody know what happen, or know how to diagnose.
>>>
>>> Thanks in advance.
>>>
>>> Leegorous
>>>
>>> --
>>> MyWeblog http://leegorous.net/blog/
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
> --
> 猛击 http://leegorous.net/blog/ 吧!
>
> ---------------------------------------------------------------------
> 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_200537.ezm (zipped)

For stuff like data dictionary lists, or other random stuff I don't need to
reload I will initialize on startup and store in the servletContext. I will
use EhCache for handling cache of model objects when I have a lot of reads
and want to improve performance when there are lots of "things".

I think it depends on the scope of your need, but my guess is that you are
thinking about application-wide scope, so you are on the right track.


Disclaimer: I have an irrational fear and allergic reaction to the HTTP
Session map, so I will do probably crazy things to avoid it.



Mitch Claborn wrote:
>
> What is the preferred method of caching arbitrary Java objects locally
> in a Struts application? I've been making my actions implement
> ApplicationAware and storing objects in that Map. (I think this comes
> from the ServletContext?) Is that the best way or is there something
> else?
>
> Mitch
>
>
> ---------------------------------------------------------------------
> 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_200538.ezm (zipped)

hi all

I am using struts 1.1 for my accadamic project . My exceute() method in
action class did n't called . but the instance of action class created

struts - config.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
      "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
  <form-beans>
   <form-bean name="HelloWorldFromBean"
            type="examples.firstStruct.helloWorld.HelloWorldFrom"/>
 </form-beans>
 <action-mappings>
     <action
          path="/helloWorld"
          type="examples.firstStruct.helloWorld.HelloWorldAction"
          name= ""
          scope ="request"
          >
          <forward
            name="xxx"
            path="/pages/HelloWorld.jsp"/>
         
       </action>
 </action-mappings>
</struts-config>

action class

package examples.firstStruct.helloWorld;


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

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class HelloWorldAction extends Action {
 public HelloWorldAction(){
   System.out.println("---------------inside execute -----------");
 
 }
 public ActionForward execute(ActionMapping mapping, ActionForm form,
     HttpServletRequest request, HttpServletResponse response)
 throws Exception {
   System.out.println("---------------inside execute -----------");
   return mapping.findForward("xxx");
 }
 
}

execute never called

tomcat log

Jul 9, 2009 9:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Processing a GET for /helloWorld
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Setting locale 'en_US'
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Looking for ActionForm bean under attribute ''
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Looking for Action instance for class
examples.firstStruct.helloWorld.HelloWorldAction
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Double checking for Action instance already there
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Creating new Action instance
---------------inside execute -----------
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Processing a GET for /helloWorld
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Looking for ActionForm bean under attribute ''
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Looking for Action instance for class
examples.firstStruct.helloWorld.HelloWorldAction
please help me ?

thanks in advance
jayadevan
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200540.ezm (zipped)
2009/7/9 jayadevan <jayadevan.m@(protected)>:
>        <action-mappings>
>                        <action
>                path="/helloWorld"
>                type="examples.firstStruct.helloWorld.HelloWorldAction"
>                name= ""

Add name = "HelloWorldFromBean"


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

Jack Benny - "I don't deserve this award, but I have arthritis and I
don't deserve that either." -
http://www.brainyquote.com/quotes/authors/j/jack_benny.html


Attachment: user_200541.ezm (zipped)

thanks Lukasz

i tried it but i got one servelet exception

Jul 9, 2009 12:02:11 PM org.apache.catalina.core.ApplicationContext log
INFO: action: Looking for ActionForm bean under attribute
'HelloWorldFromBean'
Jul 9, 2009 12:02:11 PM org.apache.catalina.core.ApplicationContext log
INFO: action: Creating new ActionForm instance of class
'examples.firstStruct.helloWorld.HelloWorldFrom'
Jul 9, 2009 12:02:11 PM org.apache.catalina.core.ApplicationContext log
INFO: action: Storing instance under attribute 'HelloWorldFromBean' in
scope 'request'
Jul 9, 2009 12:02:11 PM org.apache.catalina.core.ApplicationContext log
INFO: action: Populating bean properties from this request
Jul 9, 2009 12:02:11 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
javax.servlet.ServletException: Servlet execution threw an exception
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:313)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
 at
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
 at
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
 at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
 at
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
 at
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:263)
 at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Unknown Source)




Lukasz Lenart wrote:
>
> 2009/7/9 jayadevan <jayadevan.m@(protected)>:
>>        <action-mappings>
>>                        <action
>>                path="/helloWorld"
>>                type="examples.firstStruct.helloWorld.HelloWorldAction"
>>                name= ""
>
> Add name = "HelloWorldFromBean"
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
> http://dailylog.lenart.org.pl/
>
> Jack Benny - "I don't deserve this award, but I have arthritis and I
> don't deserve that either." -
> http://www.brainyquote.com/quotes/authors/j/jack_benny.html
>
> ---------------------------------------------------------------------
> 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_200544.ezm (zipped)
Ok, but it's truncated, could you send more?


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

Eddie Izzard - "Never put a sock in a toaster." -
http://www.brainyquote.com/quotes/authors/e/eddie_izzard.html


Attachment: user_200539.ezm (zipped)
2009/7/7 Cristian Peraferrer <corellian.c@(protected)>:
> <field-validator type="usernameavailable">
>      <param name="userId">${enterprise.enterpriseId}</param>
>      <message>This username is already taken.</message>
>    </field-validator>

Do you have a getter called getEnteriprise() on an action?


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

Mary Pickford - "Adding sound to movies would be like putting
lipstick on the Venus de Milo." -
http://www.brainyquote.com/quotes/authors/m/mary_pickford.html


Attachment: user_200542.ezm (zipped)
Hi Dale & Greg,

Thanks for all your discussion.


>>>
> The problem is that the OP doesn't understand his problem. If the
> validation step knows what the result page should be, he shouldn't be
> returning "input", but rather the name of the logical step to be rendered.
> He's right that the code shouldn't need to know what jsp page renders that
> step, just the logical name of the page, fleshed out in the .xml file.
>



Yes, my validation step know what the result page should be (I mean the logical name of the result page), why I said it returning to the "input" that is because the workflow interceptor always return to the logical name "input" when there is error, that is why come to this idea to replace the value of "input"

Well, if I remove my validation code in the validate() method and put it into execute() method, then I can easily control which logical name to be return, but I thought that is not a good way to do that right?

There must be other way to solve this kind of validation problem, what I call this wizard validation, I think it is quite common in many web project.
Like in my case, create employee wizard, it break into 5 pages and handle by CreateEmpAction, I can use Greg solution 2, but then I need to create CreateEmpAction1, CreateEmpAction2, etc, thats not look so tidy to me.

Hopefully someone done this before can give me some light.

Regards
Louis

Attachment: user_200543.ezm (zipped)
Thanks for let me know another struts2 book, have a quick look in it, didn't found any good tip to solve my problem.

Regards
Louis



________________________________
From: Oscar Alvarez <oialvarez@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Wednesday, July 8, 2009 7:09:35 PM
Subject: Re: dynamic return when validation failed

2009/7/8 Oscar Alvarez <oialvarez@(protected)>

> Hi...
>
> Try to get the Ian Roughley's "Starting Struts2 online" ebook for free, and
> study "PRODUCTIVITY TIPS" -> "Re-Using Action Configurations"... and see if
> there are some other tips for you.
>


And of course "PRODUCTIVITY TIPS" -> "Use Pattern Matching Wildcards in
Configurations" too.



>
> HTH
>
> 2009/7/8 Greg Lindholm <greg.lindholm@(protected)>
>
> > Greg Lindholm wrote:
>> >
>> >> The referer header will contain the URL of the last request, which will
>> be
>> >> the action URL not the jsp page that rendered the result. So this
>> wouldn't
>> >> help the OP if I understood his problem.
>> >>
>> >
>> > I think you misunderstand what the referer field contains. It'll be the
>> > url that was displaying in the address field on the page from which the
>> form
>> > was submitted. http://en.wikipedia.org/wiki/HTTP_referrer Note that it
>> > can be forged, etc.
>> >
>> >
>> Not sure why you think I don't understand referer. In a struts app what
>> you
>> see in the address field is the "action URL" (e.g.
>> http://host/MyAction.action) you don't ever see the JSP page name that
>> rendered the page. The OP seemed to be looking for the name of the jsp
>> page
>> so don't see how this would help.
>>
>
>
>
> --
> Atentamente
> Óscar Álvarez Vielma
> (09) 8416 4052
>



--
Atentamente
Óscar Álvarez Vielma
(09) 8416 4052

Attachment: user_200545.ezm (zipped)
            Use Pattern Matching Wildcards in Configurations

Action configuration files are somehow able to grow to
extremely large at incredible speeds. On way to combat this
phenomenon is to use pattern matching. Pattern matching works
by defining one or more patterns that URLs will conform to.
An example will be an easy way to see how things work. Let’s
say that the URLs in your web application always follows the
pattern “/{module}/{entity}/{action}.action”. This is a common
pattern;     examples      would     be     the   URL’s
“/admin/User/edit.action”,      “/admin/User/list.action”   and
“/admin/User/add.action”.

The class configuration is such that there is a Struts2 action class
with the name “{entity}Action”, and each {action} is method on
the action class. All the results from invoking the action’s
methods will result in either the update page for the entity being
displayed, or a list of all the entities being displayed.

For our example, the “struts.xml” configuration will look like
this:

*<action name=”*/*/*” method=”{3}”
      class=”com.infoq.actions.{1}.{2}Action”>
   <result name=”view”>/{1}/update{2}.jsp</result>
   <result name=”list”>/{1}/list.jsp</result>
</action>*

Each asterisk in the actions name is a wildcard. In the example,
only asterisks are used – but this need not be the case. For
example, say you wish to map all entity view actions together.
Something like ‘name=”/*/View*”’ would do the trick. Token
identifiers, {1}, {2}, etc., are then used to obtain the text values
harvested from the wildcards (where the numeric value
correlating to the position of the asterisk, ascending from left to
right).

In the “struts.properties” configuration file (or using the constant
tag in the “struts.xml” configuration file) you need to ensure the
following property is correctly set:

struts.enable.SlashesInActionNames = true

This property allows slashes in the name of the action. Struts2’s
default configuration is to not have slashes in the action name,
instead using packages for namespace separation.

Finally, there is no shortcut if you are providing validation and
conversion property files rather than using annotations. We’ll
talk about this more in following sections. Each needs to
contain the full name of the action, along with the necessary
extension: i.e. “edit-validation.xml” and “edit-conversion.xml”
for the original example, in the “com.infoq.actions.admin”
package.


2009/7/9 <mailtolouis2020-struts@(protected)>

> Thanks for let me know another struts2 book, have a quick look in it,
> didn't found any good tip to solve my problem.
>
> Regards
> Louis
>
>
>
> ________________________________
> From: Oscar Alvarez <oialvarez@(protected)>
> To: Struts Users Mailing List <user@(protected)>
> Sent: Wednesday, July 8, 2009 7:09:35 PM
> Subject: Re: dynamic return when validation failed
>
> 2009/7/8 Oscar Alvarez <oialvarez@(protected)>
>
> > Hi...
> >
> > Try to get the Ian Roughley's "Starting Struts2 online" ebook for free,
> and
> > study "PRODUCTIVITY TIPS" -> "Re-Using Action Configurations"... and see
> if
> > there are some other tips for you.
> >
>
>
> And of course "PRODUCTIVITY TIPS" -> "Use Pattern Matching Wildcards in
> Configurations" too.
>
>
>
> >
> > HTH
> >
> > 2009/7/8 Greg Lindholm <greg.lindholm@(protected)>
> >
> > > Greg Lindholm wrote:
> >> >
> >> >> The referer header will contain the URL of the last request, which
> will
> >> be
> >> >> the action URL not the jsp page that rendered the result. So this
> >> wouldn't
> >> >> help the OP if I understood his problem.
> >> >>
> >> >
> >> > I think you misunderstand what the referer field contains. It'll be
> the
> >> > url that was displaying in the address field on the page from which
> the
> >> form
> >> > was submitted. http://en.wikipedia.org/wiki/HTTP_referrer Note that
> it
> >> > can be forged, etc.
> >> >
> >> >
> >> Not sure why you think I don't understand referer. In a struts app what
> >> you
> >> see in the address field is the "action URL" (e.g.
> >> http://host/MyAction.action) you don't ever see the JSP page name that
> >> rendered the page. The OP seemed to be looking for the name of the jsp
> >> page
> >> so don't see how this would help.
> >>
> >
> >
> >
> > --
> > Atentamente
> > Óscar Álvarez Vielma
> > (09) 8416 4052
> >
>
>
>
> --
> Atentamente
> Óscar Álvarez Vielma
> (09) 8416 4052
>



--
Atentamente
Óscar Álvarez Vielma
(09) 8416 4052

Attachment: user_200546.ezm (zipped)
On Thu, Jul 9, 2009 at 5:26 AM, <mailtolouis2020-struts@(protected):

>
> Well, if I remove my validation code in the validate() method and put it
> into execute() method, then I can easily control which logical name to be
> return, but I thought that is not a good way to do that right?
>

While this might not be a "good way to do that," it's what I would do and in
fact have done.
--
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com

Attachment: user_200550.ezm (zipped)
>
>
> >
> > Well, if I remove my validation code in the validate() method and put it
> > into execute() method, then I can easily control which logical name to be
> > return, but I thought that is not a good way to do that right?
> >
>
> While this might not be a "good way to do that," it's what I would do and
> in
> fact have done.
> --
> Jim Kiley
> Senior Technical Consultant | Summa
> [p] 412.258.3346
> http://www.summa-tech.com
>

I occasionally have to do validation in the execute() method but always
prefer to do declarative validation with annotations wherever possible since
it is so much simpler and cleaner. This means all my actions have to be able
to handle an 'input' result. Since 'input' result is the standard for
validation errors you should be prepared for it as the next programmer who
works on your code may add a validation() method or add validation
annotations.

@OP: If you know which page# in a wizard sequence to return to and use that
page# in the jsp name then you can make that page# available with a
getPage() method and do this:

  <result name="input">/xxx/MyWizardPage${page}.jsp</result>

It does mean you would need to have a jsp page naming convention that
includes the page#.

Attachment: user_200547.ezm (zipped)
Hi,
I am using Struts 2.0 and I am not able to display the action errors in
my JSP.

Action class code :

if( ( getSelectedlocation() == null ) || getSelectedlocation().compareTo(
"" ) == 0
                          && ( (getLocation() == null ) ||(
getLocation().compareTo( "" ) == 0 )))
                    {
                          mLog.warn( "Location not
specified. Added Error message" );
                          addActionError( "Please specify a
Location for the message . " );
                    }


JSP code :

<tr>
  <td align="left" valign="top"><p><s:actionerror id="err" /></p></td>
</tr>


The error is added successfully as i can see from the logs but it is not
getting displayed on the JSP ..any pointers ?


Thanks,
Kavita





*****************************************************DISCLAIMER*****************************************************

This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers.
Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is
addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward,
print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error,
please notify the sender immediately and delete the message.

********************************************************************************************************************


Attachment: user_200549.ezm (zipped)
My first guess would be that you are not properly dispatching back to
your input page. A closer look at your struts.xml would clarify this,
though.

Robert

Kavita Mehta schrieb:
> Hi,
> I am using Struts 2.0 and I am not able to display the action errors in
> my JSP.
>
> Action class code :
>
> if( ( getSelectedlocation() == null ) || getSelectedlocation().compareTo(
> "" ) == 0
>                           && ( (getLocation() == null ) ||(
> getLocation().compareTo( "" ) == 0 )))
>                      {
>                           mLog.warn( "Location not
> specified. Added Error message" );
>                           addActionError( "Please specify a
> Location for the message . " );
>                      }
>
>
> JSP code :
>
> <tr>
>   <td align="left" valign="top"><p><s:actionerror id="err" /></p></td>
>  </tr>
>
>
> The error is added successfully as i can see from the logs but it is not
> getting displayed on the JSP ..any pointers ?
>
>
> Thanks,
> Kavita
>
>
>
>
>
> *****************************************************DISCLAIMER*****************************************************
>
> This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
> ********************************************************************************************************************
>
>
>  




Attachment: user_200551.ezm (zipped)
Thanks Robert .. Lemme check the same.



Robert Graf-Waczenski <rgw@(protected)>
07/09/2009 06:51 PM
Please respond to
"Struts Users Mailing List" <user@(protected)>


To
Struts Users Mailing List <user@(protected)>
cc

Subject
Re: <s:actionerrors> not displaying errors!






My first guess would be that you are not properly dispatching back to
your input page. A closer look at your struts.xml would clarify this,
though.

Robert

Kavita Mehta schrieb:
> Hi,
> I am using Struts 2.0 and I am not able to display the action errors in

> my JSP.
>
> Action class code :
>
> if( ( getSelectedlocation() == null ) ||
getSelectedlocation().compareTo(
> "" ) == 0
>                           && ( (getLocation() == null )
||(
> getLocation().compareTo( "" ) == 0 )))
>                      {
>                           mLog.warn( "Location not
> specified. Added Error message" );
>                           addActionError( "Please specify
a
> Location for the message . " );
>                      }
>
>
> JSP code :
>
> <tr>
>   <td align="left" valign="top"><p><s:actionerror id="err" /></p></td>
>  </tr>
>
>
> The error is added successfully as i can see from the logs but it is not

> getting displayed on the JSP ..any pointers ?
>
>
> Thanks,
> Kavita
>
>
>
>
>
>
*****************************************************DISCLAIMER*****************************************************
>
> This message and/or attachment(s) contained here are confidential,
proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The
information is solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it
is strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If
you have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
>
********************************************************************************************************************
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)






*****************************************************DISCLAIMER*****************************************************

This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers.
Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is
addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward,
print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error,
please notify the sender immediately and delete the message.

********************************************************************************************************************


Attachment: user_200548.ezm (zipped)
org.apache.struts.util.RequestUtils has the following at lines 408-415:

          Boolean maxLengthExceeded =
            (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);

          if ((maxLengthExceeded != null)
            && (maxLengthExceeded.booleanValue())) {
            ((ActionForm) bean).setMultipartRequestHandler(multipartHandler);
            return;
          }

Why would it just return? Shouldn't it throw some kind of exception? When my action is called, I have no way to know that the max file size was exceeded, and my request params are empty, so the correct DispatchAction method isn't being called.

Has anyone else seen this behavior?

----------------------------------------------------------------------------------------------------------------
Frank Russo
Developer ▪ Financial Services Division
SAS® … THE POWER TO KNOW®


-----Original Message-----
From: paulus.benedictus@(protected)
Sent: Wednesday, July 08, 2009 9:16 PM
To: Struts Users Mailing List
Subject: Re: How is the max file size controlled for file uploads in Struts 1.3.8?

Struts 1.3 does control when the file upload size hits a limit. The
<controller> element has a @maxFileSize attribute:

http://applegrew.blogspot.com/2008/10/struts-1-config-file-reference.html

Paul

2009/7/8 Martin Gainty <mgainty@(protected)>:
>
> FileUploadInterceptor has a setMaximumSize(Long size) method
>
> http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html
>
> hth
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> From: Frank.Russo@(protected)
>> To: user@(protected)
>> Date: Wed, 8 Jul 2009 16:39:17 -0400
>> Subject: How is the max file size controlled for file uploads in Struts 1.3.8?
>>
>> Can it be changed?
>>
>> ----------------------------------------------------------------------------------------------------------------
>> Frank Russo
>> Developer ▪ Financial Services Division
>> SAS® … THE POWER TO KNOW®
>>
>>
>
> _________________________________________________________________
> Windows Live™: Keep your life in sync.
> http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 gg3721.com - Jax Systems, LLC, U.S.A.