Re: startup action in struts2

2007-12-03 Thread Tom Schneider

In struts 2, the plugin architecture works differently.  Off the top of my
head, I can't think of similar functionality in s2.  An alternative option
would be to write a standard J2EE ContextListener and use that.  This is how
Spring gets loaded in newer versions of J2EE.
Tom


Christopher Cheng-5 wrote:
> 
> In struts1, I have a few plugin to preconfigure some services such as 
> QuartzPlugIn during startup
> 
> public void init(ActionServlet actionServlet,
>  ModuleConfig moduleConfig) {
> 
> try {
> SchedulerFactory sf = new StdSchedulerFactory();
> Scheduler sched = sf.getScheduler();
> sched.start();
> }
> catch (Exception e) {
> e.printStackTrace(System.out);
> }
> }
> 
> In strtus2, do I have to write a new plugin in a seperate jar? Is there a 
> simpler way? 
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/startup-action-in-struts2-tf4941013.html#a14144512
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts 2 Dependencies

2007-12-03 Thread Tom Schneider

Sounds like an enhancement to the dependency convergence report plugin for
maven.  All the metadata about which libraries are options is in the pom(s),
so it would just be a matter of having a plugin that looked at that
additional metadata.  I think it would be redundant to try to maintain a
separate document that captures that information since it would violate the
DRY principle.  (Don't Repeat Yourself)
Tom


stanlick wrote:
> 
> I have been reviewing the Reactor Dependency
> Convergence
> document,
> and would like to know if there is a companion document that identifies
> required vs. optional products.  It appears that anything "touched" by
> Struts 2 is considered a dependency without consideration of excluding the
> feature from a user web application.  The immediate discovery I am facing
> is
> AJAX tags and the requirement of Dojo.  The rumor is that effective with
> Struts 2.1 AJAX will be pushed into a plug-in providing freedom to choose
> the js library of choice.  Can someone point me to the decision documents
> concerning this topic?
> 
> Thanks,
> Scott
> 
> -- 
> Scott
> [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Dependencies-tf4937406.html#a14134454
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts2 blank application request parameters

2007-11-25 Thread Tom Schneider

Checkout the I18NInterceptor:
http://struts.apache.org/2.0.11/docs/i18n-interceptor.html

This interceptor picks up the request_locale parameter and sets the locale. 
This happens even before the action is executed.
Tom


slideharmony wrote:
> 
> I'm really going crazy with struts2 and request parameters, for example
> look at the following struts2blankapplication code:
> 
> 
> 
> 
> Languages
> 
> 
> 
> en
> 
> English
> 
> 
> 
> es
> 
> Espanol
> 
> 
> 
> Ok, here it add a request parameter called  request_locale to the url to
> set the language..
> 
> Here is the action:
> 
> public class HelloWorld extends ExampleSupport {
> public String execute() throws Exception {
>   setMessage(getText(MESSAGE));
> return SUCCESS;
> }
> 
> public static final String MESSAGE = "HelloWorld.message";
> private String message;
> 
> public String getMessage() {
> return message;
> }
> public void setMessage(String message) {
> this.message = message;
> }
>   
> }
> 
> 
> 
> Ok, how can it set the language if it don't retrieve the request_locale
> parameter??
> 
> Anybody could explain me how request parameters works?
> 
> :-(
> 

-- 
View this message in context: 
http://www.nabble.com/struts2-blank-application-request-parameters-tf4861986.html#a13944236
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Wizard like Screens

2007-11-25 Thread Tom Schneider

Both of those plugins, by default, would need the session to keep track of
the state.  The webflow plugin can be configured to serialize the state to a
hidden field, but there would be a lot of configuration and complication
just for 2 fields.

I would say your best bet is to have hidden fields that keep track of the
values you want to maintain.  This will work well if the workflow is only 2
pages.  If it's more than that, then hidden fields would become somewhat
tedious.  In a multi-page workflow, the easiest solution would be to use the
scope plugin with session or conversion scope.  Currently there is no
built-in support for simple workflows that don't use the session.


Gary Affonso wrote:
> 
> My suggestion would be to checkout the scope plug-in or WebFlow and the 
> WebFlow plug-in.
> 
> - Gary
> 
> Radha Krishna wrote:
>> Hi,
>>  
>>  I have a wizard like screen where i need to pass the selected values (2
>> text box) at first page to last page,last page to again first page.
>>
>>   Can anyone tell me the best solution how could i achive this without
>> storing values in to Session?
>>
>>   Thanks.
>> 
>>
>> -
>> Never miss a thing.   Make Yahoo your homepage.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wizard-like-Screens-tf4862135.html#a13944234
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts2 + JFreeChart Plugin + HttpServletRequest

2007-11-25 Thread Tom Schneider

You don't need the fix to get this to work.  You need to add the
servletConfig interceptor to the interceptor stack of your action.  This is
the interceptor that looks for ServletRequestAware and injects the
HttpServletRequest onto your action.


Kate Fox-2 wrote:
> 
> The version where it's fixed isn't out yet, correct? (I'm using
> struts2-tiles-plugin-2.0.11.jar and it's not working).
> 
> Where can I get the patched version? Also will it work with tiles?
> 
> Thanks,
> 
> Kate
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts2-%2B-JFreeChart-Plugin-%2B-HttpServletRequest-tf4866292.html#a13944121
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: combining Struts-2 with Struts-1 application.

2007-11-21 Thread Tom Schneider

Just as a side note, maven has good support for war overlays.  This allows
you to take a war and overlay it with the contents of a current war project. 
We're using this quite successfully to take a legacy app and overlay a
webwork project on top.  In the end, you end up with 1 final war with the
contents of both wars.


Ted Husted wrote:
> 
> Each WAR file creates its own web application, so if there are two
> WARs, there are two applications, not one.
> 
> The Java platform enforces a strict separation between applications.
> You might be able to share some cookies, but for all intents and
> purposes, the Struts 1 application might as well be running on a
> different server (on a different continent).
> 
> You'd have the same problem if both applications were written in
> Struts 1 (or Tapestry, or Stripes). Two applications are two
> applications.
> 
> To be able to treat the Struts 1 and Struts 2 resources as part of the
> same workflow, you'd have to merge the components of both codebases
> together into a single application. (Or do evil things with frames.)
> 
> Usually, that would mean copying everything that was exploded by one
> WAR into the application root created by the other WAR. (And deleting
> the original WARs.)
> 
> -Ted.
> 
> On Nov 21, 2007 3:19 PM, Leena Borle <[EMAIL PROTECTED]> wrote:
>> Hi,
>>  Actually, it is not just the action that is invoked. I want the entire
>> flow
>> of other S1 to be executed after the action is executes.
>>  According to plugin, what I understand is, I can call the action, but
>> still
>> have to use my S2 JSP page after "Success".  See example below.
>>
>> 
>>   com.mycompany.myapp.MyAction
>>   myAction.jsp
>> 
>>
>>   This S1 application is third party application. It is in its own WAR
>> file.
>> How can I call action from one WAR file into other WAR file. Only option
>> I
>> saw is calling by URL only such as http://localhost/app2/action.do .
>>
>> Leena
>>
>>
>> On Nov 21, 2007 10:25 AM, Ted Husted <[EMAIL PROTECTED]> wrote:
>>
>> > First make sure it's an issue with using the S1 Action. Try porting
>> > just one S1 Action to S2, to test whether the same thing happens or
>> > not.
>> >
>> > If it is only the actions that need to invoked, then the Struts 1
>> > plugin might help. It doesn't let us run Struts 1 taglibs from Struts
>> > 2, but it can wrap the Struts 1 Action classes.
>> >
>> > -Ted.
>> >
>> > On Nov 20, 2007 2:29 PM, Leena Borle <[EMAIL PROTECTED]> wrote:
>> > > Hi,
>> > >   I followed simple approach suggested by Ted which says,
>> > > "The simplest thing is to let the Struts 1 portion answer the *.do
>> URIs
>> > > and let the Struts 2 portion answer the *.action URIs. Everyone can
>> > > share session and application scope as needed. One page can submit to
>> > > the other portion, just include the extension as part of the URI, as
>> > > if you were calling a HTML page."
>> > >
>> > > I am am having some issues with it. I have put URL of S1
>> application
>> > > inside the TabbedPane of S2. It displays S1, but as soon as I click
>> on
>> > it,
>> > > browser refreshes with showing only S1 application. I want it running
>> > inside
>> > > my TabbedPane of S2 application. Is this approach of mine correct or
>> do
>> > I
>> > > need something else. I need S1 application to be running inside
>> Struts 2
>> > > without refreshing window and loosing control of S2.
>> > >
>> > >   Do you think portlet will work ? I am not familiar with portlets
>> and
>> > how
>> > > struts and portlets work ?
>> > >
>> > >   I am kind of confused about how to go with this.I would really
>> > appreciate
>> > > any help.
>> > > Thanks,
>> > > Leena
>> >
>>
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
> 
> 
> 
> -- 
> HTH, Ted 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/combining-Struts-2-with-Struts-1-application.-tf4571528.html#a13890113
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: captcha + struts2

2007-11-17 Thread Tom Schneider

This might be a good starting point:
http://appfuse.org/display/APF/CAPTCHA+Integration


Brian Relph wrote:
> 
> I was wondering if anyone could help with a captcha implementation in
> struts2.  i have seen plenty of stuff on the acegi + captcha
> implementation
> in appfuse, but i am not using acegi ...
> 
> 

-- 
View this message in context: 
http://www.nabble.com/captcha-%2B-struts2-tf4826673.html#a13809628
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [s2] LabelValueBean

2007-11-11 Thread Tom Schneider

Ted,
I think in webwork, were you only needed name value pairs, you would
typically use a Map.  All tags have built-in support for dealing with maps. 
Is there a specific use case that you've encountered where you needed that?
Tom


Ted Husted wrote:
> 
> Is there a corollary to the Struts 1 LabelValueBean in Struts 2?
> 
>  *
> http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/LabelValueBean.java
> 
> -Ted.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--LabelValueBean-tf4787015.html#a13696029
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation Best Practices?

2007-11-06 Thread Tom Schneider

That looks like an interesting project.  There are a lot of things that I
like about what they are doing.  There are a lot of things that could be
handle that way.  My fear with making everything a seperate Rule class is
that some things cannot be encoded as a simple rule.  Somevalidation needs
too much information and requires too much external information.  This
framework would be great as something to build on top of though.  Thanks for
pointing it out.
Tom


Joachim Ansorg-3 wrote:
> 
> Tom,
> I've read this thread with great interest.
> 
> Currently I'm thinking about the validation problem as well. I looked at 
> springmodule's Bean validation framework.
> (https://springmodules.dev.java.net/docs/reference/0.8/html/validation.html#beanValidator).
>  
> Looks quite interesting to me.
> Does somebody have any experience using it together with Struts 2?
> 
> Do you have any experience now using validators in seperate classes?
> If yes, which validation framework did you choose and what is you 
> opinion now after using this approach?
> 
> Thanks for any hints,
> Joachim
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Validation-Best-Practices--tf4685400.html#a13606501
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Login checking before processing any action/class

2007-11-05 Thread Tom Schneider

With Acegi, are you using an interceptor or is there a different way to
enforce security?  I wouldn't mind seeing an example of this if there's one
that you can point to.  IMO, this would fit into Struts 2 authentication
best practices and a little page describing the general setup wouldn't be a
bad idea.
Thanks,
Tom


Gary Affonso wrote:
> 
> Dave Newton wrote:
>> Interceptor or Acegi.
> 
> +1 on Acegi.
> 
> We've been doing auth "by hand" for years, I think we've used just about 
> every technique over time (writing servlet filters, writing WebWork 
> interceptors, doing checks in the Action's exec method, using 
> container-security, etc).
> 
> But having just climbed the Acegi learning curve (it wasn't as bad as I 
> feared, particularly if you already know Spring) I can say that, for us, 
> it's absolutely the best thing we could be doing.  Should have done it 
> years ago.
> 
> - Gary
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Login-checking-before-processing-any-action-class-tf4754010.html#a13596932
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Jasper plugin. Passing additional parameter

2007-11-05 Thread Tom Schneider

Serg,
I'm not an expert at jasper reports, but I think parameters are pulled from
the datasource.  In that case, the jasper report result wraps the
datasources in a ValueStackDataSource. (a class located in the jasper
reports plugin)  I would set a few breakpoints in there to see why the
jasper plugin isn't finding the parameter.
Tom


Serg Mazurok wrote:
> 
> 
> Could someone provide the example how to pass parameters from Struts2 
> action to Jasper report?
> 
> I have created simple Jasper report based on Struts tutorial. Then I had 
> modified this example in order to use parameter within Jasper report.
> Jasper report JRXML file:
> / class="java.lang.String"/>
> /Action:
> /public String getTest(){
> return "test";
> }/
> 
> But this solution doesn't work. On the report I got 'null' instead of 
> parameter value.
> Could someone give me the point what's wrong with this example?
> 
> Any help is appreciated.
> 
> Best Regards
> 
> -- 
> Serg 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Jasper-plugin.-Passing-additional-parameter-tf4753049.html#a13592389
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: changing template for s:text

2007-10-30 Thread Tom Schneider

The s:text tag is considered a data tag, not a UI tag, so there is no ftl
template backing that take.  Your only option is to extend the tag to add
the functionality that you describe.  The functionality you describe sounds
like it might be useful to others.  Have you considered creating a patch to
add this functionality to the existing text tag?
Tom


Ivan Žučenko wrote:
> 
> Hi all,
> I have an intention to enabel debug mode in my application and one of the
> features should be that it shows resource name in front of every localized
> text in jsp retrieved by 
> For example This is resource  would
> render in html page as: [RESOURCE_1]This is resource.
> I thought of making my custom tag with same fubctionality as in *
> org.apache.struts2.components.Text *or try to extend  *
> org.apache.struts2.components.Text  *or just modify text template. My
> first
> idea was just to create custom theme for it but it is not possible since
> text i snot UI tag.. So which way would you recomand t go?
> Thanks Ivan
> 
> 

-- 
View this message in context: 
http://www.nabble.com/changing-template-for-s%3Atext-tf4719322.html#a13491483
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts 2 and JasperReports Integration

2007-10-30 Thread Tom Schneider

Can you post the full stack trace, so we can figure out where this is
happening?

Looking that the example code, it all looks good, so I'm not sure why the
myList is null.


carmi_cd wrote:
> 
> hi i followed this tutorial.. in JasperReports/Struts 2 Integration
> http://cwiki.apache.org/WW/jasperreports-tutorial.html but I got this
> exception
> 
> Data source value for data source myList was null.
> 
> i dont know whats causing the problem..thanks in advance.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-and-JasperReports-Integration-tf4716462.html#a13490147
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation Best Practices?

2007-10-29 Thread Tom Schneider

Just wanted to point out: http://jcp.org/en/jsr/detail?id=303 which is
relevant to our discussion.  No activity on this JSR since July of '06.  I'm
not convinced that annotations really solve the problem.  I think for
anything more than simple type checking you need a true programming language
to define the validation rules.
-- 
View this message in context: 
http://www.nabble.com/Validation-Best-Practices--tf4685400.html#a13477655
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation Best Practices?

2007-10-29 Thread Tom Schneider

I think drools would be way overkill for simple validation.  Not only would
there be a high learning curve, I don't think it would handle the most
involved cases.  I really think we need to do Java by default.

The reason I included a way to autofind the validation class is to mimic how
the existing xml validation automatically works.  I'm OK with doing
delegation to another validator in the validate() method of the action, I
just thought it might be nice to have convention over explicit delegation,
but I'm open to other ideas.

I would definitely use another validation API under the hood.  My idea would
be to have a standard set of convenience validation methods in the super
class that defers to either commons validation or Spring's validation
support.  I'd like the validation code to be as concise as possible, an API
similar to Spring's valang might work--except in java code instead of a
custom language.

If others would find this kind of thing useful, I think it would be useful
to create a googlecode project to begin a proof of concept.  Work through
what the API would look like because I think it would be a great alternative
to the validation framework that's in place now.  (And as I stated before, I
would love to use this both at the UI level and at the business
logic/component level)
Tom


Gary Affonso wrote:
> 
> Tom Schneider wrote:
>> This is essentially what we're doing as well, but it is far from an ideal
>> situation.  The issue I've seen is that you can't easily use the
>> validators
>> from the xml in the validate() method.  Another disadvantage is that
>> validation is in 2 different places.  Also, some of our validate()
>> methods
>> get pretty verbose--about 400 lines in one instance I looked at.  We'd
>> also
>> like to use the same validation code in the UI and in our business
>> components.  Additionally, sometimes we need to call into the process
>> layer
>> to perform certain validation.  It also is hard to reuse validation using
>> this technique.
> 
> Yes.
> 
> I did a lot of Webwork XML-based validation in our project (and ending 
> up writing a good chunk of the current validation-related docs and I 
> found out how it *really* worked) and, in the end, decided it has been 
> pretty much a bad idea to do validation this way.
> 
> It's just not suited (IMO) for anything complex for the reason you note 
> above and many others (no refactor support in most IDE's, very difficult 
> to write and debug complex OGNL expressions, confusing and redundant 
> validation syntax, etc)
> 
> Others seem to concur, during my exploration/documentation effort I 
> asked essentially the same questions as you guys have (on the WebWork 
> lists) and the general suggestion was to only use the XML-validation 
> framework for simple stuff.
> 
>> * integrate Spring's valang into struts 2
>> * replace the current xml with validation via ruby
>> * replace the current xml with validation via Java, in a class separate
>> from
>> the action
> 
> Other options you might also consider are:
> 
> * integrate commons validation into Struts 2
> 
> Not suggesting this, just saying.
> 
> * integrate a "rules" framework like JBoss Drools
> 
> This, IMO, holds promise if you need an atom-bomb worth of validation 
> capability.
> 
>> The last option [java-based validation] has the most promise.
> 
> That's one of our two top options: implement validation in Java classes 
> corresponding to the "validated" class.
> 
> It'll either be that or something like Drools.  But Drools seems like 
> complete overkill just as Struts 2 xml-based validation is underkill.
> 
>> Something along the lines of:
>> FooAction and FooActionValidator which is automatically executed via an
>> interceptor like the validate() method is now.  FooActionValidator would
>> have helper methods to make the validation logic very concise.  I'd also
>> like an interface like ValidationAware to capture the validation errors
>> from
>> lower levels of the application. (e.g. the process and dao layers)
>> 
>> So, anyone think I'm totally off base?
> 
> +1 on implementing validation in java.  Easily testable if you write 
> your validation class well.
> 
> And yah, you could setup an interceptor and do a whole 
> "auto-find-the-validator-class" sort of thing.  But why?  It's almost as 
> easy to delegate, within the existing "validate" method and it's likely 
> to be way more ide-refactor compatible than some sort of 
> auto-class-loader thing.
> 
> I'm not quite sure what you mean by "lower le

Re: struts 2.1 - Is good enought ?

2007-10-28 Thread Tom Schneider

What's missing is an official release.  If I were you, I would wait until
there is a GA release for the 2.1.x series before running it in production.



Pedro Herrera wrote:
> 
> Is struts 2.1 good enought to a productuion environment ? what´s missing ?
> 
> 
> Herrera
> 
> 

-- 
View this message in context: 
http://www.nabble.com/struts-2.1---Is-good-enought---tf4708054.html#a13460356
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: any struts 2 unit testers out there?

2007-10-28 Thread Tom Schneider

My first suggestion is the make sure that the package.properties files are on
the classpath when you run your junit test.

Secondly, it would be helpful for us to help you figure this out if you post
the stack trace for the null pointer exception.

Third, you may want to debug into the getText() method so you can tell us
exactly where the framework is having problems.  Based on the information
you've provided, it's really hard to figure out where the problem is.  My
guess is it's somewhere in XWork, but without some more information, it's
hard to tell.  Webwork and Struts 2 are very JUnit friendly frameworks, so
I'm sure it's just a matter of configuration.
Tom


Session Mwamufiya wrote:
> 
> Hi All,
> 
> Would someone let me know whether it's possible to tweak something so that
> JUnit test code can run on an action method that calls the ActionSupport
> method getText() to fetch string resources from a package.properties file. 
> As it stands, I keep getting a null exception when getText() is called
> during the unit test.
> 
> Thanks,
> Session
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/any-struts-2-unit-testers-out-there--tf4700279.html#a13459997
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Validation Best Practices?

2007-10-28 Thread Tom Schneider

This is essentially what we're doing as well, but it is far from an ideal
situation.  The issue I've seen is that you can't easily use the validators
from the xml in the validate() method.  Another disadvantage is that
validation is in 2 different places.  Also, some of our validate() methods
get pretty verbose--about 400 lines in one instance I looked at.  We'd also
like to use the same validation code in the UI and in our business
components.  Additionally, sometimes we need to call into the process layer
to perform certain validation.  It also is hard to reuse validation using
this technique.

All these issues indicate that an alternative to the current validation is
needed.  This is especially true for bigger apps that have multiple layers
and very complex validation at multiple levels.  Don and I were discussing
this yesterday on #struts and here are some of the options we came up with:
* integrate Spring's valang into struts 2
* replace the current xml with validation via ruby
* replace the current xml with validation via Java, in a class separate from
the action

The last option has the most promise.  Something along the lines of:
FooAction and FooActionValidator which is automatically executed via an
interceptor like the validate() method is now.  FooActionValidator would
have helper methods to make the validation logic very concise.  I'd also
like an interface like ValidationAware to capture the validation errors from
lower levels of the application. (e.g. the process and dao layers)

So, anyone think I'm totally off base?  I'm not ready to implement anything
yet, however, I think this might solve some of the issues that we've been
having with our validation.
Tom


Igor Vlasov wrote:
> 
> I use validate() method from ActionSupport for complex bussines
> validation.(it works in WorkFlowInterceptor). 
> 
> Sometime, for  trivial fields, i can use Struts ValidationFramework.(it
> works after ParameterInterceptor)
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Validation-Best-Practices--tf4685400.html#a13453669
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [FRIDAY] OGNL Viewer

2007-10-26 Thread Tom Schneider

Musachy is is our javascript expert!  I would demand a Web 2.0 compliant
viewer with animation, fade-in/out and other whizbang features.  :)
Tom


newton.dave wrote:
> 
> --- Musachy Barroso <[EMAIL PROTECTED]> wrote:
>> "I would pay a couple large"
>> 
>> btw where is my cash? :)
> 
> You're rich!
> 
> It'd also be pretty short work to take the stack and
> create a Graphviz file, too.
> 
> d.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OGNL-Viewer-tf4697273.html#a13431931
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: GridView - save multiple items at the same time

2007-10-15 Thread Tom Schneider

Figuring out if there were type conversion errors was something we ran into. 
The bigger issue for us was validation.  There is no easy way to do field
level validation with an editable grid.  (Or I haven't seen a good example
of one)


Josh Vickery-2 wrote:
> 
> You can do this with Struts 2, but I've found that it can be a bit
> hairy when it comes to type conversion.  The general idea is to use an
> action property which is a Map of objects that you want to save keyed
> by a unique identifier for each one.  The two problems that I run into
> when doing this are:
> 
> 1.  The view syntax -- accessing properties in a map using OGNL,
> struts tags, JSTL, and/or JSP EL can be confusing, and I sometimes
> find that a mixture of all of the above is needed for at least
> somewhat concise code.  I often find that I need to look at the
> rendered source of a page in order to figure out how to get the values
> from the page setup action properly displayed, and the user input
> values correctly and safely submitted to the post action.
> 
> 2.  Type conversion -- even after I think I have the submit value
> correct, I sometimes find that Struts 2 does not do type
> conversion/action property population as I expect.  In order to get
> this sorted out, I rely on a debugger, and make sure the debugger has
> access to the Struts 2 and Xwork source (yay open source!)
> 
> For example, say you had a set of questions that you wanted to make
> editable, you might do something like this:
> 
> QuestionSetupAction:
> private List questionList;
> public void setQuestionList(List questionList)...
> public List getQuestionList()...
> public String execute() {
>   questionList = questionDao.findQuestions();
>   return SUCCESS;
> }
> 
> QuestionEdit.jsp:
> 
> 
>value="questionText"/>
> 
> 
> 
> 
> QuestionPostAction:
> private Map questionMap;
> public void setQuestionMap(Map)...
> public Map getQuestionMap()...
> 
> If you want to get fancy, you can use javascript to make any cell on
> your table editable on click, and submit any change to the server
> using ajax.  This doesn't really buy you all that much, unless you
> have lots and lots of rows and columns, in which case you could
> greatly cut the amount of data you need to sort through in the post
> action.
> 
> Josh
> 
> On 10/15/07, wild_oscar <[EMAIL PROTECTED]> wrote:
>>
>> Imagine a table with a List of items (say, a List of people, each with an
>> ID,
>> Name and age). I am thinking about developing a way to make all rows
>> editable and able to be saved simultaneously with a single submit button.
>>
>> Specifically, each item (Person, in the example) is an object mapped with
>> hibernate (although this feature should be independent of the persistent
>> media). And ideally, the method should be smart enough to detect  on
>> which
>> rows there were changes and only update these rows.
>>
>> Has anyone ever developed such a table, or knows of a strategy to
>> implement
>> it?
>> --
>> View this message in context:
>> http://www.nabble.com/GridView---save-multiple-items-at-the-same-time-tf4625630.html#a13209261
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/GridView---save-multiple-items-at-the-same-time-tf4625630.html#a13213826
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: building struts with maven error Java Heap Space

2007-10-08 Thread Tom Schneider

Otherwise, if all else fails, you can just skip the junit tests:

mvn -Dmaven.test.skip=true install

that should at least allow you to build the code if you're having issues
with the unit tests.


Pavel Sapozhnikov wrote:
> 
> Hey Tom thanks I actually tried that but I think it gave me no class found
> error...I wasn't sure and at my work on XP machine I dont think I had to
> set
> anything like this and it worked fine. Well also I have laptop at home
> which
> has XP and I tried doing the same thing and it failed on this error too.
> 
> On 10/8/07, Tom Schneider <[EMAIL PROTECTED]> wrote:
>>
>>
>> Try:
>> set MAVEN_OPT=-Xmx512m
>>
>> before you run the maven build.  The problem is that maven doesn't have
>> enough heap space to run the tests.  The environment variable above
>> should
>> increate the maximum java heap space for maven.
>> Tom
>>
>>
>> Pavel Sapozhnikov wrote:
>> >
>> > Hi I am trying to mvn the checked out Struts2. First I have
>> successfully
>> > mvn'ed xwork 2.0.4 and that went fine now I am trying to mvn Struts2
>> and
>> > when it gets to Test I get the following:
>> >
>> > Tests run: 9, Failures: 2, Errors: 0, Skipped: 3, Time elapsed:
>> 13.472sec
>> > <<< F
>> > AILURE!
>> > Running org.apache.struts2.util.StrutsTypeConverterTest
>> > Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>> 0.767sec
>> > Running org.apache.struts2.views.jsp.URLTagTest
>> > Tests run: 72, Failures: 2, Errors: 0, Skipped: 70, Time elapsed:
>> 11.482
>> > sec
>> > <<<
>> >  FAILURE!
>> > Running org.apache.struts2.util.InvocationSessionStoreTest
>> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 6.65
>> sec
>> > <<<
>> > FAI
>> > LURE!
>> > Running
>> > org.apache.struts2.interceptor.StrutsConversionErrorInterceptorTest
>> > Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed:
>> 7.481sec
>> > <<< FA
>> > ILURE!
>> > Running org.apache.struts2.views.util.UrlHelperTest
>> > Tests run: 38, Failures: 1, Errors: 0, Skipped: 37, Time elapsed:
>> 9.75sec
>> > <<< F
>> > AILURE!
>> > Running org.apache.struts2.views.jsp.MergeIteratorTagTest
>> > Tests run: 6, Failures: 1, Errors: 0, Skipped: 5, Time elapsed:
>> 4.915sec
>> > <<< FA
>> > ILURE!
>> > Running org.apache.struts2.components.template.BaseTemplateEngineTest
>> > dummy resource
>> > url=file:/C:/Users/Pavel/workspace/Struts/core/target/test-classe
>> > s/org/apache/struts2/components/template/dummy.properties
>> > resource
>> > file=C:\Users\Pavel\workspace\Struts\core\target\test-classes\org\apach
>> > e\struts2\components\template\dummy.properties
>> > theme properties
>> > dir=C:\Users\Pavel\workspace\Struts\core\target\test-classes\or
>> > g\apache\struts2\components\template
>> > Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
>> 4.358sec
>> > <<< FA
>> > ILURE!
>> > Running org.apache.struts2.dispatcher.ServletRedirectResultTest
>> > org.apache.maven.surefire.booter.SurefireExecutionException: Java heap
>> > space; ne
>> > sted exception is java.lang.OutOfMemoryError: Java heap space
>> > java.lang.OutOfMemoryError: Java heap space
>> > [INFO]
>> >
>> 
>> > [ERROR] BUILD FAILURE
>> > [INFO]
>> >
>> 
>> > [INFO] There are test failures.
>> > [INFO]
>> >
>> 
>> > [INFO] For more information, run Maven with the -e switch
>> > [INFO]
>> >
>> 
>> > [INFO] Total time: 2 minutes 21 seconds
>> > [INFO] Finished at: Mon Oct 08 17:45:24 EDT 2007
>> > [INFO] Final Memory: 28M/61M
>> > [INFO]
>> >
>> 
>> >
>> > If anyone has any ideas on what exactly is going on please help. At
>> work
>> > on
>> > XP machine  this doesn't happen. I am using Vista with Java 1.6 and
>> latest
>> > maven 2.0.7 I believe. Any help would be greatly appreciated. Thanks.
>> >
>> > --
>> > Pavel Sapozhnikov
>> > xFact, Inc
>> > [EMAIL PROTECTED]
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/building-struts-with-maven-error-Java-Heap-Space-tf4590970.html#a13107953
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Pavel Sapozhnikov
> xFact, Inc
> [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/building-struts-with-maven-error-Java-Heap-Space-tf4590970.html#a13108513
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: S2: Paging components

2007-10-08 Thread Tom Schneider

Take a look at TableTags:

http://cwiki.apache.org/S2PLUGINS/table-tags.html

It includes a UI tag that displays a basic pager.  (It also does sorting) 
This is a struts 2 port of what we use for paging and sorting in webwork.
Tom


Joshua Jackson-3 wrote:
> 
> Dear all,
> 
> How do I implement paging for limiting in displaying list of data? Is
> there already a ready set component for this is Struts2? How do you
> guys implement it in S2 if this paging component is not available in
> S2?
> 
> Thanks in advance,
> joshua
> 
> -- 
> It's not just about coding, it's a matter of fulfilling your core being
> 
> YM!: thejavafreak
> Blog: http://joshuajava.wordpress.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/S2%3A-Paging-components-tf4591699.html#a13108357
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: building struts with maven error Java Heap Space

2007-10-08 Thread Tom Schneider

Try:
set MAVEN_OPT=-Xmx512m

before you run the maven build.  The problem is that maven doesn't have
enough heap space to run the tests.  The environment variable above should
increate the maximum java heap space for maven.
Tom


Pavel Sapozhnikov wrote:
> 
> Hi I am trying to mvn the checked out Struts2. First I have successfully
> mvn'ed xwork 2.0.4 and that went fine now I am trying to mvn Struts2 and
> when it gets to Test I get the following:
> 
> Tests run: 9, Failures: 2, Errors: 0, Skipped: 3, Time elapsed: 13.472 sec
> <<< F
> AILURE!
> Running org.apache.struts2.util.StrutsTypeConverterTest
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.767 sec
> Running org.apache.struts2.views.jsp.URLTagTest
> Tests run: 72, Failures: 2, Errors: 0, Skipped: 70, Time elapsed: 11.482
> sec
> <<<
>  FAILURE!
> Running org.apache.struts2.util.InvocationSessionStoreTest
> Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 6.65 sec
> <<<
> FAI
> LURE!
> Running
> org.apache.struts2.interceptor.StrutsConversionErrorInterceptorTest
> Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 7.481 sec
> <<< FA
> ILURE!
> Running org.apache.struts2.views.util.UrlHelperTest
> Tests run: 38, Failures: 1, Errors: 0, Skipped: 37, Time elapsed: 9.75 sec
> <<< F
> AILURE!
> Running org.apache.struts2.views.jsp.MergeIteratorTagTest
> Tests run: 6, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 4.915 sec
> <<< FA
> ILURE!
> Running org.apache.struts2.components.template.BaseTemplateEngineTest
> dummy resource
> url=file:/C:/Users/Pavel/workspace/Struts/core/target/test-classe
> s/org/apache/struts2/components/template/dummy.properties
> resource
> file=C:\Users\Pavel\workspace\Struts\core\target\test-classes\org\apach
> e\struts2\components\template\dummy.properties
> theme properties
> dir=C:\Users\Pavel\workspace\Struts\core\target\test-classes\or
> g\apache\struts2\components\template
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.358 sec
> <<< FA
> ILURE!
> Running org.apache.struts2.dispatcher.ServletRedirectResultTest
> org.apache.maven.surefire.booter.SurefireExecutionException: Java heap
> space; ne
> sted exception is java.lang.OutOfMemoryError: Java heap space
> java.lang.OutOfMemoryError: Java heap space
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] There are test failures.
> [INFO]
> 
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> 
> [INFO] Total time: 2 minutes 21 seconds
> [INFO] Finished at: Mon Oct 08 17:45:24 EDT 2007
> [INFO] Final Memory: 28M/61M
> [INFO]
> 
> 
> If anyone has any ideas on what exactly is going on please help. At work
> on
> XP machine  this doesn't happen. I am using Vista with Java 1.6 and latest
> maven 2.0.7 I believe. Any help would be greatly appreciated. Thanks.
> 
> -- 
> Pavel Sapozhnikov
> xFact, Inc
> [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/building-struts-with-maven-error-Java-Heap-Space-tf4590970.html#a13107953
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [S2] The performance issue about OGNL

2007-02-27 Thread Tom Schneider

This is not a bug per se.  The xhtml theme extends the simple theme.
If a template doesn't exist in the xhtml theme it will fall back the
simple theme.  From a performance perspective, you simple need to copy
the simple theme hidden.ftl to the xhtml directory.  This will allow
freemarker to cache it properly.

On 2/27/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:

Sorry to disturb again.

This issue is because default the s:hidden tag will use xhtml as theme, but
actually in the distribution, there is no template/xhtml/hidden.ftl. It
always get from template/simple/hidden.ftl. But the cache does not know it.
Then this template is recompiled again and again.

Will report it to JIRA.

A bad news for me, just know my target .net project response time is around
0.3 second. Any suggestion to improve the speed? If I use apache work with
tomcat or any web server, can I get faster speed?

Regards,

Zheng Shuai

On 2/27/07, Shuai Zheng <[EMAIL PROTECTED]> wrote:
>
> One more thing, this only happens on template/xhtml/hidden.ftl.
>
> Should I report this as a bug?
>
> On 2/27/07, Shuai Zheng < [EMAIL PROTECTED]> wrote:
> >
> > Dear All,
> >
> > Still do research on the debug log and try to get performance
> > improvement, because I try to beat another .net system on speed(it can shows
> > all the pages in 0.5 second,sigh).
> >
> > One more thing I just find out, if the log does not cheat me:)
> >
> > Although I have enabled the property template_update_delay=6 in
> > freemarker.properties and also move the template out the jar file.
> > So there are a lot of log like:
> > "[freemarker.cache]http-8080-Processor24
> > template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
> > using cached."
> > So it looks correct. But also, there are something like followings:
> >
> > "Could not find template in cache, creating new one;
> > id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]"
> > "template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
> > stale; using cached."
> > Above logs occur in the log again and again. I don't know what happened
> > actually but it shows the hidden.ftl is not cached at all (how can this
> > happens? when some others are cached?)
> >
> > Regards,
> >
> > Zheng Shuai
> >
> >
> > On 2/26/07, Vlad2006 < [EMAIL PROTECTED]> wrote:
> > >
> > >
> > > Hi Zheng,
> > >
> > > Have you profiled your application? Are you sure it is OGNL that makes
> > > your
> > > application slow?
> > >
> > > From my experience it is not so slow. At least I have not found it too
> > > be a
> > > bottleneck in my application. Not yet :-).
> > >
> > > What is really slow in WebWork/Struts2 is jsp tags like, textfield,
> > > radio,
> > > anchor, and other which are using FreeMarker templates.
> > >
> > > If it is your case, you could make it faster, you have to extract
> > > templates
> > > out of webwork.jar (in your case probably struts.jar) and put them in,
> > > for
> > > example, WEB-INF/templates directory.
> > > There is a page on WebWork Wiki about it:
> > > http://wiki.opensymphony.com/display/WW/Performance+Tuning
> > >
> > > I am not using Struts2 yet, but I believe most of the tips will work
> > > for
> > > Struts2.
> > >
> > > One more thing that could make application slower is when resource
> > > bundles
> > > are constantly reloaded. It is good for dev but not acceptable for
> > > production. Check in struts property like: webwork.i18n.reload=false
> > >
> > >
> > > Best regards
> > > Vlad
> > >
> > >
> > >
> > > Shuai Zheng wrote:
> > > >
> > > > Dear All,
> > > >
> > > > I am using struts 2.0.6, but honestly the performance is very bad
> > > (not
> > > > need
> > > > to think about scalability), to speed to load a simple page is much
> > > slower
> > > > than pure JSP (I haven't compared with struts 1). To refresh one
> > > page it
> > > > is
> > > > 3-5 seconds with only one user. The profiler tells me the OGNL is
> > > the
> > > > bottleneck.
> > > >
> > > > I notice that there are some complains on OGNL about the performance
> > > > already, may I know any other way to replace OGNL with anything else
> > > to
> > > > get
> > > > a faster speed? Currently the speed is not acceptable for
> > > production.
> > > >
> > > > Regards,
> > > >
> > > > Zheng Shuai
> > > >
> > > >
> > >
> > > --
> > > View this message in context:
> > > 
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>



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



Re: [s2] sitemesh PageFilter

2007-02-26 Thread Tom Schneider

I don't think you need a plugin for jsp support.  In webwork, there
wasn't any specific support for sitemesh--it just worked.  I believe
the same is true for struts2.

On 2/26/07, C. Adams <[EMAIL PROTECTED]> wrote:

I have just begun looking into sitemesh, and was pleased to see a struts2
plugin. But the documentation is very sketchy, and I'm not sure what it
adds. I also didn't find mention of the plain jsp PageFilter, it just
mentions velocity and freemarker.

Thanks



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



Re: [DESIGN] struts dialog / wizard

2007-02-25 Thread Tom Schneider

Mark Menard has done some work in this area for struts2:
http://www.vitarara.org/cms/node/84

For webwork I implemented something similar called a model repository.  
The problem that's being solved is that when the domain model reaches a 
certain complexity, using the null instantiation feature and reading the 
model from the database again fail to work.  The basic idea of the model 
repository was to save off the domain model somewhere (e.g. serial to a 
hidden field on the client, in an ehcache cache, in the session) before 
you go to the edit screen.  When the data is posted back, before the 
parameter interceptor runs, you restore the model.  This allows you to 
set the parameters back onto exactly the same model you edited.


I like the idea of expanding the model repository idea to include the 
concept of conversation scope, but I don't want to loose simplicity of 
model repository.  I'll probably create a plugin at some point to 
provide this functionality.


Finally, there's also the scope interceptor that Don wrote that is still 
in the sandbox.


Of course, all of this is for struts 2, so it doesn't do you any good 
for 1.4.  :o)


