RE: implementaiton advise on custom TextProvider

2012-10-16 Thread stanlick
Spring MVC might be a consideration! (wink)
On Oct 16, 2012 1:26 PM, Davis, Chad chad.da...@emc.com wrote:

 
  Okay.  I'm following this path.  I've got the Spring Plugin in place.
  And it's
  working.  I verified it by autowiring a trivial spring bean into one of
 my
  actions.  But when I try to create my custom textprovider and then have
 it
  used as the framework default text provider I'm getting some
 initialization
  problems.  Here's what I'm doing:
 
  1) spring config
 
bean id=customTextProvider
  class=com.mycompany.textsupport.MyTextProviderSupport/
 
  2) struts.xml
 
bean type=com.opensymphony.xwork2.TextProvider
  name=myTextProvider class=customTextProvider scope=default /
   constant name=struts.xworkTextProvider
 value=myTextProvider/
 
  But when I start the app I get the following error, thrown when the
  framework tries to create the text provider bean.  It seems like the
  framework isn't recognizing that I'm referencing a spring bean with the
 class
  attribute . . .
 

 So, I have figured this out.  The TextProvider is injected outside the
 control of the core objectfactory.  If you look at the ActionSupport class,
 you'll see that there is a lazy init method for acquiring the textprovider.
  It uses the default ContainerImpl, as injected ( by type I think ) into
 the action, to inject the textprovider.  This means that it goes around the
 spring object factory for this injection.

 Not sure what to do.  Several workarounds come to mind.

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: AJAX Advice

2012-04-17 Thread stanlick
Take a peek at this http://struts2-jquery.appspot.com/home.action

On Tue, Apr 17, 2012 at 2:13 AM, shobbi sho...@dataspectrumllc.com wrote:

 Hi all, your advice is greatly appreciated. I need to use AJAX in my
 Struts2
 2.1.8 web application. What is the best option?

 I see DOJO mentioned in many places including Stuts2 official site. Also I
 see warning on the same site about the deprecation of the DOJO plugin. So
 I'm bit confused and want to start right.

 Many Thanks, Sal.


 --
 View this message in context:
 http://struts.1045723.n5.nabble.com/AJAX-Advice-tp5645831p5645831.html
 Sent from the Struts - User mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




-- 
As I grow older, I pay less attention to what men say. I just watch what
they do. Andrew Carnegie


Re: addActionMessage does not show message after redirect (struts2.2.3)

2011-07-12 Thread stanlick
Dave is right Emi.  I have been working with other frameworks recently, and
what Struts/2 needs is a simple FlashScope that allows a request to last two
life-cycles.  However, unless you were doing something OOTO, a request in
Struts/2 lasts for one reqest/response trip.

Peace,
Scott

On Tue, Jul 12, 2011 at 11:14 AM, Dave Newton davelnew...@gmail.com wrote:

 On Tue, Jul 12, 2011 at 12:05 PM, Emi Lu wrote:
  Because it's a redirect, and things in the request go away when
  there's a new request.
  Not true for previous version.

 Previous version had a bug, then, because by default, anything
 relating to an action's instantiation should go away during a
 redirect--that's kind of the point of instantiating an
 action-per-request.

 Again, the only way this *should* be possible is by (incorrectly, IMO)
 using singleton actions (Bad Idea) or a scope intereptor (or
 equivalent). Are you using Spring?

 Please zip up a (maven-ized) minimal example showing the behavior;
 I'll change the S2 version to the two you mention and debug
 this--messages should *not* persist between requests.

 Dave

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: [S 1.3.8] Adding tag lib

2011-05-20 Thread stanlick
each page needs the taglibs. remember each jsp must be complied first, and
without the taglib directives, the compile would fail.

peace,
scott
On May 20, 2011 2:04 PM, Anjib Mulepati anji...@hotmail.com wrote:
 Hi,

 I have a query regarding adding tag lib in web pages while using tiles.
 Is it enough to put tag lib directive in layout page only? Will all
 other pages loaded in layout get that?

 Example

 1. In tiles layout page I have

 %@taglib uri=/WEB-INF/struts-html.tld prefix=html %
 %@taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

 %@page contentType=text/html pageEncoding=UTF-8%
 !doctype html

 html
 head
 titletiles:getAsString name=title ignore=true //title
 /head
 body
 tiles:insert attribute=content /
 /body
 /html

 2. Now some other page (/jsp/login.jsp) can I just use tags without
 adding %@taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %.

 html:link action=/login.doLog-In/html:link

 3. My tiles definition file looks like

 tiles-definitions

 definition name=basicLayout path=/jsp/basicLayout.jsp
 put name=title value=:: Main Page :: /
 put name=content value= /
 /definition

 definition name=loginPage extends=basicLayout
 put name=title value=:: Login Page :: /
 put name=content value=/jsp/login.jsp /
 /definition

 /tiles-definitions

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



Re: Recommended number of forms in one action

2011-04-19 Thread stanlick
Great answer Eric!  I would also add that using wildcard methods for the
express purpose of minimizing the number of actions you have is bad
medicine.  I'm not suggesting you are, but I have seen this on client
projects where they were  more interested in check-in/check-out of a single
action than they were in doing the right thing.

Peace,
Scott