Paul Benedict wrote:
How often do people develop wizards with Struts? I have a custom 
form/action which allows me to do that. Perhaps I should think about 
putting it into Struts 1.4?


Strachan, Paul wrote:

Hi,

I'm looking at implementing a struts wizard flow (of about 12 pages) 
into my struts-1.2.9 application.  The struts dialogue project seems 
to be along the lines of what I need (pattern-wise).  I have some 
extra quirements such as:


1. A progress menu (synch with the wizard)

2. Some pages have options (eg radio buttons) which alter the later flow

3. The usual next/previous buttons + ability for user to navigate 
directly to some pages


4. A review page which allow user to 'amend' sections (eg button to 
navigate back to that page)


5. Once the wizard is complete (ie "submitted for processing"), the 
user can still make changes to some pages while not others (actually 
this depends a bit on the current state of the internal processing) - 
I suspect each page needs to obtain its own state dynamically and 
present a read-only or update view.


Can anyone advise there experience with struts-dialog (sourceforge) 
or some other wizard or workflow framework/model that would suit this 
requirement?


Thanks,

Paul

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

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




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





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



Re: Struts 2 and QueryString

2007-02-23 Thread Tom Schneider

Might this be the issue:
https://issues.apache.org/struts/browse/WW-1563  This was an issue for
websphere, but other app servers may act the same.  (Not jetty or
jboss though)
Tom

On 2/23/07, Matt Filion <[EMAIL PROTECTED]> wrote:

I sent an post about this a few days ago and didnt really get a response.
I'm starting to have the need to do some AJAX calls now and need some help
on resolving this. I basically have not found any way to get the values
from the querystring within an Interceptor or Action. I've tried accessing
the request directly, having struts set the values for me on my action and
by searching the value stack and cannot find the values anywhere. In fact,
when I access the request directly and call the getQuerystring method it
returns null. Has anyone else come across this issue? I'm running struts
2.0.5 jdk 1.4.2 version.

Thanks

Matt




This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written agreement or government initiative expressly permitting the use of
e-mail for such purpose.




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



Re: [S2] Equivalent of Servlet init() method?

2007-02-22 Thread Tom Schneider

I see a couple of options.

The first would be to create an interceptor for your singleton factory.  
In the init of the interceptor you would initialize this factory and 
then provide some mechanism to inject that factory into your actions.  
(possibly via a FactoryAware interface)


Another option would be to convert your factory to use spring.  Spring 
provides mechanisms to initialize beans:

http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-factory-lifecycle-initializingbean
Tom


bob wrote:
I could be wrong, but perhaps you should use the Spring IoC container for this.  I can't point you to the correct documentation off hand, but I believe that this is the way to maintain a resource such as what you had previoulsy done with the Servlet's init method and the factory class.  