On Tue, Apr 19, 2011 at 9:17 AM, Eric Lentz eric.le...@sherwin.com wrote:

  I am asking because it seems that validation is only allowed for one
  set of properties. This indicates I should create two actions

 Validation can go down to the method level and you can validate what you
 desire for that method call. Just name the .xml file (if using that
 approach) with the method name as well the class name.

 I would personally allow my decision on number of classes to be driven
 based on class purpose. I try to limit classes to a finite set of
 responsibilities, usually very fine-grained, in favor or more classes.
 This provides easier reuse, unit testing, etc. When classes get to be big
 and multi-purpose, then they get confusing and ripe for refactoring.

 If you feel you have a single purpose that a single class should address,
 then use the one class. If you are serving multiple purposes that aren't
 related (doesn't sound like your case), then don't worry about having just
 a couple lines in a class. It is okay to have lots of classes.


Re: Select collection not found only when validation xml file is used

2011-04-13 Thread stanlick
Though his eyes could see he still was a blind man lol

On Wed, Apr 13, 2011 at 10:27 AM, Eric Lentz eric.le...@sherwin.com wrote:

 I'm now buying what you're selling. I did have a misunderstanding about
 when the JSP is called relative to validation. I once was blind, but now I
 see. Thanks for clearing that up. I now see how to make the application
 work correctly.

 BTW, I do know about redirectAction, and use it normally. I would argue
 that most applications use this though (maybe they do, but not in my
 experience consulting with many companies). I see a lot of them that do
 not. I think that pattern isn't well understood by many web developers. I
 try to tell everyone that will listen.

 Thanks for the help. My problem appears to be solved! prepare() is my
 friend.


Re: Select collection not found only when validation xml file is used

2011-04-12 Thread stanlick
Do you by chance need a @SkipValidation on a method(s) in your action? How
have you named your validation file?
On Apr 12, 2011 2:27 PM, Eric Lentz eric.le...@sherwin.com wrote:
 since I don't use that XML Validation stuff.

 What do you use?


Re: Wildcard pattern not calling interceptor?

2011-04-08 Thread stanlick
You should never allow JSP pages to be accessed directly.  Place them behind
WEB-INF and your problem goes away.

On Thu, Apr 7, 2011 at 8:46 PM, Dave Shevett d...@homeport.org wrote:

 I have an app that uses a generic interceptor on all action calls to verify
 if the session is active, and if it isn't, it returns 'notloggedin', which I
 have a global result for.

 This works -great-, except for one of my actions, which is a generic loader
 for JSP's.

 The interceptor definition:

 interceptor-stack name=pppweb
interceptor-ref name=siteConfigCheck /
interceptor-ref name=paramsPrepareParamsStack /
interceptor-ref name=publicLoginChecker /
 /interceptor-stack

 'publicloginchecker' has a simple checking session debug rule.  For all
 normal calls that have an action mapped, it always says it's checking the
 session.  But many of my actions I have a SUCCESS entry that does somethign
 like this:

 result name=success type=redirectActionpublic/MyHome/result

 And I have a generic JSP catcher:

 action name=public/* class=com.stonekeep.congo.web.WebActions
interceptor-ref name=pppweb/
result name=success/WEB-INF/jsp/public/{1}.jsp/result
result name=input/WEB-INF/jsp/public/{1}.jsp/result
 /action

 Last but not least, I have a global results entry:
 result name=notloggedin type=redirectActionpublic/Welcome/result

 All of this works just spiffily.  The JSP's render, all is well, EXCEPT in
 the case where I hit a JSP directly via public/SomeJspName.  In this
 situation, the JSP renders, but hte interceptor does not trigger.  This
 results in odd behaviour for folks who have had a session timeout, or are
 hitting random URLs for JSP pages.  They see the page, it has no session
 content.

 Help?

-dave


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: [maybe OT] Detecting if a new window or tab was opened (server-side)

2011-03-16 Thread stanlick
Your questions are too difficult!  Can you please rephrase?

Peace,
Scott

On Wed, Mar 16, 2011 at 4:25 PM, Wes Wannemacher w...@wantii.com wrote:

 Does anyone know of a good trick to detect whether a new window or tab
 was opened by the user...

 Here is the scenario, a user is looking at a view and he/she
 right-clicks one of the links and chooses to open the link in a new
 tab or window. The original view and the new tab or window will share
 the session, but I'd like to know that there are two windows (or tabs)
 interacting with the site.

 I thought about trying to track the referrers as requests come in, but
 I get stumped when I realize that a user can re-visit a page.

 There are some javascript mechanisms, but by the time I can detect
 from javascript that a window is new, the response is already being
 rendered (committed).

 Here is one link I found, but the code is poorly formatted making the
 example difficult to follow -

 https://sites.google.com/site/sarittechworld/track-client-windows

 -Wes

 --
 Wes Wannemacher

 Head Engineer, WanTii, Inc.
 Need Training? Struts, Spring, Maven, Tomcat...
 Ask me for a quote!

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Handling wildcard action names with dot.

2011-03-01 Thread stanlick
I haven't looked at this for some time, but open up DefaultActionMapper and
have a look.  You can always substitute your own implementation if the
outta-the-box is not what you are looking for.

Peace,
Scott

On Tue, Mar 1, 2011 at 7:59 AM, GF gan...@gmail.com wrote:

 I configured struts to handle url mapping with no extensions this way

 constant name=struts.action.extension value=,, /

 With this action mapping
action name=* class=myAction method=myMethod
param name=myId{1}/param
result type=tilesmyTile/result
/action

 I can handle urls like:

 /aaa/bbb/ccc
 /aaa/bbb/ddd
 /aaa/bbb/eee

 But i wish to handle this kind of urls too:

 /aaa/bbb/fff.xyz
 /aaa/bbb/fff.jkw
 /aaa/bbb/fff.anykindofextension

 But when i insert a DOT in the action name (mapped by a wildcard) I
 get a 404 error.


 Any idea?

 Thank you

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Problem with s:hidden

2011-02-26 Thread stanlick
The eclipse jsp validator is a worthless bag of bolts.
On Feb 25, 2011 4:17 PM, Frank Serkland fhserkl...@gmail.com wrote:

 I have the following form in my JSP.  The hidden field in this form,
 which I have verified with the documentation as having correct syntax
 as far as Struts 2 goes, is being marked by Eclipse with this error
 message: Invalid attribute (value).  Can anybody help me with this?
 Thanks.

 c:forEach var=bulletins items=${bulletins}
c:if test=${bulletins.approved == false}
s:form action=ApproveBulletin method=post
table
tr
td colspan=2bFrom:/b c:out
value=${bulletins.name} //td
/tr
tr
td colspan=2bSubject:/b
c:out value=${bulletins.subject} //td
/tr
tr
td colspan=2bDate:/b c:out
value=${bulletins.date} / br
/td
/tr
tr
td colspan=2c:out
value=${bulletins.note} /
 !-- Error here -- s:hidden name=id value=${
bulletins.id} //td
/tr
tr
tds:submit type=button
value=approve label=Approve
action=ApproveBuletin
//td
tds:submit type=button
value=deny label=Deny
action=DenyBulletin
//td
/tr
/table
br /
/s:form
/c:if
 /c:forEach

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



Re: Changing The Result Page

2011-02-01 Thread stanlick
Have you considered Sitemesh?

On Tue, Feb 1, 2011 at 11:50 AM, Richard Sayre richardsa...@gmail.comwrote:

 I am making a mobile site for my current web application.  I have a
 huge number of actions that return to JSP pages.  I have a mobile
 detection class written.

 Is there a way that I can change the result page if the user is on a
 mobile device?

 I want to avoid having to write this in all my actions:

 if(mobile) {

  return SUCCESS_MOBILE

 } else {

  return SUCCESS

 }


 If I could change the result page it would make it easier.  For
 example if it is mobile then I replace the result page of
 /mydir/myPage.jsp to /mydir/myPage-m.jsp.

 Any suggestions?

 Thank you,

 Rich

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Convention plugin vs. wildcard mapping

2011-01-28 Thread stanlick
When it comes to an existing wildcard action mappings in XML (customer_*)
where you have several methods in the Customer action, would this require an
annotation on each of the methods in the action if this were to be converted
to convention?  If so, I get the impression this is a case where the
wildcard mapping in XML may still be a better solution.


Notable sites using Struts2

2011-01-27 Thread stanlick
Does anyone know of a reasonably good list of the top 10 or more sites
running on Struts2?  I have been asked to do a little fact-finding and the
tools I am using pretty much stop at Java EE and don't tell much about the
details.  Job searches compiled yesterday suggest Walt Disney, Netflix and
Bank of America to name a few.  Does anyone know of a better mousetrap than
http://trends.builtwith.com?

Peace,
Scott


Re: reloading config i18n

2011-01-25 Thread stanlick
With 2.2.1, shove all this in your struts.xml and if it works, just smile
and don't look back:

constant name=struts.devMode value=true /
constant name=struts.i18n.reload value=true /
constant name=struts.custom.i18n.resources value=global-messages /
constant name=struts.configuration.xml.reload value=true /

Peace,
Scott

On Tue, Jan 25, 2011 at 12:26 PM, CRANFORD, CHRIS chris.cranf...@setech.com
 wrote:

 I have set devMode=true and both reload config and i18n properties to
 true for my development environment.  It doesn't matter whether Tomcat
 is ran inside of MyEclipse or whether I run it stand alone, while I see
 the devMode error reports; I don't see the reload functionality working
 at all.

 I have verified that when changes are made to the files, they are pushed
 to the webapp's directory, timestamps appear to be updated; however the
 webapp isn't reloading these.  Am I missing something?

 I am on Windows 7.



 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: reloading config i18n

2011-01-25 Thread stanlick
I'm on 2.2.1 and they are being reloaded when using those config settings.
 However, I believe it took them all (or some weird combination) before they
would load!

On Tue, Jan 25, 2011 at 2:20 PM, CRANFORD, CHRIS
chris.cranf...@setech.comwrote:

 Do I have to be on 2.2.1 for all this to work?

 I am presently on 2.1.8.1 and have precisely those settings; other than
 my resource filename being different; yet when I make changes to my
 resource files text and refresh the browser page; no changes are
 reflected.

  -Original Message-
  From: stanl...@gmail.com [mailto:stanl...@gmail.com]
  Sent: Tuesday, January 25, 2011 1:44 PM
  To: Struts Users Mailing List
  Subject: Re: reloading config  i18n
 
  With 2.2.1, shove all this in your struts.xml and if it works, just
  smile
  and don't look back:
 
  constant name=struts.devMode value=true /
  constant name=struts.i18n.reload value=true /
  constant name=struts.custom.i18n.resources value=global-messages
  /
  constant name=struts.configuration.xml.reload value=true /
 
  Peace,
  Scott
 
  On Tue, Jan 25, 2011 at 12:26 PM, CRANFORD, CHRIS
  chris.cranf...@setech.com
   wrote:
 
   I have set devMode=true and both reload config and i18n properties
 to
   true for my development environment.  It doesn't matter whether
  Tomcat
   is ran inside of MyEclipse or whether I run it stand alone, while I
  see
   the devMode error reports; I don't see the reload functionality
  working
   at all.
  
   I have verified that when changes are made to the files, they are
  pushed
   to the webapp's directory, timestamps appear to be updated; however
  the
   webapp isn't reloading these.  Am I missing something?
  
   I am on Windows 7.
  
  
  
  
 -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Struts mapping failing when using struts2-convention-plugin

2011-01-24 Thread stanlick
Thanks my good brother.  I'll attribute my weirdness to trying to code and
watch football at the same time!

Peace,
Scott

2011/1/24 Paweł Wielgus poulw...@gmail.com

 Hi Scott,
 i use them side by side,
 normal action by conention and freaks in xml.

 Best greetings,
 Paweł Wielgus.


 2011/1/23 stanlick stanl...@gmail.com:
 
  Do you guys know if using the convention plugin is mutually exclusive of
  having an action mapping xml file?  IOW, is the convention plugin an all
 or
  nothing proposition?  I know it alters the request handling machinery but
  cannot find anywhere in the docs if it is expected to play alongside
  conventional hand coded mappings.
 
  Peace,
  Scott
 
 
 
  Musachy Barroso wrote:
 
  Yes, try convention first and then get on REST. You need to include
  the config browser plugin, for that url to be available. I don't know
  much of REST myself, but with your config settings, Convention should
  be mapping
 
  http://localhost:8080/lotmap/subdivision
 
  to the mentioned class. Look at the logs in debug mode, Convention
  will say to what namespace and action name is mapped to every class.
 
  musachy
 
  On Fri, Mar 6, 2009 at 4:32 PM, wkbutler kent.but...@gmail.com wrote:
 
  Thanks Musachy, that page
  (http://struts.apache.org/2.1.6/docs/convention-plugin.html) was very
  useful
  and now I think I understand the locators property much better.
 
  So here's my class:  com.tousa.ws.rest.SubdivisionController
 
  and I think I told Convention to use suffix Controller via the
  property:
 
 constant name=struts.convention.action.suffix
 value=Controller/
 
  so according my locators:
 
 constant name=struts.convention.package.locators value=rest/
 
  you are correct, the namespace should be[].  Unfortunately, that is
 what
  those URLs already represented. It's a bit confusing because the app is
  also
  named rest.  Doh.  I renamed the app to 'lotmap' to prove this to
  myself,
  and, well, I get the same errors, regardless of my URL permutations:
 
 http://localhost:8080/subdivision.xml
 http://localhost:8080/lotmap/subdivision.xml   -- this should be
 the
  correct URL, IMHO
 http://localhost:8080/lotmap/rest/subdivision.xml
 
  I did not mention this, but I am deploying into Jetty, and by default
 the
  app deploys under a context named for the app.  Hence the 'lotmap'
  required
  in the URL.
 
  I am afraid I am doing something even more silly than that.  The
  Convention
  documentation mentions using the config-browser-plugin to see all
  supported
  actions, at URL
 
 http://localhost:8080/YOUR_CONTEXT_HERE/config-browser/index.action
 
  but unfortunately I got an error when running that
  (java.lang.NoSuchMethodException:
  com.opensymphony.xwork2.ActionSupport.index()).
 
  I think I will back out the struts2-rest-plugin and just try to get
  Convention working. Currently it is failing when I try to load
WEB-INF/content/subdivision-success.jsp
  via URL
 http://localhost:8080/lotmap/subdivision.jsp
 
  however my Controller is set up for the rest-plugin, so both the show()
  and
  index() methods return HttpHeaders, not a simple String response. I
 don't
  recall the semantics there but that may be interfering with the normal
  Convention result mapping.
 
  Thanks again -
  Kent
 
 
 
  Musachy Barroso wrote:
 
  Ah the little things that drive us crazy :). Your class is
  com.tousa.ws.rest.SubdivisionController and the locator is rest
  which means the the action won't have a namespace, so the url will be
  /subdivision instead of /rest/subdivision, because the namespace is
  what follows the locator, for example:
 
  com.example.rest.orders.ViewController
 
  will map to:
 
  /orders/view
 
  see the troubleshooting section in the convention plugin.
 
  musachy
 
  On Fri, Mar 6, 2009 at 3:20 PM, wkbutler kent.but...@gmail.com
 wrote:
 
  Hi -
  I am attempting to use the struts-rest-plugin, v2.1.6.  I am using
  struts2-rest-showcase-2.1.6 as a guide. The showcase app works fine
 for
  me,
  and I have modeled my struts.xml, web.xml, and pom.xml after its
  example.
 
  Still, my app always returns a 404 error for any RESTful URL request.
   Here
  are my 2 example URLs that I would expect to work at this point:
 
  http://localhost:8080/rest/subdivision.xml
  http://localhost:8080/rest/subdivision/F11.xml
 
  I have cranked up debug, and even though the Restful Mapper 
  Interceptor
  appear to be properly registered at startup:
 
  [code]
  DEBUG [main] XmlConfigurationProvider.debug(57) | Loaded [BUILDER]
  {PackageConfig Name:convention-default namespace:
  parents:[{PackageConfig
  Name:struts-default namespace: parents:[]}]}
 
  DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Setting
 action
  default parent package to [rest-default]
 
  DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Loading
 action
  configurations
 
  DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Actions
 being
  loaded using

Re: Struts mapping failing when using struts2-convention-plugin

2011-01-23 Thread stanlick

Do you guys know if using the convention plugin is mutually exclusive of
having an action mapping xml file?  IOW, is the convention plugin an all or
nothing proposition?  I know it alters the request handling machinery but
cannot find anywhere in the docs if it is expected to play alongside
conventional hand coded mappings.

Peace,
Scott



Musachy Barroso wrote:
 
 Yes, try convention first and then get on REST. You need to include
 the config browser plugin, for that url to be available. I don't know
 much of REST myself, but with your config settings, Convention should
 be mapping
 
 http://localhost:8080/lotmap/subdivision
 
 to the mentioned class. Look at the logs in debug mode, Convention
 will say to what namespace and action name is mapped to every class.
 
 musachy
 
 On Fri, Mar 6, 2009 at 4:32 PM, wkbutler kent.but...@gmail.com wrote:

 Thanks Musachy, that page
 (http://struts.apache.org/2.1.6/docs/convention-plugin.html) was very
 useful
 and now I think I understand the locators property much better.

 So here's my class:  com.tousa.ws.rest.SubdivisionController

 and I think I told Convention to use suffix Controller via the
 property:

    constant name=struts.convention.action.suffix value=Controller/

 so according my locators:

    constant name=struts.convention.package.locators value=rest/

 you are correct, the namespace should be[].  Unfortunately, that is what
 those URLs already represented. It's a bit confusing because the app is
 also
 named rest.  Doh.  I renamed the app to 'lotmap' to prove this to
 myself,
 and, well, I get the same errors, regardless of my URL permutations:

    http://localhost:8080/subdivision.xml
    http://localhost:8080/lotmap/subdivision.xml   -- this should be the
 correct URL, IMHO
    http://localhost:8080/lotmap/rest/subdivision.xml

 I did not mention this, but I am deploying into Jetty, and by default the
 app deploys under a context named for the app.  Hence the 'lotmap'
 required
 in the URL.

 I am afraid I am doing something even more silly than that.  The
 Convention
 documentation mentions using the config-browser-plugin to see all
 supported
 actions, at URL
     http://localhost:8080/YOUR_CONTEXT_HERE/config-browser/index.action

 but unfortunately I got an error when running that
 (java.lang.NoSuchMethodException:
 com.opensymphony.xwork2.ActionSupport.index()).

 I think I will back out the struts2-rest-plugin and just try to get
 Convention working. Currently it is failing when I try to load
   WEB-INF/content/subdivision-success.jsp
 via URL
    http://localhost:8080/lotmap/subdivision.jsp

 however my Controller is set up for the rest-plugin, so both the show()
 and
 index() methods return HttpHeaders, not a simple String response. I don't
 recall the semantics there but that may be interfering with the normal
 Convention result mapping.

 Thanks again -
 Kent



 Musachy Barroso wrote:

 Ah the little things that drive us crazy :). Your class is
 com.tousa.ws.rest.SubdivisionController and the locator is rest
 which means the the action won't have a namespace, so the url will be
 /subdivision instead of /rest/subdivision, because the namespace is
 what follows the locator, for example:

 com.example.rest.orders.ViewController

 will map to:

 /orders/view

 see the troubleshooting section in the convention plugin.

 musachy

 On Fri, Mar 6, 2009 at 3:20 PM, wkbutler kent.but...@gmail.com wrote:

 Hi -
 I am attempting to use the struts-rest-plugin, v2.1.6.  I am using
 struts2-rest-showcase-2.1.6 as a guide. The showcase app works fine for
 me,
 and I have modeled my struts.xml, web.xml, and pom.xml after its
 example.

 Still, my app always returns a 404 error for any RESTful URL request.
  Here
 are my 2 example URLs that I would expect to work at this point:

 http://localhost:8080/rest/subdivision.xml
 http://localhost:8080/rest/subdivision/F11.xml

 I have cranked up debug, and even though the Restful Mapper 
 Interceptor
 appear to be properly registered at startup:

 [code]
 DEBUG [main] XmlConfigurationProvider.debug(57) | Loaded [BUILDER]
 {PackageConfig Name:convention-default namespace:
 parents:[{PackageConfig
 Name:struts-default namespace: parents:[]}]}

 DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Setting action
 default parent package to [rest-default]

 DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Loading action
 configurations

 DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Actions being
 loaded using package locators [rest]

 DEBUG [main] PackageBasedActionConfigBuilder.trace(69) | Excluding
 actions
 from packages [org.apache.struts.*, org.apache.struts2.*,
 org.springframework.web.struts.*, org.springframework.web.struts2.*,
 org.hibernate.*]

 DEBUG [main] PackageBasedActionConfigBuilder.debug(57) | Processing
 class
 [com.tousa.ws.rest.SubdivisionController] in package
 [com.tousa.ws.rest]

 DEBUG [main] SEOActionNameBuilder.trace(69) | Changed action name from
 

Re: using a custom Converter for elements of a Collection

2011-01-12 Thread stanlick
Can we see your related files?

On Wed, Jan 12, 2011 at 3:43 PM, Scott Koenig scott.l.koe...@gmail.comwrote:

 Hello,

 In my company's internal CMS, we are implementing two new asset types,
 Videos and Playlists (collections of Videos). In the Video UI, the user
 designates which Playlists are to be associated with a given Video, and
 these values are posted on save via an array called playlists which
 contains the UIDs of each Playlist. These are represented as an
 ArrayListPlaylist in the Video POJO.

 We have implemented a PlaylistConverter to convert each String UID to a
 Playlist instance (and back), and going off of

 http://struts.apache.org/2.1.8/docs/type-conversion.html#TypeConversion-CollectionandMapSupport
 ,
 added Element_playlists=[converterpackage].PlaylistConverter to
 Video-conversion.properties.

 Save was not committing and there seemed to be some conversion error, so I
 stepped through the conversion process to try and determine what was going
 wrong. Everything seems to be fine at the Collection level; it properly
 determines that the toType of the collection is List and the memberType is
 Playlist. However, when XWorkConverter.getConverter() tries to find the
 converter for the individual members, even though Element_playlists=class
 [converterpackage].PlaylistConverter is present in the mappings, the
 property String passed in is still playlists instead of
 Element_playlists and thus it does not hook up the playlist ID with the
 converter and falls back to the default converter (which cannot handle it
 and is what is raising the error).

 Any guidance as to what could be going wrong here would be greatly
 appreciated.

 Thank you very much,
 ~~Scott


 PS--If it's useful, our system depends on the following libraries:

 ognl-3.0.jar
 struts2-core-2.1.8.1.jar
 xwork-core-2.1.6.jar



Re: Multiple Submit Buttons problem in Struts2

2011-01-02 Thread stanlick
How about something  like this?

s:form namespace=/customer 
s:hidden key=domain.id /
s:textfield key=domain.firstName /
s:textfield key=domain.lastName /
s:textfield key=domain.address1 /
s:textfield key=domain.address2 /
s:textfield key=domain.city /
s:textfield key=domain.state /
s:textfield key=domain.zip /


s:submit action=customer_cancel value=Cancel/
s:submit action=customer_save value=Save/
s:submit action=customer_print value=Print/
/s:if
/s:form

Scott

On Sat, Jan 1, 2011 at 8:53 AM, aum strut aum.str...@gmail.com wrote:

 Hi All,

 Trying to work with multiple submit buttons within a single form in struts2
 application but not able to work. here is the jsp code i am using

 tr
td
 class=buttoninput type=submit value=Import

 name=destinationImport class=button/td
td
 class=buttoninput type=submit value=Export

 name=destinationExport class=button/td
/tr

 here is the java part

 private boolean destinationImport;
private boolean destinationExport;
 and there respective setter and getter

 but i am sure is that Struts2 type convertor is having problem converting
 the String value to boolean do any one have idea how to achieve this

 i am using struts-2.2.1 version.

 Thanks in advance



Re: Precedence

2011-01-02 Thread stanlick
Do you need to write the method called super()?  I Couldn't resist

S

On Thu, Dec 30, 2010 at 4:29 PM, Dave Newton davelnew...@gmail.com wrote:

 So, what might happen if you called it (super()) in validate()?

 I mean, I apologize for not just outright telling you, but I really like it
 when people puzzle through stuff like this themselves, because it is *the*
 most important skill you can have as a developer (or anything else, for
 that
 matter).

 (I also might be *totally* wrong, in which case sorry I confused the
 issue--my bad.)

 Dave

 On Thu, Dec 30, 2010 at 5:13 PM, Anjib Mulepati anji...@hotmail.com
 wrote:

  The reason I want to do it in two place is I am hoping I can do simple
  validation in xml file and other custom validation in validate() method.
  This is all because in my file uploading program if I try to upload large
  file  I get null in other text box which otherwise works fine with
 smaller
  file.
 
  Anjib
 
 
  On 12/30/2010 2:03 PM, Dave Newton wrote:
 
  ...
 
  So, what might happen if you called it in validate()?
 
  Dave
 
  On Thu, Dec 30, 2010 at 2:01 PM, Anjib Mulepatianji...@hotmail.com
   wrote:
 
   Not in validate but in constructor.
 
  On 12/30/2010 1:56 PM, Dave Newton wrote:
 
   Are you calling super() in your validate() method?
 
  On Thu, Dec 30, 2010 at 1:38 PM, Anjib Mulepatianji...@hotmail.com
   wrote:
 
   I am using 1.3.8. I try with simple one and seems that validate() has
  the
 
  precedence. In fact rules in .xml file is never checked even my class
  is
  extended from ValidatorForm.
 
   Do you call super () (S1)?
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



Re: Authorization/ Authentication

2010-12-28 Thread stanlick
Dave is right in that there are truly a dozen ways to do this.  However,
Struts does not have an out-of-the-box solution governing user/role level
permissions.  Does your company have a user user based permissions system in
house today where permissions are determined according to the user logged
in?  You should be able to latch into it with a Struts 2 interceptor and do
with the requests only what is authorized.  I worked in a shop that
integrated a home-grown LDAP back end security system via a Struts 2
interceptor where the specific URL was a feature that a user had to be
specifically authorized to.  I thought it was crazy, however, if you want
short employees to only access short reports while tall employees can run
slightly longer reports, you sort of have to bite the bullet somewhere.

Peace,
Scott

On Tue, Dec 28, 2010 at 11:49 AM, Amol Ghotankar ghotankaru...@gmail.comwrote:

 I can elaborate on the requirement as follows,

 Assume a simple action which is authorized to be called by sales dept
 people
 only. i.e showSales.action

 When a user from purchase dept tries to call this action then, an
 interceptors will check whether the user in role has the authorization to
 access or not and deny access to purchase dept user to access this action
 this is simple.

 I have implemented this using before advice of Spring AOP rather than
 interceptor. I hope i am not wrong?

 But the bigger problem is

 By how much, I mean for eg. if an *sales execute *logs in and clicks
 showSales.action then he must be get view of his own sales list, but
 when *sales
 manager* logs in and calls same action i.e showSales.action then he must
 get
 more* bigger n wider list, which can be union of data from all sales
 executives.

 Here authorization of some kind must be implemented which intercepts DAO's
 and automatically sets the where clause in the sql query.

 I tried before advice of spring for DAO's also but problem is if where
 clause is set somewhere within business logic then double where clause is
 set which gives error and because I am using hibernate criteria's to set
 restrictions on queries I have noticed this hibernate critera's are
 immutable* (Is there anyway to change them?)


 what should be the best way to solve this problem. Any Design Pattern
 or s*omething
 in struts that can help me here* or something other advice for it?




 On Tue, Dec 28, 2010 at 10:01 PM, Dave Newton davelnew...@gmail.com
 wrote:

  On Tue, Dec 28, 2010 at 11:10 AM, Amol Ghotankar 
 ghotankaru...@gmail.com
  wrote:
 
   Even I am searching for some better way in which authentication can be
  done
   using struts2 or spring security toghether.
  
   No direct or simple example to explain it working together.
  
   Specially for these two cases where
  
   1. which user can access which action,  is stored in database -
   authorization table
   2. which user can access how much data from a table in database,  is
   decided
   by authorization logic.
  
   How to implement this any example or references welcomed.
  
 
  There are essentially unlimited ways this can be implemented.
 
  It also depends what technology you want to use. I haven't used Spring
  Security for some time, so I won't be much help there, but I *do* know
 it's
  incredibly granular and flexible, occasionally a bit too much so for my
  taste, but it can be made to look simple.
 
  How much data can be accessed has multiple meanings: do you mean
  *quantity* of data? I've never even considered trying to implement that.
  *Which* data would be handled the same way as everything else, however
 it's
  being handled.
 
  When I've dealt with legacy authentication mechanisms I usually just do
  something like a filter/interceptor that checks the action for an
  annotation
  (or a known action method naming convention to map action method =
 access
  control). After the user logs in their user info is available in the
  session, and if they're allowed access the interceptor just moves along,
  and
  if they're not, they're redirected somewhere reasonable.
 
  For Spring Security stuff I would refer you to the Spring documentation,
  since it's not directly related to Struts 2.
 
  Dave
 



 --


 With Best Regards,

 Amol Ghotankar
 Cursive Technologies Pvt. Ltd.
 www.cursivetech.com



Re: Struts 2 JSR-303 Bean Validation Support

2010-12-20 Thread stanlick
Not quite sure what that means.  JSR303 is an annotations based validation
API and you could certainly add your own JSR303Interceptor at the
appropriate point in the stack.

On Mon, Dec 20, 2010 at 10:41 AM, Alfredo Manuel Osorio Martinez 
alfredo.oso...@afirme.com wrote:

 Hello,

 Does Struts 2 have support for JSR-303 Bean Validation?


 Alfredo Osorio

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Parameter manipulation

2010-12-17 Thread stanlick
David --

You could override the ParametersInterceptor with your own that validates
requester role/parms/url.  I have used this approach to throw away
not-authorized parms altogether.

Scott

On Fri, Dec 17, 2010 at 8:54 AM, Altenhof, David Aron dalte...@iupui.eduwrote:

 The model objects are initialized in prepare() ... other techniques just
 aren't as practical for our application.

 I'm just going to keep doing lots of whitelisting with
 ParameterNameAware...

 -David



 -Original Message-
 From: Steven Yang [mailto:kenshin...@gmail.com]
 Sent: Friday, December 17, 2010 1:10 AM
 To: Struts Users Mailing List
 Subject: Re: Parameter manipulation

 is your user object initialized when the param interceptor is run?

 here i might be wrong, but what i know is if your object is initialized
 then Struts or OGNL will call getUser().setEmail(...) otherwise create a new
 User then setEmail then setUser then the second case should fail for you

 again, i might be wrong on the behavior

 On Thu, Dec 16, 2010 at 12:39 AM, Altenhof, David Aron
 dalte...@iupui.eduwrote:

  I've been getting more and more concerned about the possibility of
  parameter manipulation attacks with Struts2. I've started doing strict
  whitelists using the ParameterNameAware interface on all of my forms
 pages.
  However, today I tried to code a display-only page that shows
  information about a particular user. I thought that by simply creating
  a getter and no setter, it would be impossible to inject parameters.
  For example, my action only contains the following getter for a JPA model
 object:
 
  public User getUser() {
 return user;
  }
 
  However, by sending a simple query parameter, it is *still* possible
  to change values in user. For example, you can send:
 
 
  http://localhost:8080/MySite/userdisplay.action?user.email=newem...@ad
  dress.com
 
  ... and it works. The email will become newem...@address.com
 
  Is there any way to shut this down other than whitelisting every
  single action in your site using ParameterNameAware? (Or simply never
  put model objects on your stack?) This is getting frustrating!
 
  -David
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Parameter manipulation

2010-12-17 Thread stanlick
Guys --

If the action has no setter and the property is private, S2 will not
populate it.

Scott

On Fri, Dec 17, 2010 at 11:10 AM, Maurizio Cucchiara 
maurizio.cucchi...@gmail.com wrote:

 David,
 I get your point.

 Scott is right, you could overwrite PI or maybe write your custom
 interceptor (though I think you should consider to file an issue on
 JIRA).
 Maybe it would use java annotations to hide/expose fields, or
 alternately it could behave as you supposed (expose only field with
 write accessors).




 2010/12/17 Altenhof, David Aron dalte...@iupui.edu:
  The model objects are initialized in prepare() ... other techniques just
 aren't as practical for our application.
 
  I'm just going to keep doing lots of whitelisting with
 ParameterNameAware...
 
  -David
 
 
 
  -Original Message-
  From: Steven Yang [mailto:kenshin...@gmail.com]
  Sent: Friday, December 17, 2010 1:10 AM
  To: Struts Users Mailing List
  Subject: Re: Parameter manipulation
 
  is your user object initialized when the param interceptor is run?
 
  here i might be wrong, but what i know is if your object is initialized
 then Struts or OGNL will call getUser().setEmail(...) otherwise create a new
 User then setEmail then setUser then the second case should fail for you
 
  again, i might be wrong on the behavior
 
  On Thu, Dec 16, 2010 at 12:39 AM, Altenhof, David Aron
  dalte...@iupui.eduwrote:
 
  I've been getting more and more concerned about the possibility of
  parameter manipulation attacks with Struts2. I've started doing strict
  whitelists using the ParameterNameAware interface on all of my forms
 pages.
  However, today I tried to code a display-only page that shows
  information about a particular user. I thought that by simply creating
  a getter and no setter, it would be impossible to inject parameters.
  For example, my action only contains the following getter for a JPA
 model object:
 
  public User getUser() {
 return user;
  }
 
  However, by sending a simple query parameter, it is *still* possible
  to change values in user. For example, you can send:
 
 
  http://localhost:8080/MySite/userdisplay.action?user.email=newem...@ad
  dress.com
 
  ... and it works. The email will become newem...@address.com
 
  Is there any way to shut this down other than whitelisting every
  single action in your site using ParameterNameAware? (Or simply never
  put model objects on your stack?) This is getting frustrating!
 
  -David
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Maurizio Cucchiara

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Parameter manipulation

2010-12-17 Thread stanlick
I agree S2 will create the bean (if null) but it can't set a property that
is private and has no accessible setter method.

P.S. What am I missing here?

Scott

On Fri, Dec 17, 2010 at 11:45 AM, Maurizio Cucchiara 
maurizio.cucchi...@gmail.com wrote:

 This happens because bean is null, otherwise struts will populate.

 2010/12/17  stanl...@gmail.com:
  Guys --
 
  If the action has no setter and the property is private, S2 will not
  populate it.
 
  Scott
 
  On Fri, Dec 17, 2010 at 11:10 AM, Maurizio Cucchiara 
  maurizio.cucchi...@gmail.com wrote:
 
  David,
  I get your point.
 
  Scott is right, you could overwrite PI or maybe write your custom
  interceptor (though I think you should consider to file an issue on
  JIRA).
  Maybe it would use java annotations to hide/expose fields, or
  alternately it could behave as you supposed (expose only field with
  write accessors).
 
 
 
 
  2010/12/17 Altenhof, David Aron dalte...@iupui.edu:
   The model objects are initialized in prepare() ... other techniques
 just
  aren't as practical for our application.
  
   I'm just going to keep doing lots of whitelisting with
  ParameterNameAware...
  
   -David
  
  
  
   -Original Message-
   From: Steven Yang [mailto:kenshin...@gmail.com]
   Sent: Friday, December 17, 2010 1:10 AM
   To: Struts Users Mailing List
   Subject: Re: Parameter manipulation
  
   is your user object initialized when the param interceptor is run?
  
   here i might be wrong, but what i know is if your object is
 initialized
  then Struts or OGNL will call getUser().setEmail(...) otherwise create a
 new
  User then setEmail then setUser then the second case should fail for you
  
   again, i might be wrong on the behavior
  
   On Thu, Dec 16, 2010 at 12:39 AM, Altenhof, David Aron
   dalte...@iupui.eduwrote:
  
   I've been getting more and more concerned about the possibility of
   parameter manipulation attacks with Struts2. I've started doing
 strict
   whitelists using the ParameterNameAware interface on all of my forms
  pages.
   However, today I tried to code a display-only page that shows
   information about a particular user. I thought that by simply
 creating
   a getter and no setter, it would be impossible to inject parameters.
   For example, my action only contains the following getter for a JPA
  model object:
  
   public User getUser() {
  return user;
   }
  
   However, by sending a simple query parameter, it is *still* possible
   to change values in user. For example, you can send:
  
  
  
 http://localhost:8080/MySite/userdisplay.action?user.email=newem...@ad
   dress.com
  
   ... and it works. The email will become newem...@address.com
  
   Is there any way to shut this down other than whitelisting every
   single action in your site using ParameterNameAware? (Or simply never
   put model objects on your stack?) This is getting frustrating!
  
   -David
  
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
 
 
 
  --
  Maurizio Cucchiara
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Maurizio Cucchiara

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Parameter manipulation

2010-12-17 Thread stanlick
That would certainly eliminate the email being set! :)  Sorry about that.
 What I have done is combine a security system based on
user/role/url/valid-parameter list with the ParametersInterceptor and throw
away any unauthorized parameters.  This was quite an undertaking and my
company is not willing to allow me to contribute it back on account of all
the hooks and hinges.  Looking back, it was not really that difficult.  You
could have a hierarchical structure keyed on URL that is combed for user
permissions.  I would hate to see what your white lists are starting to
look like.

Good luck and holler if I can offer any tips.

Peace,
Scott

On Fri, Dec 17, 2010 at 12:04 PM, Maurizio Cucchiara 
maurizio.cucchi...@gmail.com wrote:

 So, in case of the OP, are you suggesting to remove setter method from
 User's email?

 2010/12/17  stanl...@gmail.com:
  I agree S2 will create the bean (if null) but it can't set a property
 that
  is private and has no accessible setter method.
 
  P.S. What am I missing here?
 
  Scott
 
  On Fri, Dec 17, 2010 at 11:45 AM, Maurizio Cucchiara 
  maurizio.cucchi...@gmail.com wrote:
 
  This happens because bean is null, otherwise struts will populate.
 
  2010/12/17  stanl...@gmail.com:
   Guys --
  
   If the action has no setter and the property is private, S2 will not
   populate it.
  
   Scott
  
   On Fri, Dec 17, 2010 at 11:10 AM, Maurizio Cucchiara 
   maurizio.cucchi...@gmail.com wrote:
  
   David,
   I get your point.
  
   Scott is right, you could overwrite PI or maybe write your custom
   interceptor (though I think you should consider to file an issue on
   JIRA).
   Maybe it would use java annotations to hide/expose fields, or
   alternately it could behave as you supposed (expose only field with
   write accessors).
  
  
  
  
   2010/12/17 Altenhof, David Aron dalte...@iupui.edu:
The model objects are initialized in prepare() ... other techniques
  just
   aren't as practical for our application.
   
I'm just going to keep doing lots of whitelisting with
   ParameterNameAware...
   
-David
   
   
   
-Original Message-
From: Steven Yang [mailto:kenshin...@gmail.com]
Sent: Friday, December 17, 2010 1:10 AM
To: Struts Users Mailing List
Subject: Re: Parameter manipulation
   
is your user object initialized when the param interceptor is run?
   
here i might be wrong, but what i know is if your object is
  initialized
   then Struts or OGNL will call getUser().setEmail(...) otherwise
 create a
  new
   User then setEmail then setUser then the second case should fail for
 you
   
again, i might be wrong on the behavior
   
On Thu, Dec 16, 2010 at 12:39 AM, Altenhof, David Aron
dalte...@iupui.eduwrote:
   
I've been getting more and more concerned about the possibility of
parameter manipulation attacks with Struts2. I've started doing
  strict
whitelists using the ParameterNameAware interface on all of my
 forms
   pages.
However, today I tried to code a display-only page that shows
information about a particular user. I thought that by simply
  creating
a getter and no setter, it would be impossible to inject
 parameters.
For example, my action only contains the following getter for a
 JPA
   model object:
   
public User getUser() {
   return user;
}
   
However, by sending a simple query parameter, it is *still*
 possible
to change values in user. For example, you can send:
   
   
   
  http://localhost:8080/MySite/userdisplay.action?user.email=newem...@ad
dress.com
   
... and it works. The email will become newem...@address.com
   
Is there any way to shut this down other than whitelisting every
single action in your site using ParameterNameAware? (Or simply
 never
put model objects on your stack?) This is getting frustrating!
   
-David
   
   
   
 -
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
   
   
   
   
 -
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
   
   
  
  
  
   --
   Maurizio Cucchiara
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
  
 
 
 
  --
  Maurizio Cucchiara
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



 --
 Maurizio Cucchiara

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, 

Re: Convention without REST

2010-12-15 Thread stanlick
Thanks Allen --

I modified the remove() to return SUCCESS and it only resulted in a
different error; namely:

  *Messages*:
 No result defined for action com.foo.actions.music.InstrumentsAction and
result success

From all the reading (source code is next) it sure seems like *
http://localhost:8080/struts2-20a/music/instruments/remove* on an
action* com.foo.actions.music.InstrumentsAction
*with a method* remove() that returns remove *should automatically
select* music/instruments-remove.jsp
*using the convention mapper.

Peace,
Scott




On Tue, Dec 14, 2010 at 5:06 PM, Allen Lee allen@asu.edu wrote:

 I think this does the right thing if you return Action.SUCCESS in your
 remove() action method instead of remove.  Otherwise you'll need a
 custom result mapping for that new result string.

 On Tue, Dec 14, 2010 at 8:57 AM,  stanl...@gmail.com wrote:
  I began writing about the 2.2.1 convention plugin and naturally started
  writing code.  I especially like not having to code XML when my file
 naming
  is clean and straightforward.  I started off with a package named
  *com.foo.actions.music* which resolves to the namespace (URL)* /music*.
   Next I created an Action there call* Instruments* which is accessible
  via*/music/instruments
  * where the *execute *method is invoked and the resulting
  *WEB-INF/content/music/instruments.jsp
  *displayed.  So now I want to experiment with specialized variations on
 the
  URL in order to execute methods other than execute.  I added a method
 
 @Action(/remove)
 public String remove() {
   return remove;
  }
 
  to my *Instruments *action and tried the following URL in the browser*
  /music/instruments/remove.
   *The remove method was invoked where it returned the string remove.  I
  expected this to resolve to
  *WEB-INF/content/music/instruments-remove.jsp, *which
  it **did not**.  Instead I received that oh-so-familiar
 
  *Messages*:
  No result defined for action com.foo.actions.music.InstrumentsAction and
  result remove
 
  After several experiments and readings, I added the following annotation:
 
  @Action(value = /remove, results = { @Result(name = remove, type =
  dispatcher, location = music/instruments-remove.jsp) })
  public String remove() {
  return remove;
  }
 
  which has both  * /music/instruments *and* **
  /music/instruments/remove *working
  fine.  However, as I study this annotation, it looks like the convention
 has
  fallen down and I am simply coding annotations where I would have wired
 up
  XML glue.  I realize there is support for REST and wildcards, but I would
  like to see if anyone can throw me a bone vis-a-vis the annotations
 plug-in
  and support for methods beyond execute().  I realize I could have if/else
  code in execute() that returns this string or that, but seriously?
 



 --
 Allen Lee
 Center for the Study of Institutional Diversity [http://csid.asu.edu]
 Arizona State University | P.O. Box 872402 | Tempe, Arizona 85287-2402
 Office: 480.727.0401 | Fax: 480.965.7671

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Convention without REST

2010-12-14 Thread stanlick
I began writing about the 2.2.1 convention plugin and naturally started
writing code.  I especially like not having to code XML when my file naming
is clean and straightforward.  I started off with a package named
*com.foo.actions.music* which resolves to the namespace (URL)* /music*.
 Next I created an Action there call* Instruments* which is accessible
via*/music/instruments
* where the *execute *method is invoked and the resulting
*WEB-INF/content/music/instruments.jsp
*displayed.  So now I want to experiment with specialized variations on the
URL in order to execute methods other than execute.  I added a method

@Action(/remove)
public String remove() {
  return remove;
 }

to my *Instruments *action and tried the following URL in the browser*
/music/instruments/remove.
 *The remove method was invoked where it returned the string remove.  I
expected this to resolve to
*WEB-INF/content/music/instruments-remove.jsp, *which
it **did not**.  Instead I received that oh-so-familiar

*Messages*:
No result defined for action com.foo.actions.music.InstrumentsAction and
result remove

After several experiments and readings, I added the following annotation:

@Action(value = /remove, results = { @Result(name = remove, type =
dispatcher, location = music/instruments-remove.jsp) })
public String remove() {
return remove;
}

which has both  * /music/instruments *and* **
/music/instruments/remove *working
fine.  However, as I study this annotation, it looks like the convention has
fallen down and I am simply coding annotations where I would have wired up
XML glue.  I realize there is support for REST and wildcards, but I would
like to see if anyone can throw me a bone vis-a-vis the annotations plug-in
and support for methods beyond execute().  I realize I could have if/else
code in execute() that returns this string or that, but seriously?


Re: [S2.2.1] Struts Type Converter for sub-model objects not working?

2010-12-12 Thread stanlick
You need to determine why contact.contactLead.income is being evaluated
as $123.  This is forcing the search for setIncome(String).  Is the user
entering this value?  If so, you need to strip it of the String so it can
be considered a BigDecimal.

On Sat, Dec 11, 2010 at 6:51 PM, Burton Rhodes burtonrho...@gmail.comwrote:

 I know. I don't have a setIncome(String) method. But I do have
 setIncome(BigDecimal) method , hence the type conversion. Normally the
 class MyCurrencyCoverter will covert the String to BigDecimal, but
 it's never called. I am wondering what I am doing wrong that the
 conversion class is not called.

 On Saturday, December 11, 2010,  stanl...@gmail.com wrote:
  Look at the bottom of your message and also the top.
  'contact.contactLead.income' evaluated
  to '$123' and you do not have a method
  com.afs.entity.ContactLead.setIncome([Ljava.lang.String;)]
 
  Scott
 
  On Fri, Dec 10, 2010 at 2:53 PM, Burton Rhodes burtonrho...@gmail.com
 wrote:
 
  I am having issues trying to get a Type Converter to run when
  converting a field that is a sub-object of the main model.  For
  example, I have a Contact class that contains a ContactLead class.  I
  have an Action class that saves a new Contact and ContactLead at the
  same time.  Originally, I set up my
  ContactCreateAction-conversion.properties file to convert the
  contact.contactLead.income  field (three levels deep).  However,
  MyCurrencyConverter class never gets called.  I then changed my Action
  and Jsp pages to have seperate Contact and ContactLead objects and
  changed the conversion.properties file to convert
  contactLead.income.  In this case, MyCurrencyConverter is called and
  everything works fine.
 
  Although everything is fine, shouldn't the conversion be recursive?
  Is this supposed to work, and I'm doing something wrong?  I have tried
  it both ways several times to make sure I didn't just mess something
  up, but each time I'm getting the same result.  Any comments welcome.
 
  Below are code snippets only.
 
  ***  DOES NOT WORK ***
  ContactCreateAction-conversion.properties:
  contact.contactLead.income=com.afs.web.converter.MyCurrencyConverter
 
  Jsp File:
  s:textfield name=contact.contactLead.income
  value=%{getText('format.money',{contact.contactLead.income != null ?
  contact.contactLead.income :''})}  /
 
  ***  DOES WORK ***
  ContactCreateAction-conversion.properties:
  contactLead.income=com.afs.web.converter.MyCurrencyConverter
 
  Jsp File:
  s:textfield name=contactLead.income
  value=%{getText('format.money',{contactLead.income != null ?
  contactLead.income :''})}  /
 
   The Contact Class 
  // Most code ommitted
  public class Contact implements Serializable {
 
 @Id
 @GeneratedValue
 @Column(name = ContactId)
 private Integer contactId;
 
 @OneToOne(cascade = { CascadeType.ALL }, fetch=FetchType.LAZY)
 @JoinColumn(name=ContactLeadId)
 private ContactLead contactLead;
 
 ...  More veriables and getters/setters below
  }
 
  *** THE ERROR ***
  Dec 10, 14:41:49 (CommonsLogger.java:56)
  WARN : The first TextProvider in the ValueStack
  (com.afs.web.action.contact.ContactCreateAction) could not locate the
  message resource with key 'contact.contactLead.income'
  Dec 10, 14:41:49 (CommonsLogger.java:56)
  WARN : The default value expression 'contact.contactLead.income' was
  evaluated and did not match a property.  The literal value
  'contact.contactLead.income' will be used.
  Dec 10, 14:41:49 (CommonsLogger.java:56)
  WARN : The first TextProvider in the ValueStack
  (com.afs.web.action.contact.ContactCreateAction) could not locate the
  message resource with key 'contact.contactLead.nextStepDate'
  Dec 10, 14:41:50 (CommonsLogger.java:56)
  WARN : The default value expression 'contact.contactLead.nextStepDate'
  was evaluated and did not match a property.  The literal value
  'contact.contactLead.nextStepDate' will be used.
  Dec 10, 14:41:55 (CommonsLogger.java:60)
  WARN : Error setting expression 'contact.contactLead.income' with
  value '[Ljava.lang.String;@1fbc2c7'
  ognl.MethodFailedException: Method setIncome failed for object
  com.afs.entity.contactl...@16e1c2c [java.lang.NoSuchMethodException:
  com.afs.entity.ContactLead.setIncome([Ljava.lang.String;)]
 at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285)
 at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474)
 at
 
 ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
 at
  ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
   -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 

Re: [S2.2.1] Struts Type Converter for sub-model objects not working?

2010-12-11 Thread stanlick
Look at the bottom of your message and also the top.
'contact.contactLead.income' evaluated
to '$123' and you do not have a method
com.afs.entity.ContactLead.setIncome([Ljava.lang.String;)]

Scott

On Fri, Dec 10, 2010 at 2:53 PM, Burton Rhodes burtonrho...@gmail.comwrote:

 I am having issues trying to get a Type Converter to run when
 converting a field that is a sub-object of the main model.  For
 example, I have a Contact class that contains a ContactLead class.  I
 have an Action class that saves a new Contact and ContactLead at the
 same time.  Originally, I set up my
 ContactCreateAction-conversion.properties file to convert the
 contact.contactLead.income  field (three levels deep).  However,
 MyCurrencyConverter class never gets called.  I then changed my Action
 and Jsp pages to have seperate Contact and ContactLead objects and
 changed the conversion.properties file to convert
 contactLead.income.  In this case, MyCurrencyConverter is called and
 everything works fine.

 Although everything is fine, shouldn't the conversion be recursive?
 Is this supposed to work, and I'm doing something wrong?  I have tried
 it both ways several times to make sure I didn't just mess something
 up, but each time I'm getting the same result.  Any comments welcome.

 Below are code snippets only.

 ***  DOES NOT WORK ***
 ContactCreateAction-conversion.properties:
 contact.contactLead.income=com.afs.web.converter.MyCurrencyConverter

 Jsp File:
 s:textfield name=contact.contactLead.income
 value=%{getText('format.money',{contact.contactLead.income != null ?
 contact.contactLead.income :''})}  /

 ***  DOES WORK ***
 ContactCreateAction-conversion.properties:
 contactLead.income=com.afs.web.converter.MyCurrencyConverter

 Jsp File:
 s:textfield name=contactLead.income
 value=%{getText('format.money',{contactLead.income != null ?
 contactLead.income :''})}  /

  The Contact Class 
 // Most code ommitted
 public class Contact implements Serializable {

@Id
@GeneratedValue
@Column(name = ContactId)
private Integer contactId;

@OneToOne(cascade = { CascadeType.ALL }, fetch=FetchType.LAZY)
@JoinColumn(name=ContactLeadId)
private ContactLead contactLead;

...  More veriables and getters/setters below
 }

 *** THE ERROR ***
 Dec 10, 14:41:49 (CommonsLogger.java:56)
 WARN : The first TextProvider in the ValueStack
 (com.afs.web.action.contact.ContactCreateAction) could not locate the
 message resource with key 'contact.contactLead.income'
 Dec 10, 14:41:49 (CommonsLogger.java:56)
 WARN : The default value expression 'contact.contactLead.income' was
 evaluated and did not match a property.  The literal value
 'contact.contactLead.income' will be used.
 Dec 10, 14:41:49 (CommonsLogger.java:56)
 WARN : The first TextProvider in the ValueStack
 (com.afs.web.action.contact.ContactCreateAction) could not locate the
 message resource with key 'contact.contactLead.nextStepDate'
 Dec 10, 14:41:50 (CommonsLogger.java:56)
 WARN : The default value expression 'contact.contactLead.nextStepDate'
 was evaluated and did not match a property.  The literal value
 'contact.contactLead.nextStepDate' will be used.
 Dec 10, 14:41:55 (CommonsLogger.java:60)
 WARN : Error setting expression 'contact.contactLead.income' with
 value '[Ljava.lang.String;@1fbc2c7'
 ognl.MethodFailedException: Method setIncome failed for object
 com.afs.entity.contactl...@16e1c2c [java.lang.NoSuchMethodException:
 com.afs.entity.ContactLead.setIncome([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1285)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474)
at
 ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
at
 ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
at
 com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2245)
at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.ASTChain.setValueBody(ASTChain.java:227)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)
at
 com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)
at
 com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)
at
 com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)
at
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:288)
at
 

Re: Live Reload - Play framework

2010-12-10 Thread stanlick
Actually, it shouldn't come down to using the *other* because the
*one*doesn't support one neat feature.  I have always thought the
parameters
interceptor should reflect on object properties in the case where it could
not find a set/get method.  These determinations could be cached.  Dave, can
you whip this up today?

Peace,
Scott

On Fri, Dec 10, 2010 at 7:30 AM, Dave Newton davelnew...@gmail.com wrote:

 On Fri, Dec 10, 2010 at 6:14 AM, Frans Thamura wrote:

  any one look this
 
  http://www.playframework.org/
 
  will this feature inside S2
 

 Why bother? Use one or the other.

 Dave



Re: Live Reload - Play framework

2010-12-10 Thread stanlick
No schit!  Going to try it now.

On Fri, Dec 10, 2010 at 9:04 AM, Dave Newton davelnew...@gmail.com wrote:

 On Fri, Dec 10, 2010 at 9:59 AM, stanl...@gmail.com wrote:

  I have always thought the parameters interceptor should reflect on object
  properties in the case where it could
  not find a set/get method.
 

 Properties haven't needed setters since ~2.1, give or take. I don't know if
 that was an OGNL change or an S2 change, but when I updated the book for
 S2.1 that was one of the changes I had to make. Don't know if anything is
 cached or not.

 Dave