Maybe someone with more experience integrating spring and struts2 can chime in 
with some doc recommendations.  I'm a bit of a newbie myself unfortunatley.




___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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


  



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



Re: [S2] how do I handle upload larger than struts.multipart.maxSize

2007-02-17 Thread Tom Schneider

Please see the section on Parameters:
http://struts.apache.org/2.x/docs/file-upload-interceptor.html

And the multipart section of:
http://struts.apache.org/2.x/docs/strutsproperties.html

Nagraj Rao wrote:
cant we override the max size in the struts.properties file... i guess 
we should be able to...


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





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



Re: IS struts 2 websphere compatible?

2007-02-17 Thread Tom Schneider
Actually Websphere 6.1 runs on IBM's JDK 1.5.  It's only Websphere 5.1 
and 6.0 that use JDK 1.4.2.


Praveen, Galagali (IE10) wrote:

Hi,

 


If struts2 needs jdk version 5 and if websphere 5.x or 6.x is not
compatible with jdk 1.5 can we still use struts 2 for our application
and still get it work fine ? 

 


Thanks,

Praveen

 



  



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



Re: Spring AOP X-work Error

2007-02-14 Thread Tom Schneider
I believe this is a bug that is already fixed in trunk.  Please take a 
look at the xwork forum(s) if you need more details.  (There a long 
thread on dynamic proxy invocation over there about this issue.)