Re: Live Reload - Play framework

2010-12-10 Thread stanlick
They do, but what the hell.  I think we have reached a level of
sophistication (pronounced no dumb people on the team) where this should no
longer be a problem.  I really haven't seen validation code in a setter
method anyway.  They are usually generated as:

public void setFoo(String foo){
 this.foo=foo;
}

On Fri, Dec 10, 2010 at 9:11 AM, Dave Newton davelnew...@gmail.com wrote:

 I think they still have to be public, but I don't really remember anymore.

 On Fri, Dec 10, 2010 at 10:09 AM, stanl...@gmail.com wrote:

  No schit!  Going to try it now.
 
  On Fri, Dec 10, 2010 at 9:04 AM, Dave Newton davelnew...@gmail.com
  wrote:
 
   On Fri, Dec 10, 2010 at 9:59 AM, stanl...@gmail.com wrote:
  
I have always thought the parameters interceptor should reflect on
  object
properties in the case where it could
not find a set/get method.
   
  
   Properties haven't needed setters since ~2.1, give or take. I don't
 know
  if
   that was an OGNL change or an S2 change, but when I updated the book
 for
   S2.1 that was one of the changes I had to make. Don't know if anything
 is
   cached or not.
  
   Dave
  
 



execAndWait Interceptor

2010-12-09 Thread stanlick
Does anyone actually use this interceptor?  I have a team asking me about
it's use in production and how this solution would compare to a jQuery
solution.  I played around with it lst night and am skeptical about it.  For
one thing, the documentation says

The ExecuteAndWaitInterceptor is great for running long-lived actions in
the background while showing the user a nice progress meter. This also
prevents the HTTP request from timing out when the action takes more than 5
or 10 minutes.

and a request like that would get me fired!

Peace,
Scott


Token* interceptors

2010-12-09 Thread stanlick
This is being posted separate from my other post for search clarity.  The
same team that is questioning server vs. client, is asking how these
interceptors are better than simply inhibiting input by the client for the
duration of the submit.  Are these interceptors falling off in popularity?
Like plug-ins, it would be valuable to see what the usage numbers are for
these features in terms of heuristics surrounding mainstream patterns
today.  Also, it might help to reduce the size of Struts/2 where dead
features could be removed.

While having a dozen ways to do any one thing is possible, it doesn't always
make things better.  With lightweight being the name of the game, perhaps
it's time to do a little pruning.


Re: execAndWait Interceptor

2010-12-09 Thread stanlick
I thought about that Dave, but isn't reporting an exception to the rule?
Also, should a web framework try to play the role of a reporting solution?
I'm trying to get a handle on roles and responsibilities more than anything
else.  Very few web developers like the Swiss Army Knife approach on account
of it's complexity, weight, dependencies, and chance of hacking off a digit
during use.  The discussions we are having around here this week are more
along the lines of clean architecture than is it something Struts could do?

On Thu, Dec 9, 2010 at 10:18 AM, Dave Newton davelnew...@gmail.com wrote:

 But some requests just take that long, reporting in particular. I'm not
 sure
 what that has to do with execAndWait in particular, though... I'd rather do
 something Ajaxy myself, but that's kind of a separate issue.

 Dave

 On Thu, Dec 9, 2010 at 11:11 AM, stanl...@gmail.com wrote:

  Does anyone actually use this interceptor?  I have a team asking me about
  it's use in production and how this solution would compare to a jQuery
  solution.  I played around with it lst night and am skeptical about it.
   For
  one thing, the documentation says
 
  The ExecuteAndWaitInterceptor is great for running long-lived actions in
  the background while showing the user a nice progress meter. This also
  prevents the HTTP request from timing out when the action takes more than
 5
  or 10 minutes.
 
  and a request like that would get me fired!
 
  Peace,
  Scott
 



Re: Connection Pooling with Struts

2010-12-07 Thread stanlick
Dude, I can't sit quietly any longer!  How you connect to a database has
NOTHING WHATSOEVER to do with the Struts/2 Framework.  I would advise you to
keep the two separated in your mind.  Much like you wouldn't look to a
Database connection to serve a web page, neither should you look to Struts/2
as a Database connection.

On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati anji...@hotmail.com wrote:

 So I can use this DBCP Componenet instead of framework?

 Anjib

  E.g -. http://commons.apache.org/dbcp/

 On Tue, Dec 7, 2010 at 4:27 PM, Dave Newtondavelnew...@gmail.com
  wrote:

  A connection pooling library?

 On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepatianji...@hotmail.com
 wrote:

  Ok now I get confuse. I was thinking simple JDBC can't  (or complex to )
 handle connection pooling. So framework make work easy. If framework is

 not

 used what are other alternatives to handle connection pooling beside
 JDBC
 itself?

 Anjib


 On 12/7/2010 4:20 PM, Arthur Neves wrote:

  Nop,

 You dont need using a framework... if you pick one just will make your
 life
 easier!
 If you`re starting a new project I`d get one framework, however if the
 project it`s already ready, just keep doing in the same way!

 On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepatianji...@hotmail.com
  wrote:

  I was thinking for Hibernate.

 So only way for struts is use one of these framework?

 Anjib


 On 12/7/2010 3:26 PM, Johannes Geppert wrote:

  in java you have the choose which way is the best for your project to

 handle
 databases.

 there exists several frameworks for this job like hibernate, myBatis,
 spring
 jdbc tempalate, ... .
 google for it and look which framework is the best for your project.

 Johannes


 anjibman wrote:

  I have to do DB connection (Oracle 10g) in my application developed

 in

 Struts 1.3.8.

 Currently I am implementing JDBC. As far I understand this is not a
 good
 technique for real project. So I am hoping someone could suggest me

 how

 to do DB handling efficiently?

 Thanks
 Anjib


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




  -

 ---
 web: http://www.jgeppert.com
 twitter: http://twitter.com/jogep



  -

 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



  -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Incorporating action interceptor configuration parameters into a message

2010-12-01 Thread stanlick
Thanks Li --

I saw what the interceptor was doing and decided that was not going to
work.  Would you mind posting the simple technique to extract the
parameter from the interceptor configuration.  I'll admit I'm not a Guice
pro and studying the container build sent me straight to the bar last night.

Scott

On Tue, Nov 30, 2010 at 6:48 PM, Li Ying liying.cn.2...@gmail.com wrote:

 The source code of FileUploadInterceptor is:


 http://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java

 
 ..
 if (maximumSize != null  maximumSize  file.length()) {
String errMsg = getTextMessage(action,
 struts.messages.error.file.too.large, new Object[]{inputName,
 filename, file.getName(),  + file.length()}, locale);

 ..
 }
 ..
 

 It dose not pass the maximumSize to the message text as a param.


 So I think you have to hard code it in your message text.
 But I believe it is simple, and not extra coding need.




 2010/12/1  stanl...@gmail.com:
  Before I wrap myself around my own axle, does anyone know a
 straightforward
  technique for substituting the maximumSize into a message property text
  according to the following scenario.
 
 action name=singleUpload class=FileUploadAction
 method=upload
 interceptor-ref name=fileUpload
 param name=maximumSize100123/param
 param name=allowedTypes
 image/png,image/x-png
 /param
 /interceptor-ref
 interceptor-ref name=basicStack /
 result name=input/jsp/SingleUpload.jsp/result
 result/jsp/Confirm.jsp/result
 /action
 
  struts.messages.error.file.too.large=File {1} is {3} bytes which exceeds
 the
  maximum DD
 
  I see the value 100123 in the FileUploadInterceptor inside the
  ActionInvocation, but before I write stupid code, I'd like to see if
 there
  might be a straightforward approach.
 
  Peace,
  Scott
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Incorporating action interceptor configuration parameters into a message

2010-12-01 Thread stanlick
Thanks Li --

This is what I was afraid of, but wanted to make sure I wasn't overlooking
something a little more straightforward.  Before duplicating the max size
someplace else, I'll likely get into the Container build which reads the xml
files.  Somewhere in the back of my mind, it feels like I should be able to
solve this with an @Inject.  Perhaps Dandy Dave has a solution in his back
pocket that he would sell to the highest bidder. LOL

Peace,
Scott

On Wed, Dec 1, 2010 at 9:25 AM, Li Ying liying.cn.2...@gmail.com wrote:

 I have read the source code of FileUploadInterceptor.

 I think it do the message getting in it's private method, and dose not
 use the maximumSize as a message format param.

 So I believe there is no simple way to extract interceptor interceptor
 param.

 The simplest way I known is, hard coding the value in your message
 properties file, like:
 struts.messages.error.file.too.large=File {1} is {3} bytes which
 exceeds the maximum 100123.

 It is a little ugly, but looks like the only way.


 The other way is, create a new class extend from
 FileUploadInterceptor, and override the error message building part,
 add the maximumSize as a message format param.
 But it need many code, I don't think this issue is worth doing so may work.



 2010/12/1  stanl...@gmail.com:
  Thanks Li --
 
  I saw what the interceptor was doing and decided that was not going to
  work.  Would you mind posting the simple technique to extract the
  parameter from the interceptor configuration.  I'll admit I'm not a Guice
  pro and studying the container build sent me straight to the bar last
 night.
 
  Scott
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Internationalization with REST/Convention plug-ins

2010-12-01 Thread stanlick
I had a guy ask me why his internationalized properties were not accessible
in his Struts app that was using both the REST and Convention plug-ins.  My
first action was to read the docs which did not suggest anything out of the
ordinary, so I through a core app together using this configuration and sure
enough the properties were not found!

He is using

constant name=struts.convention.action.suffix value=Controller/

So I figured an Action called FooController would find
FooController.properties in the same folder as the FooController.class,
which as it turns out did *not* work.  I set a breakpoint at the top of
LocalizedTextUtil and the localist contains only the following two files
[org/apache/struts2/struts-messages,
com/opensymphony/xwork2/xwork-messages].  Shouldn't this collection include
my FooController.properties on a request http://.../foo?  Including a
message key from struts-messages works fine, however a key from
FooController.properties returns the key itself as it is not being located.

public static String findDefaultText(String aTextName, Locale locale) {
ListString localList = DEFAULT_RESOURCE_BUNDLES;

for (String bundleName : localList) {
ResourceBundle bundle = findResourceBundle(bundleName, locale);
if (bundle != null) {
reloadBundles();
try {
return bundle.getString(aTextName);
} catch (MissingResourceException e) {
// ignore and try others
}
}
}

return null;
}


Re: Internationalization with REST/Convention plug-ins

2010-12-01 Thread stanlick

de-rust?  That's awesome.  I personally am afraid to see what might be
lurking under all my rust.

There is a struts.convention.package.locators set to the top-level folder in
the class hierarchy.  One thing that I found interesting though, I added the
struts2-config-browser-plugin hoping to get a better look at the runtime and
discovered the url .../foo/config-browser/index.action throws a 404.  When I
removed the index.action I get the following stack trace.  You know, all
these plug-ins are great, but debugging this or that combination being used
is a PITA!

java.lang.IllegalArgumentException: The index() is not defined in action
class com.opensymphony.xwork2.ActionSupport

org.apache.struts2.rest.RestActionInvocation.invokeAction(RestActionInvocation.java:105)

com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)

com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)

com.opensymphony.xwork2.DefaultActionProxy.execute(DefaultActionProxy.java:130)

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)

org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)




Dave Newton-6 wrote:
 
 I got caught out by thinking the packages were created in a different
 package than I assumed they were, but I don't recall if it was my fault or
 if there was a configuration parameter I had forgotten to set or what.
 
 But just in case it helps, I'll throw it out there.
 
 Man, I've forgotten a lot of stuff--I really need to de-rust myself :(
 
 Dave
 
 On Wed, Dec 1, 2010 at 4:15 PM, stanl...@gmail.com wrote:
 
 I had a guy ask me why his internationalized properties were not
 accessible
 in his Struts app that was using both the REST and Convention plug-ins. 
 My
 first action was to read the docs which did not suggest anything out of
 the
 ordinary, so I through a core app together using this configuration and
 sure
 enough the properties were not found!

 He is using

constant name=struts.convention.action.suffix value=Controller/

 So I figured an Action called FooController would find
 FooController.properties in the same folder as the FooController.class,
 which as it turns out did *not* work.  I set a breakpoint at the top of
 LocalizedTextUtil and the localist contains only the following two files
 [org/apache/struts2/struts-messages,
 com/opensymphony/xwork2/xwork-messages].  Shouldn't this collection
 include
 my FooController.properties on a request http://.../foo?  Including a
 message key from struts-messages works fine, however a key from
 FooController.properties returns the key itself as it is not being
 located.

public static String findDefaultText(String aTextName, Locale locale)
 {
ListString localList = DEFAULT_RESOURCE_BUNDLES;

for (String bundleName : localList) {
ResourceBundle bundle = findResourceBundle(bundleName,
 locale);
if (bundle != null) {
reloadBundles();
try {
return bundle.getString(aTextName);
} catch (MissingResourceException e) {
// ignore and try others
}
}
}

return null;
}

 
 

-- 
View this message in context: 
http://old.nabble.com/Internationalization-with-REST-Convention-plug-ins-tp30353436p30353656.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Incorporating action interceptor configuration parameters into a message

2010-11-30 Thread stanlick
Before I wrap myself around my own axle, does anyone know a straightforward
technique for substituting the maximumSize into a message property text
according to the following scenario.

action name=singleUpload class=FileUploadAction
method=upload
interceptor-ref name=fileUpload
param name=maximumSize100123/param
param name=allowedTypes
image/png,image/x-png
/param
/interceptor-ref
interceptor-ref name=basicStack /
result name=input/jsp/SingleUpload.jsp/result
result/jsp/Confirm.jsp/result
/action

struts.messages.error.file.too.large=File {1} is {3} bytes which exceeds the
maximum DD

I see the value 100123 in the FileUploadInterceptor inside the
ActionInvocation, but before I write stupid code, I'd like to see if there
might be a straightforward approach.

Peace,
Scott


Re: Spring context for package

2010-11-24 Thread stanlick
Josep --

That sounds a little radical.  Do you mind if I ask why?  Is the unique
namespace per package not enough separation?  Hey, if strict separation is
what you desire, you could package each S2 package in it's own project and
move the package namespace to the web root context and be done with it.  Is
your multi-package web application really multiple web applications?

Peace,
Scott

2010/11/24 Josep María Formentí Serra jmforme...@aia.es

 Scott, it's interesting, I didn't know that, but i would like to have
 different application context in the same war, specifically, i would like
 to
 have an application context for each package that is defined in struts.xml.

 Thanks,
 Josep Maria


 2010/11/17 stanl...@gmail.com

  Josep  --
 
  I believe this is what you are looking for.
 
 
 
 http://blog.springsource.com/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/
 
  Peace,
  Scott
 
  2010/11/17 Josep María Formentí Serra jmforme...@aia.es
 
   Thanks Dave and Chris,
  
   Chris, that it's nice, we are going to modify it in our project. But
 our
   real problem is that we have two independent modules (and struts
 package
   for
   each one) and many spring beans have the same name. Then we have to
  change
   bean names when we detect a conflict. I think it will be better have a
   separated spring context for module (or struts package).
  
   I think that one solution is use an struts interceptor to get the
 spring
   beans (something like
   com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor)
  but
   my knowledge about that it's very poor.
  
   Josep Maria
  
   2010/11/12 Chris Pratt thechrispr...@gmail.com
  
If you are talking about per Java package, not that I know of.  If
 you
   mean
per Struts package, same thing.  But if you mean per jar file, there
 is
  a
way.  If you set your contextConfigLocation to something like
WEB-INF/applicationContext.xml,classpath*:pluginContext.xml then
  Spring
will load your Application wide context from the WEB-INF directory
 (or
   you
can make that WEB-INF/classes if you want), then it will load each
pluginContext.xml file it finds on the CLASSPATH.  Since the root
   directory
of each jar file in the WEB-INF/lib directory is considered to be on
  the
CLASSPATH, it will automatically include those beans, kind of like
 the
start
of a Plug-In architecture.  You can so a similar thing with the
struts-plugin.xml support built into Struts 2 to make a pretty robust
Plug-in system in your application.
  (*Chris*)
   
2010/11/12 Josep María Formentí Serra jmforme...@aia.es
   
 Hi,

 We are working in a new project using struts2 + spring + hibernate.
  We
have
 many packages defined in struts.xml, one for module. We have
  configured
 spring using this guide:
 http://struts.apache.org/2.0.14/docs/spring-plugin.html, where you
define
 one spring context (using the context param:
 contextConfigLocation).
  Is
it
 possible to define a different spring context for each struts
  package?

 Thanks in advance,
  Josep Maria

 --
 ---
  --
   -
-
 -
 Grupo AIA - http://www.aia.es
 Josep Mª Formentí Serra
 jmforme...@aia.ptv.es
 Telf.: +34 93 504 49 00 Fax.: +34 93 580 21 88
 ---
  --
   -
-
 -

 _
 ___
   __
_
 _
 _ _

 The information transmitted is intended only for the person or
 entity
   to
 which it is addressed and may contain confidential and/or
 privileged
 material. Any review, retransmission, dissemination or other use
 of,
  or
 taking of any action in reliance upon, this information by persons
 or
 entities other than the intended recipient is prohibited. If you
   received
 this in error, please contact the sender and delete the material
 from
   any
 computer.

   
  
  
  
   --
   --- --
 -
  -
   -
   Grupo AIA - http://www.aia.es
   Josep Mª Formentí Serra
   jmforme...@aia.ptv.es
   Telf.: +34 93 504 49 00 Fax.: +34 93 580 21 88
   --- --
 -
  -
   -
  
   _ ___
 __
  _
   _
   _ _
  
   The information transmitted is intended only for the person or entity
 to
   which it is addressed and may contain confidential and/or privileged
   material. Any review, retransmission, dissemination or other use of, or
   taking of any action in reliance upon, this information by persons or
   entities other than the intended recipient is prohibited. If you
 received
   this in error, please contact the sender and 

Re: Interceptor Stack config

2010-11-18 Thread stanlick
You certainly have accomplished that with

default-interceptor-ref name=paramsPrepareParamsStack/

however, Li is right; you did not need to redefine that stack, as it's in
the default xml file in struts-core.  Now then, you will only see this stack
associated with actions in *this* package or it's sub-pacakges and I don't
see any actions defined therein.  You are likely browsing actions defined in
the config-browser itself.

Peace,
Scott

On Thu, Nov 18, 2010 at 6:32 AM, RogerV roger.var...@googlemail.com wrote:




 Li Ying wrote:
 
  Why you define paramsPrepareParamsStack again?
 
  I believe it is already defined in the default configuration file,
 
  you can just use it.
 

 That's what I think I'm trying  to do with the struts.xml ;

 struts


constant name=struts.enable.DynamicMethodInvocation value=true /
constant name=struts.devMode value=true /
constant name=struts.objectFactory
 value=org.apache.struts2.spring.StrutsSpringObjectFactory /

package name=default namespace=/ extends=struts-default
interceptors
interceptor-stack name=paramsPrepareParamsStack
interceptor-ref name=exception/
interceptor-ref name=alias/
interceptor-ref name=i18n/
interceptor-ref name=checkbox/
interceptor-ref name=multiselect/
interceptor-ref name=params
dojo\..*,^struts\..*
/interceptor-ref
interceptor-ref name=servletConfig/
interceptor-ref name=prepare/
interceptor-ref name=chain/
interceptor-ref name=modelDriven/
interceptor-ref name=fileUpload/
interceptor-ref name=staticParams/
interceptor-ref name=actionMappingParams/
interceptor-ref name=params
dojo\..*,^struts\..*
/interceptor-ref
interceptor-ref name=conversionError/
interceptor-ref name=validation
input,back,cancel,browse
/interceptor-ref
interceptor-ref name=workflow
input,back,cancel,browse
/interceptor-ref
/interceptor-stack
  /interceptors
default-interceptor-ref name=paramsPrepareParamsStack/

/package


 /struts



 --
 View this message in context:
 http://old.nabble.com/Interceptor-Stack-config-tp30239747p30247343.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Jasper Relevancy

2010-11-18 Thread stanlick
So that's why nothing is really happening in my JSP?  Can you tell us more
about this back-end deal? :)

On Thu, Nov 18, 2010 at 6:41 AM, Dave Newton davelnew...@gmail.com wrote:

 How is using S2 more work than JSP? You can't just use JSP, you still
 need
 a back end.

 And JR does things like pagination: try printing out a nicely-paginated
 report using JSP.

 Dave

 On Thu, Nov 18, 2010 at 7:37 AM, Frans Thamura fr...@meruvian.org wrote:

  Ya we want to make pdf as output
 
  But feel using struts2 more work than jsp
 
  May be anyone have a better solution
 
  /m/
  --
  *From: * Dave Newton davelnew...@gmail.com
  *Date: *Thu, 18 Nov 2010 07:38:42 -0500
  *To: *Struts Users Mailing Listuser@struts.apache.org; 
  fr...@meruvian.org
  *Subject: *Re: Jasper Relevancy
 
  People use JasperReports when they want reports.
 
  On Thu, Nov 18, 2010 at 7:25 AM, Frans Thamura fr...@meruvian.org
 wrote:
 
  If?
 
  Don't get it
 
  Can share?
 
 
  /m/
 
  -Original Message-
  From: Dave Newton davelnew...@gmail.com
  Date: Thu, 18 Nov 2010 07:00:57
  To: Struts Users Mailing Listuser@struts.apache.org
  Reply-To: Struts Users Mailing List user@struts.apache.org
  Subject: Re: Jasper Relevancy
 
  If you want reports?
 
  On Thursday, November 18, 2010, Frans Thamura fr...@meruvian.org
 wrote:
   hi all
  
   what is the benefit using Jasper with S2, if we can run using JSP and
  run
   well
  
   i see that we must use List and throw to Jasper with S2, is there a
  better
   alternatif
  
   F
  
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 



Re: Spring context for package

2010-11-17 Thread stanlick
Josep  --

I believe this is what you are looking for.

http://blog.springsource.com/2007/06/11/using-a-shared-parent-application-context-in-a-multi-war-spring-application/

Peace,
Scott

2010/11/17 Josep María Formentí Serra jmforme...@aia.es

 Thanks Dave and Chris,

 Chris, that it's nice, we are going to modify it in our project. But our
 real problem is that we have two independent modules (and struts package
 for
 each one) and many spring beans have the same name. Then we have to change
 bean names when we detect a conflict. I think it will be better have a
 separated spring context for module (or struts package).

 I think that one solution is use an struts interceptor to get the spring
 beans (something like
 com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor) but
 my knowledge about that it's very poor.

 Josep Maria

 2010/11/12 Chris Pratt thechrispr...@gmail.com

  If you are talking about per Java package, not that I know of.  If you
 mean
  per Struts package, same thing.  But if you mean per jar file, there is a
  way.  If you set your contextConfigLocation to something like
  WEB-INF/applicationContext.xml,classpath*:pluginContext.xml then Spring
  will load your Application wide context from the WEB-INF directory (or
 you
  can make that WEB-INF/classes if you want), then it will load each
  pluginContext.xml file it finds on the CLASSPATH.  Since the root
 directory
  of each jar file in the WEB-INF/lib directory is considered to be on the
  CLASSPATH, it will automatically include those beans, kind of like the
  start
  of a Plug-In architecture.  You can so a similar thing with the
  struts-plugin.xml support built into Struts 2 to make a pretty robust
  Plug-in system in your application.
(*Chris*)
 
  2010/11/12 Josep María Formentí Serra jmforme...@aia.es
 
   Hi,
  
   We are working in a new project using struts2 + spring + hibernate. We
  have
   many packages defined in struts.xml, one for module. We have configured
   spring using this guide:
   http://struts.apache.org/2.0.14/docs/spring-plugin.html, where you
  define
   one spring context (using the context param: contextConfigLocation). Is
  it
   possible to define a different spring context for each struts package?
  
   Thanks in advance,
Josep Maria
  
   --
   --- --
 -
  -
   -
   Grupo AIA - http://www.aia.es
   Josep Mª Formentí Serra
   jmforme...@aia.ptv.es
   Telf.: +34 93 504 49 00 Fax.: +34 93 580 21 88
   --- --
 -
  -
   -
  
   _ ___
 __
  _
   _
   _ _
  
   The information transmitted is intended only for the person or entity
 to
   which it is addressed and may contain confidential and/or privileged
   material. Any review, retransmission, dissemination or other use of, or
   taking of any action in reliance upon, this information by persons or
   entities other than the intended recipient is prohibited. If you
 received
   this in error, please contact the sender and delete the material from
 any
   computer.
  
 



 --
 --- -- - -
 -
 Grupo AIA - http://www.aia.es
 Josep Mª Formentí Serra
 jmforme...@aia.ptv.es
 Telf.: +34 93 504 49 00 Fax.: +34 93 580 21 88
 --- -- - -
 -

 _ ___ __ _
 _
 _ _

 The information transmitted is intended only for the person or entity to
 which it is addressed and may contain confidential and/or privileged
 material. Any review, retransmission, dissemination or other use of, or
 taking of any action in reliance upon, this information by persons or
 entities other than the intended recipient is prohibited. If you received
 this in error, please contact the sender and delete the material from any
 computer.



Re: Label problem in struts2

2010-11-16 Thread stanlick
Can we see the rest of your JSP?  My hunch is, you are also using a
textfield that is bringing the label in as well.


On Tue, Nov 16, 2010 at 6:32 AM, Prabhubalaji Ragavan 
prabhubalaji.raga...@gmail.com wrote:

 Hi
 I am using the below code to label, which is using a resource bundle. When
 the application starts up, the label appears twice.

 JSP code
 ---
 s:label key=Label.Name /


 Resource bundle
 -
 Label.Name = Legal Name

 Output
 ---

 Legal Name Legal Name


 Please help

 Thanks
 Prabhu Ragavan



rest, convention and config plug-ins

2010-10-24 Thread stanlick

I fired up a new 2.2.1 project this morning to see what's new and have a
quick question.  Does the config-browser work out of the box with rest and
convention plug-ins?  Everything works fine except this url:

http://localhost:8080/rest/config-browser/index.action

which is producing the glorious 404


-- 
View this message in context: 
http://old.nabble.com/rest%2C-convention-and-config-plug-ins-tp30041350p30041350.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Additional JSP to render via AJAX

2010-05-26 Thread stanlick
This http://struts2inaction.com/SimpleAjax.html should be a much simpler
technique for you.

Peace,
Scott

On Tue, May 25, 2010 at 11:34 AM, Oscar oscar.kalde...@gmail.com wrote:

 Hi to all, have a good day, i have a doubt about Struts 2.1.8 and AJAX
 with dojo, using dojo struts tags. My doubt is the next: Suppose that
 i have a combobox and when i select something in the combobox i want
 to refresh another combobox using selected value of first combo, via
 ajax. Then i reference to use struts dojo tags with this:

 %@ taglib prefix=sx uri=/struts-dojo-tags%

 And declare this on header (i dont't know very well why i do that but
 is neccesary)

 sx:head cache=true /

 after register a function in the controller:

 var controller = {
refresh : function() {}
};
dojo.event.topic.registerPublisher(/refresh, controller,
 refresh);

 In my form i declare s:url containing the url that will be called via ajax:

 s:url var=urlUpdUniMedida id=urlUpdUniMedida
 value=transTiendasEnvio!updUnisMedidaPrdAjax.action  /

 And put a div whose content will refresh with ajax:

 sx:div id=divLstUniMedida  autoStart=false href=%{urlUpdUniMedida}
 preload=false
listenTopics=/refresh
 formId=transTiendaEnvioDetForm 
s:select name=coduni id=coduni
  list=#request.lstUniMedida
  listKey=coduni.coduni
  listValue=coduni.nombre
 cssStyle=width:320px; /
/sx:div

 And finally, i have to do a second jsp containing the same that
 contains the div in my first jsp with some code more to set things
 like cache :

 %@ taglib prefix=s uri=/struts-tags %
 %
request.setAttribute(decorator, none);
response.setHeader(Cache-Control,no-cache); //HTTP 1.1
response.setHeader(Pragma,no-cache); //HTTP 1.0
response.setDateHeader (Expires, 0); //prevents caching at the
 proxy server
 %
 s:select name=coduni id=coduni
  list=#request.lstUniMedida
  listKey=coduni.coduni
  listValue=coduni.nombre cssStyle=width:320px; /

 My question is: Isn't possible to avoid to do a second jsp? Can't i
 just use the content of sx:div to rerender when i refresh it via ajax
 instead render it using a second jsp?

 Thanks in advance.
 --
 Oscar Calderón
 SCJP 6
 http://www.javahowto.net/

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: access map's value in object stack

2010-05-12 Thread stanlick
Maps expose an Entry element containing properties key and value.

s:iterator value=map varrow
s:property/   // that work well
s:textfield value=row.value.color/ // this would call getColor() on
the value object associated with key
s/iterator 


Peace,
Scott


On Wed, May 12, 2010 at 3:55 AM, yunaki yun...@126.com wrote:


 i have a Map in object stack, struts can use s:property tag to access
 each
 member, but how can I access map's value to set it to a tag's value.


 s:iterator value=map
 s:property/   // that work well
 s:textfield value=???/ //set map's value to textfield
 s/iterator 

 Many thank
 --
 View this message in context:
 http://old.nabble.com/access-map%27s-value-in-object-stack-tp28533475p28533475.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




select ui control option iterator

2010-04-14 Thread stanlick

Before I go mucking around with the select.ftl, is there a simpler way to get
a unique id generated for each option written?  The select tag does not
appear to support tagging its options with an identifier.

Peace,
Scott
-- 
View this message in context: 
http://old.nabble.com/select-ui-control-option-iterator-tp28247121p28247121.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: World¹s Simplest Struts/2 Ajax Pattern

2010-04-07 Thread stanlick

Hey Z -- 

I hear what your saying brother, but big shops have such tight constraints
about what you can download and use that this was a real s t r e t c h for
the last shop I was in!  We were happy to Struts/2 approved!  I like your
strategy too.

P.S. I'm a drummer and Z reminds me of Zildjian! :drunk:

Peace,
Scott


Sparecreative wrote:
 
 While I appreciate what you¹re saying, we¹ve found that by moving to one
 of
 the javascript libraries (we use jQuery, but they all offer pretty much
 the
 same range and depth) for all our ajax work, the task has been simplified
 immensely.
 
 Also, by moving away from the S2 ajax tags, we¹ve found that it has been
 easier to manage features and libraries.
 
 I guess what I¹m saying is that sometimes it¹s worth stepping back to see
 if
 we¹re just not reinventing the wheel. I make no secret of the fact that I
 find the S2 built in ajax support to be a wasted effort.
 
 Z.
 
 
 After answering similar questions regarding Struts/2 and Ajax on several
 forums, I have decided to write an actual paper on the topic.  While I
 figure out where to publish papers I am dropping the link here.
 
 http://struts2inaction.com/SimpleAjax.html World¹s Simplest Struts/2 Ajax
 Pattern 
 
 Peace,
 Scott
 
 
 

-- 
View this message in context: 
http://old.nabble.com/World%E2%80%99s-Simplest-Struts-2-Ajax-Pattern-tp28157121p28164320.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



World’s Simplest Struts/2 Ajax Pattern

2010-04-06 Thread stanlick

After answering similar questions regarding Struts/2 and Ajax on several
forums, I have decided to write an actual paper on the topic.  While I
figure out where to publish papers I am dropping the link here.

http://struts2inaction.com/SimpleAjax.html World’s Simplest Struts/2 Ajax
Pattern 

Peace,
Scott
-- 
View this message in context: 
http://old.nabble.com/World%E2%80%99s-Simplest-Struts-2-Ajax-Pattern-tp28157121p28157121.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: retrieve i18n application messages.

2010-03-24 Thread stanlick
S2 doesn't do anything special.  It leverages the native Java resource
bundles and locale.  I would advise you to begin by looking at the Locale
class.


On Wed, Mar 24, 2010 at 4:01 AM, Stephen Ince stephenpi...@gmail.comwrote:

 Does anyone know how to programmatically retrieve the i18n messages outside
 the context of an action class.
 I know with the action you can call getText.
 I need similiar functionality. I have access to the http request headers. I
 assume I need the accept language request header.

 e.g.
 String acceptLanguageHdr = english;
 String msg = my.value;
 // api call to get the correct i18n message similiar to getText.
 getText(msg);


 Any help would be appreciated.

 Steve


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Can we some how persist form values in Struts2 the way we do in struts1.x

2010-03-16 Thread stanlick
Hi Sandeep --

One clean way you can do this is by using the
ScopedModelDrivenInterceptorhttp://struts.apache.org/2.x/docs/scoped-model-driven-interceptor.html
.

Peace,
Scott

On Tue, Mar 16, 2010 at 4:22 PM, sandeep kotha sandeep4u.ko...@gmail.comwrote:

 Hi All,

 We are migrating our application from Struts1.x to Struts2. Let me say we
 have some 5 pages on each page user enters different data on 5th page we
 have submit button. Clicking on submit button we insert data entered in all
 5 pages to DB.

 User can navigate to previous pages to change data he entered while user
 navigating to previous pages we need to populate the data user had entered.

 In Struts1.x we are storing all the data in a form. In struts2 when we
 navigate to previous pages we are loosing the entered data.

 We welcome any suggestions to fix this issue.

 Thanks
 Sandeep.Kotha



Re: Cannot find bean: bookList in any scope

2010-03-08 Thread stanlick
You have bookList and listBook.  Change one of them.

On Sun, Mar 7, 2010 at 8:25 PM, tesla fatihdu...@hotmail.com wrote:


 Hi i'm new at struts.I wanna write all the array elements which i defined
 at
 java class to the jsp file
 but i'm getting this error
 javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot
 find
 bean: bookList in any scope
 Here is my code
 Thx for helping

 Book.JAVA

 public class Book {

private String name;
private int price;
//private List books=new ArrayList();

Connection con ;
Statement ps;
ResultSet rs;

public ArrayList listBook() throws SQLException
{
   ArrayList books=new ArrayList();
try
{
   Class.forName(com.mysql.jdbc.Driver);
con =

 DriverManager.getConnection(jdbc:mysql://localhost:3306/logintest_development,root,pass);
ps = con.createStatement();
rs = ps.executeQuery(SELECT * FROM books);
while(rs.next()){
books.add(new perInfoBook(rs.getString(title)));
}

}
catch (Exception e)
{
  System.out.println(Error Data :  + e.getMessage());
}
con.close();
return  books;
}



 public class perInfoBook
 {
String title;
   int bookid;

public perInfoBook(String title) {
this.title = title;

}

 public String getTitle() {
 return title;
 }
 public int getBookid() {return bookid;}

 }
 }


 BookForm.JAVA

 public class BookForm extends ActionForm{

   private List bookList;

 public void reset(ActionMapping mapping,HttpServletRequest request){
   bookList=new ArrayList();
 }

 BookAction.Java

 public class BookAction extends Action{

 public ActionForward execute(ActionMapping mapping, ActionForm form,
 HttpServletRequest request,  HttpServletResponse response) throws
 Exception {

 BookForm bookForm = (BookForm) form;
 Book book = new Book();
 bookForm.setBookList(book.listBook());
 return mapping.findForward(success);

 }
 }

 and here is my jsp code

 body
  logic:iterate id=Table name=bookList 
  tr
tdbean:write name=Table property=title//td
  /tr
  /logic:iterate
 /body



 --
 View this message in context:
 http://old.nabble.com/Cannot-find-bean%3A-%22bookList%22-in-any-scope-tp27816517p27816517.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: struts 2 - framework question

2010-03-08 Thread stanlick
If each company will have their own domain name this will solve itself.

On Sat, Mar 6, 2010 at 10:18 PM, john lee sh_thorn_b...@yahoo.com wrote:


 my company is distributor, we plan to provide platform for our
 customer(different store) to sell their product to indivual customers.

 http://www.xyz.om/store1
 http://www.xyz.com/store2
 http://www.xyz.com/store3
 ...
 http://www.xyz.com/storeN

 (store1...storeN) list our(distributor)'s product to their customer, when
 customer see the display price, the display price=our price(base
 price)+storeX's margin

 my question is the following

 a. in the struts.xml, different store should have different package
 defination ?

 b. in the application, what is the struts2's method to detect which store?
 in other words, how can i detect which link(http://www.xyz.om/store1 or
 store2 or store3) is pass in ? without knowing which store is called, i can
 not call special routine(could be price cal, ...) associated with that
 store.

 any good idea to approach this?

 tks in advance

 john





Re: Essential Dependencies Only

2009-12-16 Thread stanlick
:44 AM, Wes Wannemacher w...@wantii.com
 wrote:
 
  Scott, take a look at the mailreader and blank apps. You can also
 read
  through the struts2-core pom (annotated and easier to read here -
 
 
 http://jarvana.com/jarvana/inspect-pom/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.pom
  ,
  that points to 2.1.8, they haven't indexed 2.1.8.1 yet, but there is
  no differences in dependencies).
 
  If you just want to cut to the chase, the essentials would be -
 
  struts2-core 2.1.8.1
  xwork-core 2.1.6
  freemarker 2.3.15
  ognl 2.7.3
 
  -Wes
 
  On Mon, Dec 14, 2009 at 10:36 AM, stanlick stanl...@gmail.com
 wrote:
  
   Greetings and Happy Holidays --
  
   I am sitting down to unwind the Essential Dependencies Only jar
   (struts-2.1.8.1-lib.zip) in preparation for the litany of questions
 the
   lawyers are going to ask before accepting the Struts 2.1.8.1
 upgrade
 in
   house.  Now either I have a different understanding of the word
  essential,
   or this version of our new Struts has really spread her arms.
  There
 are
   seventy-one jars in the lib folder of the *essential dependencies
 only
  jar*
   and a quick glance suggests they are *not* all essential.  So does
  essential
   != core or required?  Is there a resource where an analysis can be
 made
  to
   determine compile, testing, run-time dependencies?  Untangling this
 ball
  of
   yarn by hand is going to burn up hours and lead an analyst down
 many
  rabbit
   holes.  Is there a POM that could save the man hours?
  
   Peace,
   Scott
   --
   View this message in context:
 
 http://old.nabble.com/Essential-Dependencies-Only-tp26779724p26779724.html
   Sent from the Struts - User mailing list archive at Nabble.com.
  
  
  
 -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
 
 
 
  --
  Wes Wannemacher
 
  Head Engineer, WanTii, Inc.
  Need Training? Struts, Spring, Maven, Tomcat...
  Ask me for a quote!
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org



 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Essential-Dependencies-Only-tp26779724p26813901.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Essential Dependencies Only

2009-12-15 Thread stanlick
Thanks Wes --

Have you or others discovered any software that could be used to decompose
an open source product into its constituent parts and then further decompose
each of those in turn.  Looking at a single POM rarely answers the real
questions.  The dependency/version graph is wicked to deal with by hand and
the licenses therein complicate matters even further.  I struggle when
thinking how many shops are each doing this over-and-over with each new
version release and it seems like a missing piece of the FOSS/legal puzzle.

Peace,
Scott


On Mon, Dec 14, 2009 at 10:44 AM, Wes Wannemacher w...@wantii.com wrote:

 Scott, take a look at the mailreader and blank apps. You can also read
 through the struts2-core pom (annotated and easier to read here -

 http://jarvana.com/jarvana/inspect-pom/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.pom
 ,
 that points to 2.1.8, they haven't indexed 2.1.8.1 yet, but there is
 no differences in dependencies).

 If you just want to cut to the chase, the essentials would be -

 struts2-core 2.1.8.1
 xwork-core 2.1.6
 freemarker 2.3.15
 ognl 2.7.3

 -Wes

 On Mon, Dec 14, 2009 at 10:36 AM, stanlick stanl...@gmail.com wrote:
 
  Greetings and Happy Holidays --
 
  I am sitting down to unwind the Essential Dependencies Only jar
  (struts-2.1.8.1-lib.zip) in preparation for the litany of questions the
  lawyers are going to ask before accepting the Struts 2.1.8.1 upgrade in
  house.  Now either I have a different understanding of the word
 essential,
  or this version of our new Struts has really spread her arms.  There are
  seventy-one jars in the lib folder of the *essential dependencies only
 jar*
  and a quick glance suggests they are *not* all essential.  So does
 essential
  != core or required?  Is there a resource where an analysis can be made
 to
  determine compile, testing, run-time dependencies?  Untangling this ball
 of
  yarn by hand is going to burn up hours and lead an analyst down many
 rabbit
  holes.  Is there a POM that could save the man hours?
 
  Peace,
  Scott
  --
  View this message in context:
 http://old.nabble.com/Essential-Dependencies-Only-tp26779724p26779724.html
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Wes Wannemacher

 Head Engineer, WanTii, Inc.
 Need Training? Struts, Spring, Maven, Tomcat...
 Ask me for a quote!

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Essential Dependencies Only

2009-12-15 Thread stanlick
Thanks brother.  Actually it's not our projects we analyze; it's the open
source projects.  We *do not* simply download/dump the OS project and begin
to use it.  We factor each project into as many constituent OS projects as
it made from and then recursively walk down the tree doing this at each
node.  It is a big PITA!

On Tue, Dec 15, 2009 at 12:03 PM, Musachy Barroso musa...@gmail.com wrote:

 mvn dependency:tree will give you all the dependencies nicely. I also
 have to help with this task in my company, and we haven't found any
 decent tool that does what you described. If all your projects use
 maven, then there is probably a plugin for that, but that's not the
 case for us.

 On Tue, Dec 15, 2009 at 9:58 AM,  stanl...@gmail.com wrote:
  Thanks Wes --
 
  Have you or others discovered any software that could be used to
 decompose
  an open source product into its constituent parts and then further
 decompose
  each of those in turn.  Looking at a single POM rarely answers the real
  questions.  The dependency/version graph is wicked to deal with by hand
 and
  the licenses therein complicate matters even further.  I struggle when
  thinking how many shops are each doing this over-and-over with each new
  version release and it seems like a missing piece of the FOSS/legal
 puzzle.
 
  Peace,
  Scott
 
 
  On Mon, Dec 14, 2009 at 10:44 AM, Wes Wannemacher w...@wantii.com
 wrote:
 
  Scott, take a look at the mailreader and blank apps. You can also read
  through the struts2-core pom (annotated and easier to read here -
 
 
 http://jarvana.com/jarvana/inspect-pom/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.pom
  ,
  that points to 2.1.8, they haven't indexed 2.1.8.1 yet, but there is
  no differences in dependencies).
 
  If you just want to cut to the chase, the essentials would be -
 
  struts2-core 2.1.8.1
  xwork-core 2.1.6
  freemarker 2.3.15
  ognl 2.7.3
 
  -Wes
 
  On Mon, Dec 14, 2009 at 10:36 AM, stanlick stanl...@gmail.com wrote:
  
   Greetings and Happy Holidays --
  
   I am sitting down to unwind the Essential Dependencies Only jar
   (struts-2.1.8.1-lib.zip) in preparation for the litany of questions
 the
   lawyers are going to ask before accepting the Struts 2.1.8.1 upgrade
 in
   house.  Now either I have a different understanding of the word
  essential,
   or this version of our new Struts has really spread her arms.  There
 are
   seventy-one jars in the lib folder of the *essential dependencies only
  jar*
   and a quick glance suggests they are *not* all essential.  So does
  essential
   != core or required?  Is there a resource where an analysis can be
 made
  to
   determine compile, testing, run-time dependencies?  Untangling this
 ball
  of
   yarn by hand is going to burn up hours and lead an analyst down many
  rabbit
   holes.  Is there a POM that could save the man hours?
  
   Peace,
   Scott
   --
   View this message in context:
 
 http://old.nabble.com/Essential-Dependencies-Only-tp26779724p26779724.html
   Sent from the Struts - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
 
 
 
  --
  Wes Wannemacher
 
  Head Engineer, WanTii, Inc.
  Need Training? Struts, Spring, Maven, Tomcat...
  Ask me for a quote!
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Essential Dependencies Only

2009-12-14 Thread stanlick

Greetings and Happy Holidays -- 

I am sitting down to unwind the Essential Dependencies Only jar
(struts-2.1.8.1-lib.zip) in preparation for the litany of questions the
lawyers are going to ask before accepting the Struts 2.1.8.1 upgrade in
house.  Now either I have a different understanding of the word essential,
or this version of our new Struts has really spread her arms.  There are
seventy-one jars in the lib folder of the *essential dependencies only jar*
and a quick glance suggests they are *not* all essential.  So does essential
!= core or required?  Is there a resource where an analysis can be made to
determine compile, testing, run-time dependencies?  Untangling this ball of
yarn by hand is going to burn up hours and lead an analyst down many rabbit
holes.  Is there a POM that could save the man hours?

Peace,
Scott
-- 
View this message in context: 
http://old.nabble.com/Essential-Dependencies-Only-tp26779724p26779724.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: struts2 web app without jsp pages, is it possible?

2009-12-08 Thread stanlick
The same argument could be made by generating your web pages in Java code!
The MVC has been around for probably as long as you have been alive.  JSP
developers as you put it, should be coding presentation and *not* disk
access!  Code reviews, and/or source code inspections would identify a rogue
developer doing stupid things in a web page.

Peace,
Scott

On Tue, Dec 8, 2009 at 8:21 AM, Shital Patil shitalpati...@yahoo.comwrote:

 Dear All,

 Thanks for your valuable suggestions.
 Actually I am failed to convince my PM for using JSP pages in web app.
 He said, there are some serious problems with JSP.
 e.g JSP = presentation + code.
 A JSP developer can easily read some imp file on disk say, /etc/passwd, and
 throw it to the client. How to avoid this problem?


 Regards,
 Shital

 --- On Tue, 8/12/09, Halil Ağın halil.a...@gmail.com wrote:

 From: Halil Ağın halil.a...@gmail.com
 Subject: Re: struts2 web app without jsp pages, is it possible?
 To: Struts Users Mailing List user@struts.apache.org
 Date: Tuesday, 8 December, 2009, 12:56 PM

 html+freemarker+json

 On Tue, Dec 8, 2009 at 2:12 PM, Saeed Iqbal saee...@gmail.com wrote:

  You can easily have html extension for your web page and use sitemesh for
  templating
 
  On Tue, Dec 8, 2009 at 5:08 PM, Shital Patil shitalpati...@yahoo.com
  wrote:
 
Dear All,
  
   I want to develop web application in struts2 framework but without jsp
   pages.
   We are going to use HTML template engine for view.
   Is it possible to develop web application in struts2 without jsp pages?
   Is this a good idea?
  
  
   Regards,
   Shital
  
  
The INTERNET now has a personality. YOURS! See your Yahoo!
 Homepage.
   http://in.yahoo.com/
 
 
 
 
  --
  Saeed Iqbal
  Independant Consultant
  J2EE - Application Architect / Developer
 



  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
 http://in.yahoo.com/



Re: Anyone using the Ajaxtags with Struts 2

2009-08-20 Thread stanlick

Thanks guys -- 

Actually, I needed a QD tree on a JSP page and it worked great.  The one
issue I am having though is this.  I am creating the tree by attaching
TreeItem nodes.  I am populating these nodes with attributes 


Goal goal = goals.next();
TreeItem item = new TreeItem(goal.getTitle(), 
goal.getTitle(),
false);
item.setAttributes(nodeType, goal);
item.setCollapsed(false);
treeBuilder.add(item);

but cannot figure out how to get them passed back to the server as
parameters.

ajax:htmlContent target=clicker sourceClass=nodeClass
baseUrl=${doGoalTree}
parameters=node={ajaxParameter},action=info/ajax:htmlContent

Any clues?

P.S. I was surprised to see that you had worked on this project Musachy. 
You just pop up everywhere!

Peace,
Scott


Musachy Barroso wrote:
 
 They should work ok, but I see no reason why you would like to use
 that instead of jquery or prototype directly, to be honest.
 
 musachy
 
 On Tue, Aug 18, 2009 at 10:21 AM, stanlickstanl...@gmail.com wrote:

 I am trying to leverage the http://ajaxtags.sourceforge.net/ AjaxTags and
 would like to see if anyone here might have tips before tearing in.  I
 realize this might not be the best venue for the question, but hey, It's
 Struts 2 sort of.

 Peace,
 Scott
 --
 View this message in context:
 http://www.nabble.com/Anyone-using-the-Ajaxtags-with-Struts-2-tp25029536p25029536.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Anyone-using-the-Ajaxtags-with-Struts-2-tp25029536p25063918.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Anyone using the Ajaxtags with Struts 2

2009-08-20 Thread stanlick

You rock bro!  So is there a way to get the TreeItem attributes passed back
to the server?  If not, I am confused as to why they would be set on the
node object.



Musachy Barroso wrote:
 
 On Thu, Aug 20, 2009 at 8:06 AM, stanlickstanl...@gmail.com wrote:
 P.S. I was surprised to see that you had worked on this project Musachy.
 You just pop up everywhere!
 
 I think I wrote that tree so I wouldn't trust it too much :)
 
 musachy
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Anyone-using-the-Ajaxtags-with-Struts-2-tp25029536p25066974.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Anyone using the Ajaxtags with Struts 2

2009-08-18 Thread stanlick

I am trying to leverage the http://ajaxtags.sourceforge.net/ AjaxTags and
would like to see if anyone here might have tips before tearing in.  I
realize this might not be the best venue for the question, but hey, It's
Struts 2 sort of.

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/Anyone-using-the-Ajaxtags-with-Struts-2-tp25029536p25029536.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Who moved OgnlValueStack?

2009-07-21 Thread stanlick

I am experimenting with struts 2.1.7 and apparently xwork 2.1.4 has moved
OgnlValueStack from package com.opensymphony.xwork2.util to
com.opensymphony.xwork2.ognl!  Was this some cruel joke?

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/Who-moved-OgnlValueStack--tp24591681p24591681.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Who moved OgnlValueStack?

2009-07-21 Thread stanlick

Thanks Dale -- 

Now that might be the better question!  It appears we have not been
consistent in a few corporate plug-ins between using the VS or OVS, and
those places referencing OVS stopped working in 2.1.7 when xwork relocated
the OVS.

Peace,
Scott


DNewfield wrote:
 
 stanlick wrote:
 I am experimenting with struts 2.1.7 and apparently xwork 2.1.4 has moved
 OgnlValueStack from package com.opensymphony.xwork2.util to
 com.opensymphony.xwork2.ognl!  Was this some cruel joke?
 
 Why do you need to reference OgnlValueStack?  The more generic 
 ValueStack is in com.opensymphony.xwork2.util
 
 -Dale
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Who-moved-OgnlValueStack--tp24591681p24593395.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Plug-in creation and freemarker page location

2009-07-17 Thread stanlick

I am using the leading / and it still seems to be using the namespace!  I
renamed the ftl folder pages to be config to match the namespace, and it
works fine.  Is there another way?  I originally tried with and without the
leading slash and ultimately had to make this change to get it to work.  I
was a little puzzled by this.  Since it is a plug-in, I'd hate to require
additional configuration settings on the part of the developer.  It should
be plug-n-play man!

P.S. By the way... which one's Pink?

Peace,
Scott 



Musachy Barroso wrote:
 
 Well, actually I am wrong about that and yes, if there is no /, it
 will use the namespace name:
 
   if (!locationArg.startsWith(/)) {
 ActionContext ctx = invocation.getInvocationContext();
 HttpServletRequest req = (HttpServletRequest)
 ctx.get(ServletActionContext.HTTP_REQUEST);
 String base = ResourceUtil.getResourceBase(req);
 locationArg = base + / + locationArg;
 }
 
 musachy
 
 On Thu, Jul 16, 2009 at 3:36 PM, Musachy Barrosomusa...@gmail.com wrote:
 there is no magic there, remove the first / and give it a try.

 musachy

 On Thu, Jul 16, 2009 at 12:29 PM, stanlickstanl...@gmail.com wrote:

 I am working on a plug-in and having trouble getting the runtime to find
 my
 freemarker pages.  I have a folder named pages in my plugin.jar where my
 freemarker pages reside.  My struts-plugin.xml is referring to the pages
 as
 follows:

 result type=freemarker/pages/config.ftl/result

 However, I am receiving a runtime

 java.io.FileNotFoundException: Template /config/pages/config.ftl not
 found.
        at
 freemarker.template.Configuration.getTemplate(Configuration.java:489)

 I have studied the struts2-config-browser-plugin and I'm now starting to
 wonder if there is some magic with respect to the freemarker folder
 being
 called config-browser which happens to be the same namespace of the
 plugin.

 Does anyone know the mechanics of these names?

 Peace,
 Scott
 --
 View this message in context:
 http://www.nabble.com/Plug-in-creation-and-freemarker-page-location-tp24522925p24522925.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org





 --
 Hey you! Would you help me to carry the stone? Pink Floyd

 
 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Plug-in-creation-and-freemarker-page-location-tp24522925p24534468.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Plug-in creation and freemarker page location

2009-07-16 Thread stanlick

I am working on a plug-in and having trouble getting the runtime to find my
freemarker pages.  I have a folder named pages in my plugin.jar where my
freemarker pages reside.  My struts-plugin.xml is referring to the pages as
follows:

result type=freemarker/pages/config.ftl/result

However, I am receiving a runtime

java.io.FileNotFoundException: Template /config/pages/config.ftl not found.
at freemarker.template.Configuration.getTemplate(Configuration.java:489)

I have studied the struts2-config-browser-plugin and I'm now starting to
wonder if there is some magic with respect to the freemarker folder being
called config-browser which happens to be the same namespace of the plugin.

Does anyone know the mechanics of these names?

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/Plug-in-creation-and-freemarker-page-location-tp24522925p24522925.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: MethodFilterInterceptor package

2009-07-14 Thread stanlick
The logic considers the action name without regard to the package the action
is contained within.

On Mon, Jul 13, 2009 at 5:53 PM, Musachy Barroso musa...@gmail.com wrote:

  independent of the methods' package name

 I am not sure what you mean by this. example?

 musachy
 --
 Hey you! Would you help me to carry the stone? Pink Floyd

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




MethodFilterInterceptor package

2009-07-13 Thread stanlick

Either I have been asleep at the wheel or have simply lucked into a naming
scheme.  It appears the MethodFilterInterceptor is performing its
include/exclude logic independent of the methods' package name.  Has anyone
been snapped by this?  

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/MethodFilterInterceptor-%3Cpackage%3E-tp24465361p24465361.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts 2 Plug-in and JSP 404

2009-07-09 Thread stanlick

I am working on a plug-in that needs to display a JSP.  I have the plug-in
packaged with the following struts-plugin.xml, however, rather than the
/pages/config.jsp page appearing, I get a 404! The folder pages is in the
root of my config-plugin.jar file and I have changed the result by both
including and omitting the leading slash and I get a 404 either way.  My
action is returning SUCCESS as verified through the debugger.  Does anyone
see anything glaringly wrong?  

struts
package name=config namespace=/config extends=struts-default
action name=maintainConfig_*
class=com.erac.wsf.action.ConfigAction method={1}
result/pages/config.jsp/result
result name=error/pages/config.jsp/result
/action
/package
/struts

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/Struts-2-Plug-in-and-JSP-404-tp24415564p24415564.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 Plug-in and JSP 404

2009-07-09 Thread stanlick

Thanks Dale -- 

I hear what you are saying, and this seemed a little foreign to me too! 
However, for a plug-in to be a drop-n-go deal, I sort of think the goods
should all be in the plug-in jar itself?  Make sense?  I was looking at this
article, and it appears this cat has a JSP working in his plug-in?

http://www.struts2.org/category/struts2-plugins/
http://www.struts2.org/category/struts2-plugins/ 

The reason for this plug-in is to eliminate a couple pages of configuration
steps for the adopter of my application.  I'd rather not say just drop the
plug-in in your WEB-INF/lib folder and then copy JSP files here...

Peace,
Scott



DNewfield wrote:
 
 stanlick wrote:
 I am working on a plug-in that needs to display a JSP.
 
 The folder pages is in the root of my config-plugin.jar
 
 I believe jsp files must be in the file system, not in jars.
 
 -Dale
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Plug-in-and-JSP-404-tp24415564p24416650.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 Plug-in and JSP 404

2009-07-09 Thread stanlick

Thanks brother!  Do you know of a decent JSP --- Freemarker converter? I
sort of wondered why the config-browser plug in was using Freemarker.  It
really sucks when something like this rears it ugly head and brings
productivity to a screeching halt!

P.S. And I really thought I was going to have time this evening for that
Harley ride up the river road!

Peace,
Scott


DNewfield wrote:
 
 stanlick wrote:
 However, for a plug-in to be a drop-n-go deal, I sort of think the goods
 should all be in the plug-in jar itself?  Make sense?
 
 Agreed, but I believe I've been told that can't be done with jsp 
 templates.  This is why plugins that I've seen have been implemented in 
 freemarker.
 
 I was looking at this
 article, and it appears this cat has a JSP working in his plug-in?
 
 http://www.struts2.org/category/struts2-plugins/
 
 I downloaded that zip, and looked inside the .jars:  no .jsps.
 
 The reason for this plug-in is to eliminate a couple pages of
 configuration
 steps for the adopter of my application.  I'd rather not say just drop
 the
 plug-in in your WEB-INF/lib folder and then copy JSP files here...
 
 I'm simply reporting hear-say here, but I believe you've already hit the 
 roadblock that'll prevent you from getting farther w/o using a different 
 template engine.
 
 -Dale
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
:rules::rules:%-|%-|%-|
-- 
View this message in context: 
http://www.nabble.com/Struts-2-Plug-in-and-JSP-404-tp24415564p24417005.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 Plug-in and JSP 404

2009-07-09 Thread stanlick

Please tell me it isn't the little woman that has you talking all crazy bro!

P.S. You failed to mention the option about just writing the response with
print statements from the action!


Peace,
Scott


Musachy Barroso wrote:
 
 Or if you are very brave, and using java 6, you can use jasper to
 compile the jsp to java, then use the java api compile to compile to a
 class file, load it and then execute it, but yeah FreeMarker would be
 easier :)
 
 musachy
 
 On Thu, Jul 9, 2009 at 1:06 PM, Dale Newfieldd...@newfield.org wrote:
 stanlick wrote:

 However, for a plug-in to be a drop-n-go deal, I sort of think the goods
 should all be in the plug-in jar itself?  Make sense?

 Agreed, but I believe I've been told that can't be done with jsp
 templates.
  This is why plugins that I've seen have been implemented in freemarker.

 I was looking at this
 article, and it appears this cat has a JSP working in his plug-in?

 http://www.struts2.org/category/struts2-plugins/

 I downloaded that zip, and looked inside the .jars:  no .jsps.

 The reason for this plug-in is to eliminate a couple pages of
 configuration
 steps for the adopter of my application.  I'd rather not say just drop
 the
 plug-in in your WEB-INF/lib folder and then copy JSP files here...

 I'm simply reporting hear-say here, but I believe you've already hit the
 roadblock that'll prevent you from getting farther w/o using a different
 template engine.

 -Dale

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Plug-in-and-JSP-404-tp24415564p24417051.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Documenting Applications with Apache Struts 2

2009-06-19 Thread stanlick
Dave--

Does this mean your book is about to be unpakt?  If this chapter is
representative of the book, this will be a real gem!

Peace,
Scott


On Thu, Jun 18, 2009 at 11:04 PM, juded ju...@packtpub.com wrote:


 Every developer's favorite task is documenting their application. In this
 chapter, we will look at the many aspects of documentation, including
 self-documenting code, Javadocs, generators, methodologies, and so on,
 with a focus on automating as much documentation as possible.

 To read more, please visit
 http://www.packtpub.com/files/3391_15_SampleChapter.pdf

 --
 View this message in context:
 http://www.nabble.com/Documenting-Applications-with-Apache-Struts-2-tp24105183p24105183.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




BaseStrutsTestCase

2009-06-18 Thread stanlick
For those of you who are using
thishttp://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/base
class to unit test your Struts 2 apps, have you encountered this
requirement?

I have a web.xml listener placing an object in application scope using
servletContext.setAttribute(foo,engine) and an interceptor expecting to
locate it using actionInvocation.getStack().findValue(#attr.foo).

In my unit test which subclasses BaseStrutsTestCase I am putting the engine
in scope using proxy.getInvocation().getStack().set(foo, engine), however
my interceptor is finding a null when it attempts to fetch it from the
stack.  Is there something weird concerning the OgnlValueStack in this
context?

Peace,
Scott


Re: Mapped back UI and #status.index driven names

2009-06-17 Thread stanlick

I agree, however, there is only a single object (Thing) in the map (Things)
and only a single parameter being passed.



newton.dave wrote:
 
 stanlick wrote:
 s:textfield name=things[%{#status.index}].name value=%{name} /
 
 I'd assume something like getThings().put(index, name). OGNL has to get 
 the map in order to put something into it.
 
 Dave
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Mapped-back-UI-and--status.index-driven-names-tp24057659p24071797.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Mapped back UI and #status.index driven names

2009-06-16 Thread stanlick

How is that for a subject line?  I always wonder what I would search for
myself :working:

I had a guy tell me that a struts web tag was generating an absurd number of
method calls on his action/model.  After carefully considering his scenario,
I was able to experiment using the files below.  When the page is loaded a
single call is made to the getThings() which returns one instance of Thing. 
However, when the submit is clicked, the getThings() is called 33 times! 
Before I bury my head in code, can anyone see why this might be the case? 
The Parameters interceptor is in the stack one time and the generated HTML
is generating this single parameter:

input type=text name=things[0].name value=foo
id=mapBackedUIsaveList_things_0__name/ 



Action:

public class ListAction extends BaseAction {

private static ListThing things;
public ListThing getThings() {
if (things == null) {
things = new ArrayList();
things.addAll(Thing.getThings());
}
return things;
}

public void setThings(ListThing things) {
this.things = things;
}
public String list() throws Exception {
return SUCCESS;
}
public String saveList() throws Exception {
return SUCCESS;
}
}

Page:

s:form action=mapBackedUIsaveList
table
tr
td
Name
/td
/tr
s:iterator value=things status=status
tr
td

/td
td
s:textfield 
name=things[%{#status.index}].name
value=%{name} /
/td
td

/td
/tr
/s:iterator
/table
s:submit /
/s:form

Bean:

public class Thing {

private String name;

get/set

}
-- 
View this message in context: 
http://www.nabble.com/Mapped-back-UI-and--status.index-driven-names-tp24057659p24057659.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: Mapped back UI and #status.index driven names

2009-06-16 Thread stanlick

It's never enough FOR YOU PEOPLE!!! =^D

public static Collection? extends Thing getThings() {
ArrayListThing things = new ArrayListThing();
things.add(new Thing(1, foo, 1.95f));
return things;
}


action name=mapBackedUI* method={1} class=acme.action.ListAction
result
displayTile-{1}
/result
/action




mgainty wrote:
 
 
 code for addAll?
 code for Thing.getThings()?
 struts.xml action config for mapBackedUIsaveList?
 
 thanks,
 Martin
 __ 
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
  
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
 dient lediglich dem Austausch von Informationen und entfaltet keine
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
 destinataire prévu, nous te demandons avec bonté que pour satisfaire
 informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
 copie de ceci est interdite. Ce message sert à l'information seulement et
 n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
 les email peuvent facilement être sujets à la manipulation, nous ne
 pouvons accepter aucune responsabilité pour le contenu fourni.
 
 
 
 
 Date: Tue, 16 Jun 2009 09:10:10 -0700
 From: stanl...@gmail.com
 To: user@struts.apache.org
 Subject: Mapped back UI and #status.index driven names
 
 
 How is that for a subject line?  I always wonder what I would search for
 myself :working:
 
 I had a guy tell me that a struts web tag was generating an absurd number
 of
 method calls on his action/model.  After carefully considering his
 scenario,
 I was able to experiment using the files below.  When the page is loaded
 a
 single call is made to the getThings() which returns one instance of
 Thing. 
 However, when the submit is clicked, the getThings() is called 33 times! 
 Before I bury my head in code, can anyone see why this might be the case? 
 The Parameters interceptor is in the stack one time and the generated
 HTML
 is generating this single parameter:
 
 input type=text name=things[0].name value=foo
 id=mapBackedUIsaveList_things_0__name/ 
 
 
 
 Action:
 
 public class ListAction extends BaseAction {
 
  private static ListThing things;
  public ListThing getThings() {
  if (things == null) {
  things = new ArrayList();
  things.addAll(Thing.getThings());
  }
  return things;
  }
 
  public void setThings(ListThing things) {
  this.things = things;
  }
  public String list() throws Exception {
  return SUCCESS;
  }
  public String saveList() throws Exception {
  return SUCCESS;
  }
 }
 
 Page:
 
 s:form action=mapBackedUIsaveList
  table
  tr
  td
  Name
  /td
  /tr
  s:iterator value=things status=status
  tr
  td
 
  /td
  td
  s:textfield 
 name=things[%{#status.index}].name
  value=%{name} /
  /td
  td
 
  /td
  /tr
  /s:iterator
  /table
  s:submit /
 /s:form
 
 Bean:
 
 public class Thing {
 
 private String name;
 
 get/set
 
 }
 -- 
 View this message in context:
 http://www.nabble.com/Mapped-back-UI-and--status.index-driven-names-tp24057659p24057659.html
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 _
 Microsoft brings you a new way to search the web.  Try  Bing™ now
 http://www.bing.com?form=MFEHPGpubl=WLHMTAGcrea=TEXT_MFEHPG_Core_tagline_try
 bing_1x1
 

-- 
View this message in context: 
http://www.nabble.com/Mapped-back-UI-and--status.index-driven-names-tp24057659p24058089.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-12 Thread stanlick
Was this a question about moving from Struts 2 to Grails or how to get the
output stream?

2009/6/12 Paweł Wielgus poulw...@gmail.com

 Hi all,
 i'm active in rails and struts1 and struts2,
 languages are java and ruby and javascript.

 As for rails i use jruby instead ruby.

 What framework will my next app be implemented in? - struts2
 Why? - freedom of choice, and tons of bullet proof libraries
 How my apps look like? mostly far from edit/save/list

 Best greetings,
 Paweł Wielgus.


 2009/6/12 Dave Newton newton.d...@yahoo.com:
  Musachy Barroso wrote:
 
  Components are for tags
 
  Maybe where *you're* from. Over here we use random classes for *all* our
  functionality!
 
  Dave
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Whats the best way to do validation messages on the same page?

2009-06-12 Thread stanlick
I would skeptical about excluding execute.  As Wes points out, the framework
is designed to bypass validating input initially.  After all, it's kind of
difficult validating a form you have not yet had the chance to ill out!

On Thu, Jun 11, 2009 at 8:53 AM, Kishan G. Chellap Paandy 
kishanchellapaand...@spanservices.com wrote:

 Hi Jim,

 You can exclude methods (in your case execute method) from validation using
 workflow interceptor exclude methods parameter.

 interceptor-ref name=workflow
param name=excludeMethodsexecute/param
 /interceptor-ref

 May be this could help.

 Thank you.
 Regards,
 Kishan.G

 Team Leader.
 www.spansystems.com



 -Original Message-
 From: Jim Collings [mailto:jlistn...@gmail.com]
 Sent: Thursday, June 11, 2009 5:54 PM
 To: Struts Users Mailing List
 Subject: Whats the best way to do validation messages on the same page?

 There's got to be a better way of doing this than the way that I am doing
 it.

 Convention plugin.

 According to my projects requirements error/validation/success
 messages are supposed to show on the jsp that generated them. So if I
 am on a page that adds a record and I leave all the fields blank,
 selecting submit will display some errors on that page but will not
 move on to a different page.
 All of these pages are in the /content dir so if I have:

 some-file.jsp and SomeFileAction.java and if SomeFileAction extends
 ActionSupport implements Preparable, then execute() is going to get
 called when ever the page is loaded even though it's empty and just
 returns success... I have to override and annotate execute with
 @SkipValidation to prevent messages from being displayed when the user
 has first loaded the page. The form on the some-file.jsp calls
 some-file!doSomething when the Submit button is selected. This turns
 things into a real mess. What the convention plugin does is consistent
 but not always predictable. I basically had to break with the
 conventions and use a few @Results and an additional action to get
 some predictability out of it.

 Anyway... how would you have done this?


 Jim C.

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-12 Thread stanlick
Is that actually the Google source?

On Fri, Jun 12, 2009 at 6:48 AM, Martin Gainty mgai...@hotmail.com wrote:


 Scott-
 i think what Pawel is suggesting is there is a 'demonstrable' need for a
 Struts Grails plugin

 I have some grails code here so i might decide to tackle this myself..altho
 i think
 musachy started this ..i dont know how far along he was able to get

 BTW my last go around developing the last struts plugin pom.xml revealed
 some some funky behaviour in com.google.gwt.util.tools.Utility

 package com.google.gwt.util.tools;
 public final class Utility {
  private static void computeInstallationPath()
  {
try
{
String override = System.getProperty(gwt.devjar);
 //  if (override == null)
 //  {
System.out.println(override is null);

 //Hack!
if(override == null) override = new
 String(jar:file://F:/GWT/gwt-windows-1.4.60/gwt-dev-windows.jar);
 ///!com/google/gwt/util/tools/Utility.class);
System.out.println(override = +override);

String partialPath = Utility.class.getName().replace('.',
 '/').concat(
  .class);

 //Hack!
partialPath = new String(jar:file://F:/GWT/GWT-WI~1.60/gwt.jar);
 ///!com/google/gwt/util/tools/Utility.class);

System.out.println(partialpath = +partialPath);
//URL url = new URL(partialPath);
 //Utility.class.getClassLoader().getResource(partialPath);
//System.out.println(url = +url.getContent().toString());
//url = new
 URL(jar://F:/mygwt/my-gwt-read-only/com/google/gwt/util/tools/Utility.class);

 //URL always came back null so this branch never launched

//if (url != null  jar.equals(url.getProtocol()))
//{
  System.out.println(url != null path taken);

 //Hack!
  String path=new String(file:/F:/GWT/GWT-WI~1.60); //null; // =
 url.toString();
  System.out.println(path = +path);
  String jarPath = path.substring(path.indexOf(file:));
  System.out.print(jarPath = +jarPath);

 //Hack!
 //  File devJarFile = new File(URI.create(jarPath));
  java.io.File devJarFile = new File(F:/GWT/GWT-WI~1.60/gwt.jar);
  System.out.println(devJarFile = +devJarFile);
  if (!devJarFile.isFile())
  {
System.out.println(Could not find jar file; 
  + devJarFile.getCanonicalPath()
  +  does not appear to be a valid file);
  }
  sDevJarName = devJarFile.getName();
  System.out.println(sDevJarName = +sDevJarName);

  String dirPath = jarPath.substring(0, jarPath.lastIndexOf('/') +
 1);
  System.out.println(dirPath = +dirPath);

 //Hack!
 //  File installDirFile = new File(URI.create(dirPath));
  File installDirFile = new File(F:/GWT/GWT-WI~1.60);
  System.out.println(installDirFile = +installDirFile.getName());
  if (!installDirFile.isDirectory())
  {
System.out.println(installDirFile is a folder!!);
System.out.println(Could not find installation directory; 
  + installDirFile.getCanonicalPath()
  +  does not appear to be a valid directory);
  }

  sInstallPath = installDirFile.getCanonicalPath().replace(
File.separatorChar, '/');
  System.out.println(sInstallPath = +sInstallPath);
 //}
 //else
 //{
 //  System.out.println(
 //Cannot determine installation directory; apparently not
 running from a jar);
 //}
 //  }
 //  else
 //  {
 //override = override.replace('\\', '/');
 //System.out.println(override = +override);
 //int pos = override.lastIndexOf('/');
 //System.out.println(pos = +pos);
 //if (pos  0) {
 //  sInstallPath = ;
 //  sDevJarName = override;
 //  System.out.println(sDevJarName = +sDevJarName);
 //}
 //else
 //{
 //  sInstallPath = override.substring(0, pos);
 //  System.out.println(sInstallPath = +sInstallPath);
 //  sDevJarName = override.substring(pos + 1);
 //  System.out.println(sDevJarName = +sDevJarName);
 //}
 //  }
}
catch (IOException e)
{
  System.out.println(Installation problem detected, please reinstall
 GWT+ e.getMessage());
}
  }

 to get back to Scott and Pawles topic..what does everybody think of a
 grails plugin?
 Martin
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
 dient lediglich dem Austausch von Informationen und entfaltet keine
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
 E-Mails koennen wir keine Haftung fuer den Inhalt 

StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick

I am on a project with a new combination of jars and testing Struts
interceptors.  I have added the struts2-junit-plugin-2.1.2.jar and also
spring-test.jar.  When I run my subclass test of StrutsTestCase I get the
following exception:

SEVERE:   [20:44.438] ** FATAL ERROR STARTING UP STRUTS-SPRING
INTEGRATION **
Looks like the Spring listener was not configured for your web app! 
Nothing will work until WebApplicationContextUtils returns a valid
ApplicationContext.
You might need to add the following to web.xml: 
listener
   
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
/listener


Why is the web.xml being considered?

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
Thanks bro!  I think I hated annotations until today.  Was the
StrutsTestCase moved into a plug-in recently?

On Thu, Jun 11, 2009 at 10:41 AM, Wes Wannemacher w...@wantii.com wrote:

 Scott, it is just complaining because you are trying to do something
 Spring-ish in your unit test, but Spring is not initialized... Try
 annotating the test class with something like the following -

 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration(locations={classpath*:applicationContext-test.xml})
 public class ...


 That's the easy way, but if you are using an older JDK|JUnit then
 you'll have to figure out how to start Spring.

 -Wes

 On Thu, Jun 11, 2009 at 11:25 AM, stanlickstanl...@gmail.com wrote:
 
  I am on a project with a new combination of jars and testing Struts
  interceptors.  I have added the struts2-junit-plugin-2.1.2.jar and also
  spring-test.jar.  When I run my subclass test of StrutsTestCase I get the
  following exception:
 
  SEVERE:   [20:44.438] ** FATAL ERROR STARTING UP STRUTS-SPRING
  INTEGRATION **
  Looks like the Spring listener was not configured for your web app!
  Nothing will work until WebApplicationContextUtils returns a valid
  ApplicationContext.
  You might need to add the following to web.xml:
 listener
 
 
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 /listener
 
 
  Why is the web.xml being considered?
 
  Peace,
  Scott
  --
  View this message in context:
 http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Wes Wannemacher
 Author - Struts 2 In Practice
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Training

2009-06-08 Thread stanlick
I suspected this sort of training dialog was just beneath the surface.  The
sad matter of fact is both Wes and Martin are spot on from each of their
perspectives.  Wes works his tail off (I know because I have been reviewing
his new book) and Martin is a master technologist in business.  So who makes
the better argument?  Actually, I think they are both right on and this is
what scares me.

1) Quality training by a seasoned professional is expensive and time
consuming to design and develop - notice the word design.  Being prompted
through a PowerPoint presentation is only the tip of the iceberg and you
only know this is you have designed and developed training materials.  As
Wes points out, you first need to know the topic inside out (time, time,
time) and then be a great communicator.  I have seen my fair share of
seasoned pros on a topic who could not explain it to another human in twelve
months!  Next, you need good tools and the time to learn them.  Mastering an
effective graphics applications is no walk in the park yet illustrations are
effective and necessary.  When it comes to lab materials, their cumulative
nature throughout a course, and the degree of difficulty that neither runs
the class twelve hours a day nor leaves the students twiddling their thumbs
is an *art* not a *science*.  And the 201 level class that follows the 101
level must not only take all of this into account, but also leverage the
prerequisite course itself to minimize mental gear changing and maximize
content and context flow.

2) Now to Martin's argument.  Joe public looks around (pronounced Google)
and expects to find free or dirt cheap videos, presentations including
sample code, and emails where they can get free help.  I call this theme
you get what you pay for.  I have followed a couple JQuery training
avenues that fit this mold and after several hours jumping around, I can't
hit my ass with both hands!  The next JQuery freebie I click on suggests
techniques that are in direct opposition to yesterdays free lecture!  To
paint an anology let's suppose a Struts 2 newbie follows a freebie course at
Joe's Training Emporium where Joe has barely figured out how to code
himself.  But hey, his stuff contains jars enough to compile so he must be
an expert!  Between the kick-ass Flash graphics his brother-in-law put
together and an ass-load of sample code, you now have a web shopping site
with JSP files and Action classes that average 385 lines of code in each
execute() method -- but it works!  You ground your mental web around this
bag-of-ass design/code and are later asked to make a couple simple changes
to it.  Let me speed the analogy up a little so I am not late for work this
morning -- after several weeks of spinning and subsequently being fired
because you have been revealed as the hack you are, you decide (hey
unemployment causes you to do creative things) to actually drop a few bucks
on education, either through published material or a formal class.  You
realize their are tiers and dependency injection.  You see that rolling
hand-coded JDBC code is no longer in style and that while writing Java code
on a web page is possible, it comes back to bite your ass like a coiled up
cobra!

Great and effective training is expensive and time consuming.  My
step-father is a single proprietor plumber with one of those cool vans full
of tools and we often discuss his investment in his business. If he does not
dig deep into his own pocket to keep himself and his tool van sharply honed
for his customers, his competitor will put him out of business.  Does he
like spending money no training and tools?  He says its cheaper to pay his
dues to remain a professional than it would be to buy a freeezer and convert
over to an ice-cream and lollipop vendor.

You decide -- professional or a clown driving a musical van.

Peace,
Scott

On Sun, Jun 7, 2009 at 1:54 PM, Martin Gainty mgai...@hotmail.com wrote:


 font size=1you cannot guarantee something you have no control/font
 scott could you make sure that gets into brochure?

 vielen danke/thanks,
 Martin
 __
 Verzicht und Vertraulichkeitanmerkung

 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
 dient lediglich dem Austausch von Informationen und entfaltet keine
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





  Date: Sun, 7 Jun 2009 14:38:22 -0400
  From: newton.d...@yahoo.com
  To: user@struts.apache.org
  Subject: Re: Training
 
  Martin Gainty wrote:
   wes-I cant speak for Motorola 64k code (MAC) as i have yet to coded
for that platform but it sounds challenging does Struts work on
 Motorola
 
  
 
  Old Macs used the 68K. Struts works on Java and in app containers, not
  on specific 

Training

2009-06-07 Thread stanlick
Hey Wes and all --

I have thinking about the Wes training thread and would like to get your
feedback.  Do you guys think training can continue to cost what it has
historically?  The reason I ask is that I too have considered dropping down
a gear and doing training for a living.  However, I get the feeling that
techies now expect training to cost exactly what their software cost -
*nothing!*  Open source training if you will.  Are you getting this
impression?  When I mentioned online training in my follow-up to your
thread, I had no idea folks were going to say yeah, and it should also be
free!  I'm seeing the tide switch and curious to get your take.  I have
considered training  support the avenue to picking up some coin relative to
FOSS, and now I wonder if this too is expected to be free.

P.S. You give em an inch and they want a mile

Scott


Re: [friday] training for Struts 2

2009-06-05 Thread stanlick
Hey Wes --

Travel and paper is so 80's bro.  Have you considered an online format?  I
think a five day session where 2-3 are basics and the remaining 2-3 are
advanced topics would be flexible.  This way you could price the two
separately and allow clients one or both enrollments.  As far as course
materials goes, I think S2iA and your S2iP would be great resources, and
hey, they are already written and have labs!  The marketing piece is outside
my area of expertise.  I was a corporate trainer for several years and would
be interested in pair-teaching with you if this pans out.

Peace,
Scott



On Fri, Jun 5, 2009 at 7:54 AM, Wes Wannemacher w...@wantii.com wrote:

 Hello fellow-struts-ers,

 I have been toying with the notion of hosting a struts training, but
 I'm not convinced that it is a good business move for me. I am
 wondering about a few things and figured who better to ask than the
 community... Questions / Discussion Topics -

 1.) I'm in Ohio, US, so naturally this is where I would want to host
 it, but I'm not sure if there would be enough interest to get people
 to actually fly here. I have been working out of Dayton which has a
 large airport and plenty of hotels (that I could probably work out a
 deal on a discount), is that enough or is there another area (SF, NY)
 where I might be better off traveling myself to host something.

 2.) What topics would you guys pay to learn? I think there are a few
 what I would call basic struts2 trainings available I've seen... If I
 (as one of the committers) were to host a training, would basic be
 okay, or would you guys want something more advanced? If so, what sort
 of topics would you guys want to see?

 3.) How should I advertise something like this? Obviously there are
 google keywords and an announce list (I think there is an announce
 list), but I think there are more than a few large-ish companies using
 Struts 2 or WebWork and I would want to reach into there and I don't
 think a lot of those users don't participate in the mailing lists,
 etc.

 4.) Training format... I've been to training in classrooms where all I
 had was a notebook (actual paper, not laptop/notebook) and other
 trainings in classrooms with PCs. For a Struts training, which would
 people prefer?

 Anyhow, I'm invoking the lazy friday and hopefully no one gets too
 angry about my off-topic spam.

 -Wes

 --
 Wes Wannemacher
 Author - Struts 2 In Practice
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: [S2] why is javascript executed before DOM is updated

2009-06-05 Thread stanlick
...a previous employer that *did* have pretty specific degradation
requirements.

Your employer wanted it to run poorly? [?]

On Fri, Jun 5, 2009 at 8:39 AM, Dave Newton newton.d...@yahoo.com wrote:

 Kawczynski, David wrote:

 I don't use a jquery plugin, I simply have a SiteMesh decorator that
 includes the jquery js references on a page.  I use an
 element's onclick attributes to attach the appropriate jquery
 functionality when called for.  I don't think a plugin is required, but
 then again I'm a control freak.  :)
 Apparently I'm in the minority:
 http://www.google.com/search?q=jquery+plugin+struts2


 I think people that know JavaScript, and/or those that have specific
 accessibility/unobtrusive JS/counter-to-the-plugin requirements agree with
 you.

 (I really do need to remove my s2jquery project, though--it's not even
 close to updated, and I have to clear some of the code w/ a previous
 employer that *did* have pretty specific degradation requirements.)

 Dave


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: [OT} Re: Iterating over a List of Lists

2009-06-02 Thread stanlick
someone stole my bike!

On Tue, Jun 2, 2009 at 9:39 AM, Dave Newton newton.d...@yahoo.com wrote:

 Jim Kiley wrote:

 I had no idea I was in the presence of royalty.


 There's a lotta things about me you don't know anything about, Jim. Things
 you wouldn't understand. Things you couldn't understand. Things you
 *shouldn't* understand.

 

 I've always been a little disturbed by how much I enjoy that movie :/

 Dave

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Struts2, Spring Maven

2009-05-28 Thread stanlick
Nice tip Wes... now where is that book of yours?  I haven't received new
chapters in quite some time.

On Thu, May 28, 2009 at 7:28 AM, Wes Wannemacher w...@wantii.com wrote:

 In addition to what Dave suggested, there are other maven search
 tools, my new favorite is -

 http://www.jarvana.com/jarvana/

 Seems to me that mvnrepository.com is always down when I *need* to be
 able to search :) Jarvana allows you to search for classes and find
 out which artifacts provide them, which is nifty when you are getting
 class not found exceptions.

 -Wes

 On Wed, May 27, 2009 at 10:55 PM, Dave Newton newton.d...@yahoo.com
 wrote:
  Martin Gainty wrote:
 
  dont know if this has the correct version and groupID you're looking for
  but checkout
  http://repo1.maven.org/maven2/spring/spring/1.0.2/
 
  Spring 1.0.2?
 
  I don't even know if Struts 2 would work with a Spring that old. I'd be
  skeptical that the Spring plugin would, and the Spring plugin has a
  dependency on 2.0.mumble.
 
  As it turns out, there are ways to find these kinds of things out rather
  than just presenting people with what are essentially random numbers. By
  looking in the S2 poms, or by taking a few seconds to look it up on
  something like mvnrepository.com. There we discover the following:
 
 
 http://www.mvnrepository.com/artifact/org.apache.struts/struts2-spring-plugin
 
  From there, since the OP mentioned he was trying to use 2.0.11 (to the
 OP:
  up that to 2.0.14 if you're sticking with 2.0), we'll click the 2.0.14
  link for the plugin:
 
 
 http://www.mvnrepository.com/artifact/org.apache.struts/struts2-spring-plugin/2.0.14
 
  There we discover the following:
 
  junitjunit   3.8.1
  org.springframework  spring-beans2.0.5
  org.springframework  spring-context  2.0.5
  org.springframework  spring-core 2.0.5
  org.springframework  spring-mock 2.0.5
  org.springframework  spring-web  2.0.5
 
  No guessing required.
 
  Dave
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



 --
 Wes Wannemacher
 Author - Struts 2 In Practice
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Tiles 2 define many pages using same template

2009-05-28 Thread stanlick
Yes there is!  I am using Tiles 2.1.1 which provides support for wildcards
and substitutions.  This one definition is handling all my pages!


Struts
action name=displayTile-* class=acme.action.BaseAction
result
param name=locationdisplayTile-{1}/param
/result
/action

Tiles
definition name=myapp.layout
template=/WEB-INF/layouts/page-container.jsp
put-attribute name=titlevalue=${title} /
put-attribute name=top value=/WEB-INF/tiles/main/header-top.jsp
/
put-attribute name=middle
value=/WEB-INF/tiles/main/header-middle.jsp /
put-attribute name=bottom
value=/WEB-INF/tiles/main/header-bottom.jsp /
put-attribute name=breadcrumbs
value=/WEB-INF/tiles/main/header-breadcrumbs.jsp /
put-attribute name=navigation
value=/WEB-INF/tiles/main/main-navigation.jsp /
put-attribute name=content
value=/WEB-INF/tiles/main/main-content.jsp /
put-attribute name=subcontent
value=/WEB-INF/tiles/main/main-subcontent.jsp /
put-attribute name=footer value=myapp.footer /
/definition

definition name=displayTile-* extends=myapp.layout
put-attribute name=content value=/WEB-INF/tiles/{1}.jsp /
/definition

Peace,
Scott

On Wed, May 27, 2009 at 3:33 AM, kate_cl virgurliv...@yahoo.com wrote:


 Hi all,I'm using tiles 2 with struts 2.Basically in tiles.xml,are these
 definitions..

 definition name=tiles.default template=/layouts/Layout.jsp
put-attribute name=header value=/includes/header.jsp/
put-attribute name=footer value=/includes/footer.jsp/
/definition

definition name=tiles.home extends=tiles.default
put-attribute name=body value=/home.jsp/
/definition

definition name=tiles.user extends=tiles.default
put-attribute name=body value=/user/user.jsp/
/definition

definition name=tiles.admin extends=tiles.default
put-attribute name=body value=/admin/admin.jsp/
/definition

 lets say,i have 20 jsp pages that use the same template(tiles.default). Is
 there any simpler way to do this than writing a definition for each of the
 them?
 --
 View this message in context:
 http://www.nabble.com/Tiles-2-define-many-pages-using-same-template-tp23738366p23738366.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Preload of database data?

2009-05-21 Thread stanlick
You can prepare data by implemeting Preparable in your action

On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries 
christian_benjamin.r...@fh-bielefeld.de wrote:

 Hi there,

 I have a small site with some informations which are stored in a
 database. A method for administrations reason is added to change the
 content (names) of the datasets.

 Now, I will add these names to my navigation.

 I have a action like this:

 action name=Admin class=bean.Admin
   ...
 /action

 This action edits the content of the bean System.

 I will add this bean content to all other actions in my navigation, but
 I don't know the right way to solve this problem. Any suggestions?

 Thx!

 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: passing form parameters to a custom validator

2009-05-21 Thread stanlick
Rather than pass this, that and the other parameter(s) to your validator,
why not just retrieve what you need from inside the validator?  You have the
ActionInvocation passed to your doIntercept(...), which contains the
ValueStack containing your objects.

Peace,
Scott



On Tue, May 19, 2009 at 7:59 AM, manub e.bla...@reply.it wrote:


 Hi all,

 I'm trying to write a custom field validator which needs other fields to
 validate the field I need to validate. How can I pass field values (and not
 static params) to a field validator in the validation xml? I'm using Struts
 2.1.6.

 Thank you.
 --
 View this message in context:
 http://www.nabble.com/passing-form-parameters-to-a-custom-validator-tp23615918p23615918.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: How to get request locale in OGNL?

2009-05-21 Thread stanlick
invocation.getStack().findString(#attr.locale)

On Thu, May 21, 2009 at 6:22 AM, Gordian Yuan gordiany...@gmail.com wrote:

 Hi,

 I want to know how to get request locale in OGNL?

 For now I use s:set var=locale

 value='#session.WW_TRANS_I18N_LOCALE?#session.WW_TRANS_I18N_LOCALE.toString():zh_CN'/

 This must assume that the initial value is zh_CN.

 So I need to know how to get request locale in OGNL.

 Thx

 Gordian Yuan



Re: Disabling JSP's

2009-05-17 Thread Scott Stanlick

Put you pages under web-inf



On May 15, 2009, at 1:36 PM, Timothy Orme  
to...@genome.med.harvard.edu wrote:



Hello All,

   I'm in the process of migrating pages from JSP's using snippets  
to struts actions. I'm wondering how people have disabled access to  
JSP's so that they cannot be accessed outside of the action anymore.

   Right now if I have an action like:

   action name=ViewIndex class=action.BaseAction
   result name=success/private/index.jsp/result
   /action

   There is nothing preventing the user from just browsing directly  
to /private/index.jsp instead of accessing it through the Action  
URL. This could have some bad implications about security, but also  
might just look bad if a page that should be receiving data from an  
action no longer has the source.


   How have people worked around this in the past?

-Tim Orme


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: xml validation

2009-05-15 Thread stanlick
I use this successfully.

field name=credential.password
field-validator type=expression
param name=expression

credential.passwordRepeat.toUpperCase().equals(credential.password.toUpperCase())
/param
message key=passwordsNotMatching /
/field-validator
/field

On Thu, May 14, 2009 at 2:11 PM, Dave Newton newton.d...@yahoo.com wrote:

 manub wrote:

 - I'm not able to perform an equality check on two parameters. I've got
 password and confirmPassword which I try to validate using something like:

validator type=expression
confirmPassword.equals(password)
message.../message
/validator

 What am I getting wrong?
 - Even if I'm putting input that should be validated, I'm never going to
 the
 execute method of the action. It seems that validation always fails.


 DEBUG [http-8080-1] (CommonsLogger.java:57) - Bypassing
 //EseguiRegistrazione
 DEBUG [http-8080-1] (CommonsLogger.java:57) - Validating
 //EseguiRegistrazione with method execute.
 DEBUG [http-8080-1] (CommonsLogger.java:57) - Forwarding to location
 /pages/account/registrazione.jsp

 (EseguiRegistrazione is the action I forward my submit to, the one that is
 validated, and the location is the one associated to input result)

 Using Struts 2.1.6.


 Include the complete field validation configuration, the interceptor stack
 you're using, and the action configuration.

 Dave


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Struts 2 UI Tags and OGNL self reference

2009-05-08 Thread stanlick

Actually, what I am trying to accomplish is to pass/receive the Component
bean instance representing this tag as an argument to the OGNL expression. 
I am working with the component stack and would like to have this reference.

Scott

stanlick wrote:
 
 Sorry about that subject line, but I couldn't think of anything simpler. 
 Besides, this should cover about all the searches!  
 
 I am looking to pass a this reference into an OGNL expressions as
 follows:
 
 s:textfield key=name  readonly=applyRule(this)/
 
 Apparently this is not quite the right syntax though.  I have tried a few
 combinations and decided perhaps you have this on the tip of your finger.
 
 Peace,
 Scott
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-UI-Tags-and-OGNL-self-reference-tp23430564p23445290.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts 2 UI Tags and OGNL self reference

2009-05-08 Thread stanlick

s:textfield key=city readonly=applyRules(top)/

top returns the action!  It appears the component stack is added to the
value stack and is treated as a separate animal.  This UI request life-cycle
has me coiled up in the fetal position sucking my thumb!




Nils-Helge Garli wrote:
 
 If I understand your question correctly, are you looking for a
 reference to the tag itself? If so, why do you need it (I'm not sure
 it's possible at all)? If you're just looking for the current action,
 the expression 'top' might be what you're looking for.
 
 Nils-H
 
 On Thu, May 7, 2009 at 6:27 PM, stanlick stanl...@gmail.com wrote:

 Sorry about that subject line, but I couldn't think of anything simpler.
 Besides, this should cover about all the searches!

 I am looking to pass a this reference into an OGNL expressions as
 follows:

 s:textfield key=name  readonly=applyRule(this)/

 Apparently this is not quite the right syntax though.  I have tried a few
 combinations and decided perhaps you have this on the tip of your finger.

 Peace,
 Scott
 --
 View this message in context:
 http://www.nabble.com/Struts-2-UI-Tags-and-OGNL-self-reference-tp23430564p23430564.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-UI-Tags-and-OGNL-self-reference-tp23430564p23448291.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



  1   2   3   4   5   6   >