Tom

thomas_ramapuram wrote:

Hi,
I was using Spring AOP along with Struts 2.0.5.  The problem is that
when I try to use AOP for logging performance in Struts I get an exception. 
The class and the xml Conf and the Exception are given below.  I'm using
Struts 2.0.5.   Actually I'm using a starter application called appfuse. 
Which has already implemented an action called UserAction. 


I thought i saw a similar error in the userlist
http://www.nabble.com/forum/ViewPost.jtp?post=8800212&framed=y but I'm not
sure if it is the same error.

CLASS:

package com.mycompany.service;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.ProceedingJoinPoint;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.Calendar;

@Aspect
public class AroundExample {
   protected final Log log = LogFactory.getLog(getClass());
 @Around("execution(* org.appfuse..*.*(..))")
 public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {

 long startTime = Calendar.getInstance().getTimeInMillis();

   Object retVal = pjp.proceed();

 log.warn("Time Taken: " +  (Calendar.getInstance().getTimeInMillis() -
startTime));
   // stop stopwatch
   return retVal;
 }
}

applicationContext.xml:

http://www.springframework.org/schema/beans";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
   


Error:
java.lang.IllegalArgumentException: The edit() is not defined in action
class $Proxy44
   at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:417)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:262)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:224)
   at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:213)
   at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:161)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
   at
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
   at
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
   at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
   at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(

Re: [struts 2] Simplifying the interceptor stack

2007-02-08 Thread Tom Schneider
I can confirm these results based on my own webwork profiling 
experience.  I wouldn't worry too much about interceptors that you don't 
use--the penalty is very minimal.


David H. DeWolf wrote:



mraible wrote:


Also, are there any performance reasons to have separate stacks for 
display

only (list) screens vs. forms (crud)?


I recently went through a series of performance monitoring and tuning
and found that standard interceptors that are NOT executed are logged as
taking 0ms.  So, whatever the cost, it's fairly small.

Have you tried turning on the -Dxwork.profile.activate=true switch to
find the metrics. See:
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/util/profiling/UtilTimerStack.html 




David



Thanks,

Matt



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





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



Re: s:textfield tag breaking line in page

2007-02-07 Thread Tom Schneider

or

as a global setting.
Tom

On 2/7/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote:



It generates 2 cell row + optional error message for field if parent
form is of theme 'xhtml' or 'ajax'. You may override cild behaviour by
setting theme 'simple' on a single tag.

regards
Dariusz Wojtas

On 2/7/07, Daniel Amadei <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I`m using the tags textfield and password and I noticed it is creating
> a new  element which positions the fields vertically. I need them
> horizontally, so I`d like struts just to create the  tag for
> me, nothing more. How can this be done?
>
> Thanks,
> Daniel

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




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



Re: s2 Select listValue with message bundle key

2007-02-06 Thread Tom Schneider



This code will iterate over the languageList and look for a iso2Code
property on each bean within the languageCode.  Based on your description, I
don't think that's the intent.  Try something like this:



'top' should grab the top element of the OGNLValueStack, since what you
really want is the strings that you are interating over.



On 2/6/07, d4kris <[EMAIL PROTECTED]> wrote:



Hi,

Im trying to populate a select list with the select tag and would like the
listValue to lookup a message in a resource bundle. Does anybody know if
this is possible or do I have to populate my list with the proper values
before sending it to my jsp?

Example:
I have a property languageList, which is a list of language codes like
'en',
'fr' etc.
The select list I want to generate should have the iso2Code as key and the
message from a resource bundle with the key iso2Code.

So something along these lines:



Any ideas?
Thanks
/K
--
View this message in context:
http://www.nabble.com/s2-Select-listValue-with-message-bundle-key-tf3181085.html#a8827596
Sent from the Struts - User mailing list archive at Nabble.com.


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




Re: Struts 2 and Spring AOP using ProxyFactoryBean

2007-02-04 Thread Tom Schneider

This is a bug I just fixed in xwork 1.2.x and xwork 2.0.x.

See http://jira.opensymphony.com/browse/XW-465 for details.
Tom

Shih Lee wrote:

Hello,

I have downloaded struts-blank to play around. I was trying to use Spring
AOP with Struts 2. However, I am getting the following error:

2007-02-04 21:27:17,233 DEBUG AbstractBeanFactory - Bean with name
'helloWorld' is a factory bean
java.lang.IllegalArgumentException: object is not an instance of declaring
class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at advice.TimeLoggingInterceptor.invoke(TimeLoggingInterceptor.java:31)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:354)
at
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:228)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:202)
at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:147)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:80)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:204)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:120)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:59)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:174)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.intercept(PrepareInterceptor.java:115)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.Servlet

Re: Producing links

2007-02-04 Thread Tom Schneider
Joe you're assessment is correct.  There is usually a 1 to 1 mapping 
between JSP tag and UI component.  Right now the form tag and url tag 
duplicate several pieces of key url building logic.  I spent some time 
abstracting away url building this weekend.  I'm not far enough along to 
actually submit a patch, but I think this would greatly reduce the 
duplication of code.  This is an issue for me because one of the project 
that I lead, tabletags, also does a lot with building up url's.  Let me 
know if your interested in seeing some of this and I'll post the basic 
API and default implementations of this new urlbuilding functionality.


The other option would be to add this functionality to the existing 
 tag.  I'm not sure if this makes sense from an API 
perspective--it may get a little weird if you allow  tags to 
be nested within, and also allow the body content of the  to be 
the text within the html anchor tag.  From that perspective, a seperate 
 tag makes more sense.  It would also depend on how 
similar the ftl templates are and whether the differences are enough to 
warrant a seperate template.

Tom

Joe Germuska wrote:

There's an open ticket for this issue

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

I assigned it to myself, since I, too, am interested in such 
functionality,

but I'm looking for some suggestions from someone, anyone with more
familiarity with the architectural model for the S2 tags because I don't
quite see how to maximize reuse (because it's essentially a hybrid of the
 and  tags and I'm not sure how to blend them while 
holding to
what seems to be the model of a single component object per tag.  
Maybe we
could make a completely new component object, but then the question is 
how

to not have duplicate code with the Anchor and Url components.

Joe


On 2/4/07, Gonçalo Luiz <[EMAIL PROTECTED]> wrote:


Hello,

Even though the method I'm using to produce links is working, I think
of it like a little bit awkward.

An example of what I'm saying is:

">




Is there a more "elegant" way of producing links that does not involve
this "sub-tag" schema ?


Thank you.

Best Regards,
--
Gonçalo Luiz

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








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



Re: Producing links

2007-02-04 Thread Tom Schneider

I think the idea here is that you'd want to do something like:




To me, this makes sense because there were many places where I used an 
ww:url tag and a ww:a tag directly after it, so having one tag that 
would handle the functionality of both would be useful.

Tom

Dave Newton wrote:

--- Gonçalo Luiz <[EMAIL PROTECTED]> wrote:
  

">
  


Is there a more "elegant" way of producing links
that does not involve this "sub-tag" schema ?



Like what? That's how the  tag works, it has an
href and the text is the  body.

If you want to automagicate it write a custom tag, but
I'm not entirely sure it would be worth it.

d.



 


Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


  



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



Re: [ot] [s2] getting servletContext in actions

2007-01-31 Thread Tom Schneider

Jeffrey,
You need to make sure your FactoryBean returns false for the isSingleton and
you might want to add lazy-load as well.  (I think singleton=false implies
lazy load, but I'm not sure)
Tom

On 1/31/07, Jeffrey Hau <[EMAIL PROTECTED]> wrote:


Hi Tom,
I have tried your suggestion, my applicationContex.xml is now defined
as,


 

 






 


my StrutsServletContextLoader class consists of one method

public ServletContext getServletContext() {
return ServletActionContext.getServletContext();
}

i am getting error from spring complaining missing servlet context.

You mentioned ServletActionContext needs to the executed within the
context of a webwork request, i think the problem is related to that.
Do you know how can i make my StrutsServletcontextLoader be executed
within a webwork request?

many thanks

Jeff


On 31 Jan 2007, at 13:52, Tom Schneider wrote:

> It would be very easy to create a Spring FactoryBean for this.
> (Checkout the Spring Documentation if that doesn't make sense)
> Then, to access the servlet context, just do a:
>
> ServletContext servletContext =
> ServletActionContext.getServletContext();
>
> The FactoryBean would allow you to use dependency injection in
> spring to inject the servlet context into any spring bean.  (I'm
> doing a similar thing with some of the our legacy services and
> components)  You could even convert the ServletContext into a Map
> to decouple yourself from the servlet API.  That way your process
> beans would only be dependent on a Map instead of a
> ServletContext.  Keep in mind that the ServletActionContext is a
> thread local, so it must be executed from within the context of a
> webwork request.
> Tom
>
>
> Jeffrey Hau wrote:
>> Hi Joe,
>> Thanks for the helpful information. I am just wondering is it
>> possible to get the ServletContext object in my spring
>> applicationContext.xml? What i am trying to do now is to create a
>> Resource object (ServletContextResource) and inject into a service
>> class and then use this service class in a struts action. At the
>> moment, I have to pass in the resource path (as a string) into the
>> action, instantiate the ServletContextResource in the action then
>> pass it to the service class.
>>
>> many thanks,
>>
>> Jeff
>>
>> On 31 Jan 2007, at 12:53, Joe Germuska wrote:
>>
>>> You need to make sure that your action is passing through an
>>> interceptor-stack that includes ServletConfigInterceptor
>>>
>>> http://struts.apache.org/2.x/core/apidocs/org/apache/struts2/
>>> interceptor/ServletConfigInterceptor.html
>>>
>>>
>>> The struts-default package does include this.
>>>
>>> http://struts.apache.org/2.x/docs/struts-defaultxml.html
>>>
>>> Another thing you can do is call the static method
>>> ServletActionContext.getServletContext() but this would be harder
>>> to support
>>> in a unit testing environment.  If  you implement
>>> ServletContextAware, then
>>> you could provide a mock ServletContext implementation in your
>>> unit test
>>> setup, while you'd have a lot more awkward setup to do to make
>>> sure that
>>> ServletActionContext.getServletContext was prepared to return a
>>> usable
>>> value.
>>>
>>> Joe
>>>
>>>
>>> On 1/31/07, Nagraj Rao <[EMAIL PROTECTED]> wrote:
>>>>
>>>> were u actually able to get the servletContext Object thru
>>>> servletContextAware?? I'd tried it but couldn't get it :(
>>>> do we need to do any additional stuff for that??
>>>>
>>>> - Original Message -
>>>> From: "Jeffrey Hau" <[EMAIL PROTECTED]>
>>>> To: "Struts Users Mailing List" 
>>>> Sent: Wednesday, January 31, 2007 4:55 PM
>>>> Subject: [s2] getting servletContext in actions
>>>>
>>>>
>>>> > Hi,
>>>> > If i need to get a servletContext object in my action class, is
>>>> > implementing the ServletContextAware interface the standard way
>>>> of  doing
>>>> > this? Is there any other alternatives?
>>>> >
>>>> > thanks,
>>>> >
>>>> > Jeff
>>>> >
>>>> >
>>>> ---
>>>> --
>>>> &

Re: [s2] getting servletContext in actions

2007-01-31 Thread Tom Schneider
It would be very easy to create a Spring FactoryBean for this.  
(Checkout the Spring Documentation if that doesn't make sense)  Then, to 
access the servlet context, just do a:


ServletContext servletContext = ServletActionContext.getServletContext();

The FactoryBean would allow you to use dependency injection in spring to 
inject the servlet context into any spring bean.  (I'm doing a similar 
thing with some of the our legacy services and components)  You could 
even convert the ServletContext into a Map to decouple yourself from the 
servlet API.  That way your process beans would only be dependent on a 
Map instead of a ServletContext.  Keep in mind that the 
ServletActionContext is a thread local, so it must be executed from 
within the context of a webwork request.

Tom


Jeffrey Hau wrote:

Hi Joe,
Thanks for the helpful information. I am just wondering is it possible 
to get the ServletContext object in my spring applicationContext.xml? 
What i am trying to do now is to create a Resource object 
(ServletContextResource) and inject into a service class and then use 
this service class in a struts action. At the moment, I have to pass 
in the resource path (as a string) into the action, instantiate the 
ServletContextResource in the action then pass it to the service class.


many thanks,

Jeff

On 31 Jan 2007, at 12:53, Joe Germuska wrote:


You need to make sure that your action is passing through an
interceptor-stack that includes ServletConfigInterceptor

http://struts.apache.org/2.x/core/apidocs/org/apache/struts2/interceptor/ServletConfigInterceptor.html 




The struts-default package does include this.

http://struts.apache.org/2.x/docs/struts-defaultxml.html

Another thing you can do is call the static method
ServletActionContext.getServletContext() but this would be harder to 
support
in a unit testing environment.  If  you implement 
ServletContextAware, then

you could provide a mock ServletContext implementation in your unit test
setup, while you'd have a lot more awkward setup to do to make sure that
ServletActionContext.getServletContext was prepared to return a usable
value.

Joe


On 1/31/07, Nagraj Rao <[EMAIL PROTECTED]> wrote:


were u actually able to get the servletContext Object thru
servletContextAware?? I'd tried it but couldn't get it :(
do we need to do any additional stuff for that??

- Original Message -
From: "Jeffrey Hau" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Wednesday, January 31, 2007 4:55 PM
Subject: [s2] getting servletContext in actions


> Hi,
> If i need to get a servletContext object in my action class, is
> implementing the ServletContextAware interface the standard way
of  doing
> this? Is there any other alternatives?
>
> thanks,
>
> Jeff
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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





--Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com

"The truth is that we learned from João forever to be out of tune."
-- Caetano Veloso



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





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



Re: [s2] Finding a URL of an Action within execute()

2007-01-30 Thread Tom Schneider

Take a look at ServletActionRedirectResult, something like this might do it:

   @Inject
   public void setActionMapper(ActionMapper mapper) {
   this.actionMapper = mapper;
   }

to inject the action mapper.  I've coined the phrase 'magic injector' to 
describe this.  Then


 String uri = actionMapper.getUriFromActionMapping(new 
ActionMapping(actionName, namespace, method, null))


to get the URI, then

   String url = UrlHelper.buildParametersString(requestParameters, uri, 
"&");


to build the actual url string.  That's the gist of it, you should be 
able to getting something up and running from this.

Tom


Eric Rank wrote:

Thanks Bob,

I wouldn't be too afraid of doing something like that, but I need the 
URL for a different Action, named in the mapping -- that is, I don't 
need the URL for the Action that's executing.


Eric Rank


On Jan 30, 2007, at 6:07 PM, bob wrote:



This is surely not the best way . . . but you can implement one of 
the Aware interfaces that gives you a reference to the ServletRequest 
and get the URL info from that, from there I assume you could 
probably build the action specific url.  But I'm also sure there must 
be access to the struts mappings so maybe someone can tell you how to 
get that.







 --- On Tue 01/30, Eric Rank < [EMAIL PROTECTED] > wrote:
From: Eric Rank [mailto: [EMAIL PROTECTED]
To: user@struts.apache.org
Date: Tue, 30 Jan 2007 16:56:21 -0700
Subject: [s2] Finding a URL of an Action within execute()

Hi List,I'm attempting to construct a URL within an action's execute 
code.  The URL will be sent out in an email, serving as a link for a 
user to  click on. It'd be great if I could do this by finding the 
URL of an  Action using the Action name, which I have defined in the 
struts.xml  file.Is it possible? What's the best way to do 
it?Thanks,Eric 
Rank-To 
unsubscribe, e-mail: [EMAIL PROTECTED] additional 
commands, e-mail: [EMAIL PROTECTED]


___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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




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





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



Re: upgrade to 2.0.4

2007-01-29 Thread Tom Schneider
Does this: 
http://marc.theaimsgroup.com/?l=struts-user&m=117002603126715&w=2 help you?

Tom

xiao jie wrote:

hi:
I tried to update my application from 2.0.1 to 2.0.4 and I have downloaded all the nightly built 
2.0.4 jar files and plugins i needed and put them under WEB-INF/lib (do I have to remove the struts2-core-2.0.1 as well), is that all I have to do?
but I ended up with errors saying 
Element type "bean" must be declared. 
File:jar:file:/C:/Documents%20and%20Settings/st.Pamann/project2.0.4/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/struts2-blank-2.0.1/WEB-INF/lib/struts2-core-2.0.4-SNAPSHOT-20070128.jar!/struts-default.xml


any suggestions on this will be appreciated!
thanks


 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.

http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
  



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



Re: [s2] Cannot create a session after the response has been committed: struts or tomcat ?

2007-01-29 Thread Tom Schneider

Does this http://jira.opensymphony.com/browse/WW-291 have anything to do
with this?  It seems like if Struts 2 is doing a sendError when it should be
throwing a ServletException like WW currently is, you would get results like
this.  It still means that there is another error that is the root cause of
this--it's just being masked currently.
Tom

On 1/29/07, bob <[EMAIL PROTECTED]> wrote:



Dariusz,

Thanks for the response.  I'm pretty sure that hibernate is not the
culprit.  In fact, I've done a quick test to verify that I get the same
error when I take hibernate out of the picture.

Stack trace:

05:00:52,946 ERROR Dispatcher:341 - Could not execute action
java.lang.IllegalStateException: Cannot create a session after the
response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java
:2214)
at org.apache.catalina.connector.Request.getSession(Request.java
:2024)
at org.apache.catalina.connector.RequestFacade.getSession(
RequestFacade.java:831)
at javax.servlet.http.HttpServletRequestWrapper.getSession(
HttpServletRequestWrapper.java:215)
at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java
:172)
at
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(
DebuggingInterceptor.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(
ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(
I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.intercept(
PrepareInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(
ServletConfigInterceptor.java:156)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(
AliasInterceptor.java:124)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(
ExceptionMappingInterceptor.java:180)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(
DefaultActionInvocation.java:200)
at org.apache.struts2.impl.StrutsActionProxy$1.call(
StrutsActionProxy.java:27)
at org.apache.struts2.impl.StrutsActionProxy$1.call(
StrutsActionProxy.java:26)
at org.apache.struts2.impl.RequestContextImpl.callInContext(
RequestContextImpl.java:152)
at org.apache.struts2.impl.StrutsActionProxy.execute(
StrutsActionProxy.java:25)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(
Dispatcher.java:330)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
FilterDispatcher.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
05:00:53,554 ERROR [default]:260 - Servlet.service() for servlet default
threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendError(
ResponseFacade.java:404)
at org.apache.struts2.dispatcher.Dispatcher.sendError(
Dispatcher.java:588)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(
Dispatcher.java:342)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(

Re: Dynamically redirect to a page

2007-01-28 Thread Tom Schneider

http://marc.theaimsgroup.com/?l=struts-user&m=116826570319911&w=2,

Omer Basar wrote:

Hi all,

I have another problem. I want to redirect my action to a link but the 
link

must be gathered from database and it can be chosen randomly. So I cannot
staticly put a definition for this action in struts.xml . How can I do 
this.
(Example : When I press a button I forward it to ClickAction and I 
want it

to redirect to another page such www.yahoo.com or www.gmail.com (it is
chosen randomly))

Thanks In Advance.




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



Re: Struts 2.0 vs Struts 1.3.5 vs Struts 1.2

2007-01-26 Thread Tom Schneider

Joe Germuska wrote:
Struts 1.3.5 is intended to be essentially backwards compatible with 
1.2.x;

information on the details is here:
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

Struts 2 is substantially different.  I would not expect a Struts 1
developer to implement a project on the same time frame if it also 
included

learning to switch to Struts 2.
I disagree to a certain degree.  If the project is large enough and 
involves enough complexity, the productivity benefits of struts 2 will 
offset the learning curve.  (It also depends on how quickly the 
developer(s) can come up to speed)  We saw this on one of our projects 
where the conversion to webwork actually reduced implementation time 
even though there was a learning curve because the developers were 
writing less code and implementing screens much quicker compared to our 
old framework.  On the mid to small sized project those benefits will 
not be realized as much right away.


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



Re: Make Struts set form data onto the action in same order as the form's fields

2007-01-25 Thread Tom Schneider

I think your best bet would be to break up the parameter setting into 2
parts.  (A variation on the paramsPrepareParamsStack) The first part would
set all parameters needed to load the data from the data.  Then in the
prepare, you would have the id's needed to load the data from the database.
The next part would set all the rest of the parameters.  This would be the
approach I would take if I needed to load something from the database before
the parameters are set.
Tom

On 1/25/07, Dale Newfield <[EMAIL PROTECTED]> wrote:


Célio Cidral Junior wrote:
> Well, having Struts passing parameters in the order defined by the
> html form would solve my problem.  :-)

While setting parameters in a request struts has no idea what order they
were ordered in the originally generated form--remember that a single
action may be called from multiple forms on multiple pages that all
order the fields differently.  All struts has to work with is the order
in which the fields are present in the request, which is going to be
different for requests coming from different browsers, going through
different proxies, etc.

If you want to guarantee the order in which parameters are pulled from
the request, don't use the parameters interceptor and do all that
processing yourself in your action.  If you want to use the parameters
interceptor, but you want to ensure that a model object is loaded before
  parameters are set, either explicitly pull the key parameter out of
the request during the prepare call (using prepare in the stack before
parameters), or simply use the parameters interceptor both before and
after the prepare interceptor.

Believe us, you're not the first person to have this problem.  Believe
us, this is the simplest solution from among those that are not broken.

-Dale


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




Re: Make Struts set form data onto the action in same order as the form's fields

2007-01-25 Thread Tom Schneider

Unfortunately I don't think that's possible.  The parameters get put into a
map structure, so the original parameter order is lost by the time it gets
to the servlet API.  We've run into several instances where something will
work on one app server, but break on another because we had duplicate
parameters on the url--so depending on how the app server handled it, we
would get one or the other value.  I can't imagine that any java web
framework could do this successfully.
Tom

On 1/25/07, Célio Cidral Junior <[EMAIL PROTECTED]> wrote:


2007/1/25, Tom Schneider <[EMAIL PROTECTED]>:
> This is an issue with the typical edit/save scenario.  The problem we
are
> discussing is that the domain model is needed in some form before the
> parameter can be repopulated from the form save.  The technique you are
> using is to reread the data from the database before the parameters are
> set.  An alternative technique would be to put the domain model into a
place
> in the session--so on the save, you can retrieve the the model from the
> session and then allow the parameters interceptor to populate the new
data.
> (This is referred to as detached objects in the Hibernate world)  The
> advantage of putting the model in the session is that if some else
modifies
> the data before you reread the data, but after you have displayed the
edit
> page, you will not have the original model.  This particularly a problem
> with a model where you are dealing with lists of domain objects.  In
this
> case, the edit will fail because you will be trying to set parameters on
> items that might not exist anymore.  (Or you've pulled in data that the
user
> doesn't know about)  Therefore the safer technique is to save off the
> model.  If you're concerned about putting too much into the session, you
can
> store the data in a cache, such as ehcache, that will store items to
disk if
> there are too many things in memory.  (This is the technique that we
> used--we called it a model repository and we created a couple different
> implementations)  I would love to see something like this out-of-the-box
> with struts2, but nothing currently exists.

Thanks, I really appreciate your suggestions. However, I prefer a
stateless approach because (I think) it helps to keep things simple in
this case. Using some kind of cache between page requests is more like
a stateful approach that I would like to avoid here for simplicity
reasons.

Well, having Struts passing parameters in the order defined by the
html form would solve my problem.  :-)

Regards,

Célio.

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




Re: Make Struts set form data onto the action in same order as the form's fields

2007-01-25 Thread Tom Schneider

This is an issue with the typical edit/save scenario.  The problem we are
discussing is that the domain model is needed in some form before the
parameter can be repopulated from the form save.  The technique you are
using is to reread the data from the database before the parameters are
set.  An alternative technique would be to put the domain model into a place
in the session--so on the save, you can retrieve the the model from the
session and then allow the parameters interceptor to populate the new data.
(This is referred to as detached objects in the Hibernate world)  The
advantage of putting the model in the session is that if some else modifies
the data before you reread the data, but after you have displayed the edit
page, you will not have the original model.  This particularly a problem
with a model where you are dealing with lists of domain objects.  In this
case, the edit will fail because you will be trying to set parameters on
items that might not exist anymore.  (Or you've pulled in data that the user
doesn't know about)  Therefore the safer technique is to save off the
model.  If you're concerned about putting too much into the session, you can
store the data in a cache, such as ehcache, that will store items to disk if
there are too many things in memory.  (This is the technique that we
used--we called it a model repository and we created a couple different
implementations)  I would love to see something like this out-of-the-box
with struts2, but nothing currently exists.
Tom


On 1/25/07, Célio Cidral Junior <[EMAIL PROTECTED]> wrote:


2007/1/25, Dave Newton <[EMAIL PROTECTED]>:
> From my point of view it seems like your implementation is broken: if
you need to create a Customer from an ID passed via a form or URL then you
either need to implement Preparable or do the DAO operations in the (in your
case) input or save methods.

The DAO operations already do that. The problem happens when the user
is *altering* an existing customer (creating a new customer works
fine), more specifically when the user is submitting changes from the
form to an existing customer object (alongside with an existing id);
in that case, the id must be set before getCustomer() is called,
otherwise a new customer will be created with zero id. Loading the
form with an existing customer works fine. Submitting changes to it is
where the problem resides. The idea behind getCustomer() is to
abstract the retrieving of the customer object wherever it's called
along the action's code so that I don't have to care about whether
it's an existing customer or not.

Implementing Preparable does not seem to solve the problem because the
parameters are set before the prepare() method is invoked.

Célio.

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




Re: Type Conversion Messages i18n

2007-01-24 Thread Tom Schneider

I'm assuming this is for Struts 2.  If not, please ignore me. :)

This is one thing I wish they would improve in Struts 2--it's certainly 
not as obvious or trivial as I would expect it, but this little tidbit 
was buried deep in the book: 'Webwork in Action'.  Here is an example of 
one of our messages:


invalid.number.error=Field ${getText(fieldName + '.label')} is invalid, 
please enter a number.


This syntax will not work with the ConversionErrorInterceptor, you must 
manually add a conversion validator to every field where you want a 
conversion error displayed.  This is because the OGNL lookup  on the 
bundle string occurs in the validator framework.  But the idea is that 
the bundle text will go through an OGNL lookup, getText will be called 
on the action and we'll be looking up fieldName + '.label'.  So if the 
fieldName is age, we would lookup age.label in the resource bundle.


This could be made more user friendly if we had a field key in addition 
to the error message key in the xwork validation framework.  This would 
allow the field name lookup to happen automatically and it would be 
available just as fieldName.  (Right now fieldName is only the literal 
text from the XML)

Tom


André Faria wrote:

/How can I make the i18n of the message :
/"Invalid field value for field {0}" ?

Regards,
André Faria

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





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



Re: Why struts2 and not spring mvc

2007-01-23 Thread Tom Schneider

Hello,
I wrote the Spring MVC plugin (and the Spring Webflow plugin) for Struts 
2, so I'm familiar with both frameworks.  Here are some of the 
advantages that I see:


* Better interceptors - the interceptors in Spring MVC are very crude 
and hard to configure--the interceptor architecture for struts 2 is far 
superior and there are many more interceptors out-of-the-box
* Better datamodel support - In Spring MVC, you have to return a hashmap 
as the datamodel, in Struts2, the action is the datamodel which seems 
more intuitive to me (although it does have ModelDriven concept that 
emulates what Spring MVC does)
* OGNL - ognl is a much richer expression language than the Spring MVC 
expression language--it allows you to do things that just aren't 
possible with other expression languages which in some cases simplify 
the application implementation
* Better type conversion support - the type conversion support is much 
better--better architecture and easier to hook into.
* Better tags - the UI tags that come with Struts2 will do everything 
you need.  Spring MVC has tags for form stuff, but most people use JSTL 
for simple non-editable pages.
* Better Java 5 support - the struts 2 codebase is Java 5 only, so they 
make heavy used of generics and annotations, Spring is still Java 1.4 so 
they can't take advantage of these language features yet.


If you'd like more examples, I'd be happy to go into more details, but 
that should give you a start. :)  On my very long TODO list is a Spring 
MVC to Struts 2 migration guide--don't know if I'll ever get around to 
it, but if there's enough interest I can start that sooner than I 
originally planned.


As far as documentation, webwork had ok documentation, there were places 
where it was spotty.  The book 'Webwork in Action' was almost required 
reading.  (I highly recommend it)  I would expect the documentation to 
get better as more and more projects start migrating over.

Tom

Zsolt Koppany wrote:

Hi,

What are the advantages of struts2 against spring mvc? For me they look very
similar but "spring mvc" is pretty well documented.


Zsolt 




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


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



Re: How do I configure wildcard action definitions in Struts 2.x?

2007-01-23 Thread Tom Schneider

Are you looking for something more than this:
http://struts.apache.org/2.x/docs/action-configuration.html#ActionConfiguration-WildcardAliases
It seems to give a pretty decent overview with a few examples.  Are we 
looking for something more extensive than this?

Tom

Don Brown wrote:

Yes, and it works pretty much the same way as Struts 1.  Add a JIRA
ticket so we don't forget to add the proper docs.

Thanks,

Don

On 1/23/07, mraible <[EMAIL PROTECTED]> wrote:


I can't seem to find any documentation on configuring wildcard 
actions in

Struts 2.x.  Does this feature still exist?

Thanks,

Matt
--
View this message in context: 
http://www.nabble.com/How-do-I-configure-wildcard-action-definitions-in-Struts-2.x--tf3077950.html#a8551509 


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


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





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



Re: [s2] String comparison with OGNL

2007-01-23 Thread Tom Schneider

On our webwork project, we're successfully using this (copied directly from
the JSP):



where caseType is an bean property (from a list of beans being iterated
over) that will be "SG" if the 'if' tag contents should be rendered.
However, I think this might be a case of an interned string, so it would be
better to use .equals which should work equally well.  (We are using .equals
in other places, but only to check if the string is blank)
Tom

On 1/23/07, Wesley Wannemacher <[EMAIL PROTECTED]> wrote:


When I read your message, it occurred to me that OGNL couldn't know what
type `addrType' was because my Action is only a stub. #parameters is a
magical variable containing all of the request parameters, so I hadn't
thought of making getters/setters on my Action before.

So, I added a getAddrType() and setAddrType(String) then tried again.

I went through the whole gambit of syntaxes and I still can't find one
that
works.

If I'm using the correct syntax, let me know because it could just be a
bad
set of struts jars (which I can replace).

-Wes

> -Original Message-
> From: Tom Schneider [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 23, 2007 1:50 PM
> To: Struts Users Mailing List
> Subject: Re: [s2] String comparison with OGNL
>
> #parameters.addrType is of type String correct?  If not, e.g.
> if it were an
> enum, then I would expect all the comparisons to fail.  You might try
> #parameters.addrType.toString().equals('billing') and see if
> that gets it to
> work.
> Tom
>





Re: [s2] String comparison with OGNL

2007-01-23 Thread Tom Schneider

#parameters.addrType is of type String correct?  If not, e.g. if it were an
enum, then I would expect all the comparisons to fail.  You might try
#parameters.addrType.toString().equals('billing') and see if that gets it to
work.
Tom

On 1/23/07, Wesley Wannemacher <[EMAIL PROTECTED]> wrote:


Nope, same result... Here is the code and output -

---CODE

Please verify the details of your 
address below -



---RESULT

Please verify the details of your billing address below -

false


I'm not sure how much it matters, but I am working with a snapshot of
2.0.2
that I built a while back. If this is an issue, I can replace any jars to
see if that fixes the problem.

-Wes

> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 23, 2007 1:36 PM
> To: Struts Users Mailing List
> Subject: RE: [s2] String comparison with OGNL
>
> From: Wesley Wannemacher [mailto:[EMAIL PROTECTED]
> > 
>
> Does wrapping it with %{} do it?
>
> 
>
> I still get a little confused when dealing with the different markups.
>
> Dave
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>





Re: [s2] Question about SessionAware docs.

2007-01-23 Thread Tom Schneider

Actually your explanation is not quite 100% correct.  The interceptor
injects a Map that is backed by the HttpSession.  So puts and gets to the
Map will actually be puts and gets to the HttpSession.  (Very clever IMO)

You have a valid point about the javadoc.  My guess is that at one point it
actually did set a HttpSession on the action, but later was changed to be a
Map and the javadoc was never updated.
Tom

On 1/23/07, Dave Newton <[EMAIL PROTECTED]> wrote:


The JavaDoc for SessionAware states:

"Note that using this interface makes the Action tied to a servlet
environment, so it should be avoided if possible since things like unit
testing will become more difficult."

I'm not entirely sure that's accurate, as it isn't *explicitly* tied to
the servlet environment... it's just that S2 uses an interceptor (I
assume) to copy over HttpSession attributes. But it's just a Map setter.

Could the wording be changed a little bit?

Dave


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




Re: Struts2 + Cookies

2007-01-23 Thread Tom Schneider
I seem to remember a CookieInterceptor: 
https://issues.apache.org/struts/browse/WW-669.  It doesn't look like it 
has made it into the core framework yet.


Emmanuel KOJE wrote:
Hi Guys, 


I tried without sucess to get some information about the management of cookie 
using struts2.
Could you help me to get some information ?

Thanks,




 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.

http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
  



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



Re: Moving from struts-1 to struts-2 or spring mvc

2007-01-10 Thread Tom Schneider

I don't think it's that trivial.  For every struts 1 action, you have to
configure an action entry in the struts.xml.  (At least as far as I can tell
based on the plugin documentation at
http://cwiki.apache.org/S2PLUGINS/struts-1-plugin.html)  Remember that
struts 1 and struts 2 are completely different code bases.  It would be nice
if you could run a struts 1 application unchanged in struts 2, (i.e. read in
the old xml config file and automatically configure everything needed for
struts 2 integration) but the struts 1 plugin doesn't do that...yet. :)
Tom

On 1/10/07, Dave Newton <[EMAIL PROTECTED]> wrote:


> From: Zsolt Koppany [mailto:[EMAIL PROTECTED]
> we have a pretty large code in struts-1. What is more complicated
> moving to struts2 or spring mvc?

Moving to Struts2 is trivial since there's a Struts1 plugin that will
let you run it unchanged! :)

Dave

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




Re: Action without interceptors

2007-01-09 Thread Tom Schneider

Don's solution is good if you don't want any of your actions to have
interceptors.  My solution was for the cases where most of the actions use
the default stack and only a handful of actions shouldn't have any
interceptors.  Which brings up a more interesting question: Can you have an
empty interceptor stack?  (Not sure if the dtd allows that)  That would be a
better solution than a NullInterceptor.  I've never run into a sitiuation
where I have absolutely no interceptors, so maybe its not that relevant.
Tom

On 1/9/07, Don Brown <[EMAIL PROTECTED]> wrote:


If you don't want any interceptors, don't have your package extend
"struts-default".  There isn't some magical built-in interceptor used
for user packages.

Don

On 1/9/07, Juan Espinosa <[EMAIL PROTECTED]> wrote:
>
>
> 1) Because the url has a parameter called validationCode and i dont have
a
> property in my class with that name.
> 2) Because i want interceptors run when "I WANT" not when struts want...
>
> May be i must write an interceptor that do nothing and put that
interceptor
> in the action
>
>
> -Mensaje original-
> De: Dave Newton [mailto:[EMAIL PROTECTED]
> Enviado el: martes, 09 de enero de 2007 13:45
> Para: Struts Users Mailing List
> Asunto: RE: Action without interceptors
>
> From: Juan Espinosa [mailto:[EMAIL PROTECTED]
> > The seconda action is an action that validate a code passed
> > http://www.mysite.com/test2?validationCode=3
> > I need no intercepto neither parameters interceptor nor model driven
> > interceptor...
>
> Just because you don't *need* one doesn't mean it matters if they're
there.
>
> Why do you explicitly *not* want the interceptors?
>
> Dave
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.7/620 - Release Date:
08/01/2007
> 16:12
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.7/620 - Release Date:
08/01/2007
> 16:12
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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




Re: Action without interceptors

2007-01-09 Thread Tom Schneider

One option is the create a NullInterceptor that doesn't do anything.  It
would be trivial to create and would allow you to override a default
interceptor stack with an interceptor that does nothing.
Tom

On 1/9/07, Dave Newton <[EMAIL PROTECTED]> wrote:


From: Juan Espinosa [mailto:[EMAIL PROTECTED]
> The seconda action is an action that validate a code passed
> http://www.mysite.com/test2?validationCode=3
> I need no intercepto neither parameters interceptor nor model driven
> interceptor...

Just because you don't *need* one doesn't mean it matters if they're
there.

Why do you explicitly *not* want the interceptors?

Dave


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




Re: Redirect with Struts 2

2007-01-08 Thread Tom Schneider

You want me to give away all my secrets, don't you?!? :)

If the list of parameters is static, then you can just retrieve them from
properties of the action:
${nextURL}?emailId=${emailId}&name=${name}

If it is a dynamic list, there is a
org.apache.struts2.views.util.URLHelperclass that has utility methods
for taking a base url, a map of parameters
and creating a url string from that. (the method buildParametersString is
what you want to look at)
Tom
p.s. this should probably be added to a faq somewhere


On 1/8/07, Information Guzzler <[EMAIL PROTECTED]> wrote:


How about passing parameters along with the redirect?

On 1/8/07, Tom Schneider <[EMAIL PROTECTED]> wrote:
>
> Interesting question.  I had the same question when I started looking at
> webwork.  Here's what I do when I need to redirect to a different
> domain.  If it's a static url, you can just hard code the full url in
> your struts.xml with a result type of redirect.  If it's dynamic,
> there's a little more work involved.  First you have a property on your
> action that is the url you want to go to.  Second, in your sturts.xml
> you have a result type of redirect, but the value is pulled from the
> OGNL stack.  For example:
>
> ${nextURL}
>
> nextURL is the property in your action that is populated dynamically.
> It's not trivial to figure out, but it works pretty slick.
> Tom
>



Re: Redirect with Struts 2

2007-01-08 Thread Tom Schneider
Interesting question.  I had the same question when I started looking at 
webwork.  Here's what I do when I need to redirect to a different 
domain.  If it's a static url, you can just hard code the full url in 
your struts.xml with a result type of redirect.  If it's dynamic, 
there's a little more work involved.  First you have a property on your 
action that is the url you want to go to.  Second, in your sturts.xml 
you have a result type of redirect, but the value is pulled from the 
OGNL stack.  For example:


${nextURL}

nextURL is the property in your action that is populated dynamically.  
It's not trivial to figure out, but it works pretty slick.

Tom


Kamal C. Mettananda wrote:

Hi,

I have seen that there has been an ActionForward class under Struts 1.x which 
could be used for a redirect to a completely different domain URL. But how can 
we achieve the same with Struts 2.

Thanks.

Kamal



Send instant messages to your online friends http://uk.messenger.yahoo.com 


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


  



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



Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Tom Schneider

For struts2 tags, checkout
https://issues.apache.org/struts/browse/WW-1569

The problem I have with displaytag is that in an effort to satisfy 
everyone's needs, it is infinitely configurable.  IMHO, that makes it 
hard to figure out and hard to use.  The other issue we had with display 
tags is that with struts2, it isn't backed by a freemarker template.  
Every other built-in tag in struts2 is backed by a freemarker template, 
which is a much better solution to customization issue.  In the simple 
case, it will be simple, but it will also let you do the more 
complicated scenerio.


Also checkout http://forum.springframework.org/showthread.php?t=33012 if 
your using spring.

Tom

Gareth Evans wrote:

Hi Andrew,

I suggest using displaytag with its external paging and sorting features

http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html

Gareth

Andrew Martin wrote:
I am interested to know the ‘best’ practice for navigating through 
long lists. At the moment we have implemented Struts-layout for this 
purpose. Our implementation currently retrieves the full dataset and 
uses Struts-layout sorting and navigation pager options to navigate 
through the results. However the drawback of this approach is in 
performance as our application will contain long lists.


I have read many articles and browsed many forums but haven’t yet 
been able to find a ‘best practice’ or ideal approach.


Andrew






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



Re: Problem with encoding

2007-01-02 Thread Tom Schneider

Does it have anything to do with HTML escaping?

There is no way to turn off html escaping in the s:text tag.  (I probably
should file a bug)  I didn't see anything for textfield--I'm not sure what
the escaping behavior is.

What shows up on the screen in the non-working case, escaped HTML or
nothing?
Tom

On 1/2/07, Mike Baroukh <[EMAIL PROTECTED]> wrote:



Hi.

I have a problem with accents.
My project is entirely in utf-8 : jsps, java sources, resources
properties 

Depending on the way I put accents in my jsp, it works or not :

work :
- directly in the jsp source
- with s:property  -> converted with à by freemarker.
- in input box of  s:textfield  -> converted with à by freemarker.

don't work with :
- in label attribute of any ui tag, if I use %{getText('xx')}.
- with s:text.

I use a filter that force encoding to utf-8.
I also add  page pageEncoding="UTF-8" to the jsp.

With or without SiteMesh, no difference.


Has anybody any idea on what's wrong ?
Thanks for any help.

--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---




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