Re: Struts2 and Jquery problem with LightBox or thickbox

2008-07-15 Thread Ian Roughley
I've used lightbox successfully without problem.  If this is the error 
message it looks like you are passing the height and width attributes as 
URL params and they are being applied against the action (hence the 
error).  I bet (I don't have the code anymore) these are instead meant 
to be passed to the jQuery plugin - perhaps as HTML attributes.


/Ian

prashanth2 wrote:

I dont understand what u asked, anyways iam getting the below exception, and
thickbox/lightbox never opened for me.

Jul 2, 2008 3:39:54 PM
com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'height' on 'class com.hicom.web.action.UserSignupAction: Error
setting expression 'height' with value '[Ljava.lang.String;@7a847a84'

newton.dave wrote:
  

DOES IT ACTUALLY NOT WORK OR DOES IT JUST LOG THE EXCEPTION


--- On Tue, 7/15/08, prashanth2 [EMAIL PROTECTED] wrote:



From: prashanth2 [EMAIL PROTECTED]
Subject: Re: Struts2 and Jquery problem with  LightBox or thickbox
To: user@struts.apache.org
Date: Tuesday, July 15, 2008, 9:17 AM
CAN SOMEBODY HELP ME, HOW CAN I CREATE A LIGHT OR THICK
BOX

prashanth2 wrote:
  

I tried to implement thickbox functionality in a jsp


,to display iframe in
  

a thickbox. If I use a simple a href using a


jsp,thickbox works fine, but
  

if i use s:url with *.action as the url ,and if i pass


height,width
  

attributes ,iam getting an error .I tried removing


height and width, but
  

iam getting an exception saying ParametersInterceptor


exception using
  

random .Random variable is


used by jQuery.js internally.
  

If i can not use Jquery 'thickbox, what other


frameworks support thickbox
  

kind of functionality, as i need thick box to show


some dynamic
  

content,such as user's information or it can be a


form submit.
  

Jul 2, 2008 3:39:54 PM



com.opensymphony.xwork2.interceptor.ParametersInterceptor
setParameters
  

SEVERE: ParametersInterceptor - [setParameters]:


Unexpected Exception
  

caught setting 'height' on 'class


com.hicom.web.action.UserSignupAction:
  

Error setting expression 'height' with value
'[Ljava.lang.String;@7a847a84' 



--
View this message in context:
http://www.nabble.com/Struts2-and-Jquery-problem-with--LightBox-or-thickbox-tp18326073p18465058.html
Sent from the Struts - User mailing list archive at
Nabble.com.


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

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






  



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



Re: Struts2 and Jquery problem with LightBox or thickbox

2008-07-15 Thread Ian Roughley
I can't remember the framework used now (customer code), but it was 
displaying dynamically generated code.


The random property is not your problem - s2 is reporting the problem, 
but should be continuing execution (have you debugged/logged to check 
this?).  If you want to stop the error message, take a look at the 
http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html 
- in particular the excludeMethods parameter.


Until you sort out what the underlying problem is, I would recommend 
using a a href= / and place the action name or s:property in the 
href value. 


/Ian

prashanth2 wrote:

I tried removing the height and width attributes as URL parameters, but the
problem is JQuery internally uses a variable 'random', so s2 complains
ParametersInterceptor exception. Great to hear tht u have a working sample,
could u pl tell me, was that u were displaying dynamic content or static
content. And which ajax framework have u used for thick/light box.

In My case I need to get the data from DB, and display accordingly on the
THICKBOX.

An early  reply would be appreciatable.
Thanks

Ian Roughley wrote:
  
I've used lightbox successfully without problem.  If this is the error 
message it looks like you are passing the height and width attributes as 
URL params and they are being applied against the action (hence the 
error).  I bet (I don't have the code anymore) these are instead meant 
to be passed to the jQuery plugin - perhaps as HTML attributes.


/Ian

prashanth2 wrote:


I dont understand what u asked, anyways iam getting the below exception,
and
thickbox/lightbox never opened for me.

Jul 2, 2008 3:39:54 PM
com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught
setting 'height' on 'class com.hicom.web.action.UserSignupAction: Error
setting expression 'height' with value '[Ljava.lang.String;@7a847a84'

newton.dave wrote:
  
  

DOES IT ACTUALLY NOT WORK OR DOES IT JUST LOG THE EXCEPTION


--- On Tue, 7/15/08, prashanth2 [EMAIL PROTECTED] wrote:




From: prashanth2 [EMAIL PROTECTED]
Subject: Re: Struts2 and Jquery problem with  LightBox or thickbox
To: user@struts.apache.org
Date: Tuesday, July 15, 2008, 9:17 AM
CAN SOMEBODY HELP ME, HOW CAN I CREATE A LIGHT OR THICK
BOX

prashanth2 wrote:
  
  

I tried to implement thickbox functionality in a jsp



,to display iframe in
  
  

a thickbox. If I use a simple a href using a



jsp,thickbox works fine, but
  
  

if i use s:url with *.action as the url ,and if i pass



height,width
  
  

attributes ,iam getting an error .I tried removing



height and width, but
  
  

iam getting an exception saying ParametersInterceptor



exception using
  
  

random .Random variable is



used by jQuery.js internally.
  
  

If i can not use Jquery 'thickbox, what other



frameworks support thickbox
  
  

kind of functionality, as i need thick box to show



some dynamic
  
  

content,such as user's information or it can be a



form submit.
  
  

Jul 2, 2008 3:39:54 PM




com.opensymphony.xwork2.interceptor.ParametersInterceptor
setParameters
  
  

SEVERE: ParametersInterceptor - [setParameters]:



Unexpected Exception
  
  

caught setting 'height' on 'class



com.hicom.web.action.UserSignupAction:
  
  

Error setting expression 'height' with value
'[Ljava.lang.String;@7a847a84' 




--
View this message in context:
http://www.nabble.com/Struts2-and-Jquery-problem-with--LightBox-or-thickbox-tp18326073p18465058.html
Sent from the Struts - User mailing list archive at
Nabble.com.


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

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





  
  

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






  



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



Re: Firefox 3 and s:head theme=ajax/ render issues

2008-07-03 Thread Ian Roughley
This might be a dojo issue, as I think nearly all the JS code being 
loaded is dojo now.  Have you tried their mailing lists?


/Ian

georz1 wrote:

I'm using Struts 2.0.11 and it seem with Firefox 3 only there are rendering
issues on pages where I have s:head theme=ajax.  I can see the page load
fully and there is a quick flash of the browser and then a blank page with
FF3 stuck in a loading state.

On certain pages I have made it theme=xhtml which solves the problem but
some pages in my application have a s:tabbedpanel which requires the ajax
theme

Has anyone else seen this type of behavior or know of a work around?  
  



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



Re: Showing messages after a redirect

2008-07-01 Thread Ian Roughley

Have you looked at the message store interceptor?

/ian

Antonio Petrelli wrote:

2008/7/1 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

ActionMessages msg = new ActionMessages();
msg.add(Constants.MESSAGE_CONFIRM, new
ActionMessage(prompt.changes.saved));
saveMessages(request, msg);

But when I'm redirected back in the jsp there's no message showing (there's
a specific tile for
messages).



Heh, that's a good one: I think it is not possible to use
ActionMessages, since they remain active only in the current request.
When you redirect you are in fact creating a new request, and the
messages will disappear.
Other frameworks, like Struts 2, have a flash scope, that is
available just the time of one single redirect. It works by putting
temporarily objects in session and then putting them back in request
after the redirect.
You could put these messages in session and use a filter (to .jsp
files) to put them back to request.
Or you can take a look at the click scope of Scopes:
http://scopes.sourceforge.net/documentation/more-scopes/click-scope.html

Antonio

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

  



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



Re: Showing messages after a redirect

2008-07-01 Thread Ian Roughley

my mistake, only saw the last message.

Antonio Petrelli wrote:

2008/7/1 Ian Roughley [EMAIL PROTECTED]:
  

Have you looked at the message store interceptor?



For Struts 1?

Antonio

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

  



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



Re: Jazoon 08 conference wo/Struts 2 :(

2008-06-24 Thread Ian Roughley
I was thinking about submitting a talk for Jazoon - not sure what 
happened, I think the deadline passed before I realized (and the 
deadline, from what I remember, was really early - maybe 7 months before).


/Ian

Giovanni Azua wrote:

Hi,

I attended today the Jazoon conference here in Zurich and there were no
Struts2 presentations... pity :( ... maybe next year?
http://jazoon.com/en.html


There were many interesting topics covered e.g. Ajax push framework
http://www.icefaces.org/ where different parts of a page are rendered
using AJAX without an explicit request initiated from the page i.e. the web
server proactively pushing the data onto the specific client page. I
actually recently needed such pattern but could only implement it in Struts2
by means of inefficient periodic polling using the Dojo remote div.

Regards,
Giovanni





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

  



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



Re: [OT] What slows you down?

2008-06-20 Thread Ian Roughley



[EMAIL PROTECTED] wrote:

I think a web page generator from action/model would be a huge shot in the
arm.  Of course it would need to be gussied up a bit, but doing these by
hand is a leach on time.  I recall a product back in the day that would
generate pages from db tables.  
The is a company in Brazil that has a product like this (can't remember 
their name now). Met the folks last Oct and helped them see how s2 could 
be leveraged as another action framework - they were using JSF and s1.  
There is also J2EE Spider that is open source, and also Brazilian in origin.


Although, I have to say, this approach is great for admin or pure 
data-to-tables apps, but most customs apps I write are not this 
simplistic when it comes to middle and data tiers.

Perhaps it's now open source and could be
leveraged?  And then there is the persistence nightmare -- but I have found
Db4o solves that problem quite nicely.

Scott

On Fri, Jun 20, 2008 at 7:07 AM, Al Sutton [EMAIL PROTECTED] wrote:

  

Web Design :). I can code it in a few days, but getting it to look pretty
so that users don't complain, thats a b**ch.

Seriously though, one of the things we could do is a something link Suns
blueprints or a cookbook of code recepies where we have pages which show and
explain the code solutions to common problems.

I know there are some bits and bobs around, and there are some sample
webapps, but it would be nice to have thinks like the  the
S2/Spring2/JPA/Ajax page at
http://struts.apache.org/2.0.11.1/docs/struts-2-spring-2-jpa-ajax.html in
one place along with some others.

Al.


Ted Husted wrote:



Since it's friday, let me pose a question to the group ...

Even with rock-solid frameworks like Apache Struts, it still seems
like web application development takes longer than it should. Some
frameworks, like Ruby on Rails, speak directly to time to market
concerns and have been gathering many followers.

But why does web application still seem so difficult or so
time-consuming? Are there time bandits that still suck days or weeks
out of your development schedule? Are there time gremlins that
nickel-and-dime you every hour of every day? Is there anything more
that frameworks like Apache Struts can do to help? Or are just there
intractable problems with web development itself?

Thoughts? :)

-Ted.

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



  

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






  



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



Re: [OT] What slows you down?

2008-06-20 Thread Ian Roughley
And don't forget s:debug / and the debug interceptor (that I believe 
dumps to log file/xml) :-)


Martin wrote:
something about the difference between developer (someone who only 
works one version of an  IDE)
and a software engineer who can engineer a solution (regardless of the 
IDE)


for debugging check out console out c:out
http://jakarta.apache.org/taglibs/sandbox/doc/iterators-doc/index.html

HTH
Martin

- Original Message - From: Dave Newton [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, June 20, 2008 9:29 AM
Subject: Re: [OT] What slows you down?



--- On Fri, 6/20/08, Jim Kiley [EMAIL PROTECTED] wrote:

I don't have a JSP debugger, and JSPs don't generate
log statements (wow, wouldn't it be awesome if they
could?).


AFAIK they can, although I'll often just use a println. What 
environment are you using that you don't have a JSP debugger, though?



the most time-consuming part is figuring out what the
hell the previous CF programmer wanted when he wrote
his code.


He wanted to not be programming in ColdFusion.

Dave


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





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




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



Re: What can you do with S2?

2008-06-16 Thread Ian Roughley
I was thinking about this myself the other day.  One of the interesting 
things that the ruby/rails community has (perhaps others, but ruby/rails 
seems to push it more) is the idea of a hackfest - a night(usually a few 
hours) or a weekend, where people get together to get something useful 
done.  This might be writing a very simple app, but it could also be to 
work on a plug-in, or fix specific bugs.  I wonder if there would 
interest to do something similar for s2?


--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Al Sutton wrote:

Well, OK, S2.1 (but the title wouldn't sound so catchy).

A push is being made for a high quality 2.1 GA release, and in order 
to do this the codebase needs a jolly good thrashing in every way 
imaginable, and the best way of doing this is to write S2.1 apps (and 
don't worry, the codebase loves a good thrashing).


So, in the space of 5 working days, what can you produce that uses S2.1?

On Monday I started writing a webapp that you can now play with at 
http://www.lifefeed.info/, so it's possible to write at least 
something in that amount of time :).


So come on, show us what you can do

Al.

P.S. For those who are interested, in order to cut down on the coding 
time I used Hibernate, Sitemesh, and the S2.1 REST plugin. Feel like 
trying a better combination?


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



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



Re: Struts Annotation

2008-05-14 Thread Ian Roughley
Results are annotated at the class level, see 
http://struts.apache.org/2.0.6/docs/annotations.html


/Ian

Felipe Lorenz wrote:

Hi.

Im try to use annotations for action results.

but, the annotations is for a class, not for each method in an class...

fallow this idea, for each CRUD operations i need one actions class??? Or
have other way to do one action class for CRUD operations?

Felipe A. lorenz
www.idealogic.com.br

  



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



Re: Struts Annotation

2008-05-14 Thread Ian Roughley
So all the action results are defined at the class level and used per 
CRUD method.  So if you define input, success, page1, etc. at the 
top, each of the CRUD methods can then choose which result to return.


Did you mean that you want annotations that map the action name to the 
CRUD method?  This case is not currently supported via the zero config 
setup (a convention is used).  You might want to check out the 
convention plug-in.


/Ian

Felipe Lorenz wrote:

Yes.. told it in my question... i need to know if have some different way to
use one class to implement CRUD methods!!

On Wed, May 14, 2008 at 10:08 AM, Ian Roughley [EMAIL PROTECTED] wrote:

  

Results are annotated at the class level, see
http://struts.apache.org/2.0.6/docs/annotations.html

/Ian


Felipe Lorenz wrote:



Hi.

Im try to use annotations for action results.

but, the annotations is for a class, not for each method in an class...

fallow this idea, for each CRUD operations i need one actions class??? Or
have other way to do one action class for CRUD operations?

Felipe A. lorenz
www.idealogic.com.br



  

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





  



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



Re: Is there such a thing as flash in S2?

2008-04-17 Thread Ian Roughley
Your right.  The flash interceptor is more for the benefit of the next 
JSP page (i.e. redirect after post pattern) and not for accessing data 
in the current action.  For this scenario you can use the chaining 
interceptor/result type - match setters on the current action with 
getters from the previously executed action.


/Ian

Guillaume Bilodeau wrote:

Hi Ian,

First let me congratulate you on your Struts2 book, I honestly think it's
one of the best technical books I've read in a while: it's thorough,
practical and tackles every day issues.  Kudos to you!

About that WebWork flash interceptor, it seems to me that it's not that
useful.  AFAICT it simply puts the previously executed action on the value
stack given to the currently executed action.  This works great if all you
need is access properties in the final JSP, but what if the current action
needs to access these properties?  If I understand correctly, to do this the
action must browse through the value stack explicitly or do an OGNL lookup
on the value stack.  To me this seems impractical and feels very different
from the overall Struts2 paradigm.

The Scope plugin also feels like too much a departure from the Struts2
paradigm.

What would be great is if an interceptor would inject all properties that
are shared by the previous and the current action (by name? by type?) in the
current action, in a similar fashion to HTTP parameter injection.

Is there an interceptor that does this or is this something that should be
developed?

Cheers,
GB



Ian Roughley wrote:
  
There is also a flash result type / interceptor in webwork - very easy 
(2 min) to convert to s2.


/Ian

Don Brown wrote:


There is the Struts 2 Scope Plugin [1], which does flash scope and a
lot more.  Also, the message store interceptor, available in core
out-of-the-box, will persist action and error messages across a
redirect in a flash scope, which is very handy for registering
validation errors on a POST but having the response redirect the user
to a GET.

Don

[1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html

On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
[EMAIL PROTECTED] wrote:
  
  

Flash scope is fairly common nowdays (for displaying messages) I
 wonder if S2 2.011, has anything similar?

 thanks,
 Alex.

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





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

  
  


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






  



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



Re: Is there such a thing as flash in S2?

2008-04-15 Thread Ian Roughley
There is also a flash result type / interceptor in webwork - very easy 
(2 min) to convert to s2.


/Ian

Don Brown wrote:

There is the Struts 2 Scope Plugin [1], which does flash scope and a
lot more.  Also, the message store interceptor, available in core
out-of-the-box, will persist action and error messages across a
redirect in a flash scope, which is very handy for registering
validation errors on a POST but having the response redirect the user
to a GET.

Don

[1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html

On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
[EMAIL PROTECTED] wrote:
  

Flash scope is fairly common nowdays (for displaying messages) I
 wonder if S2 2.011, has anything similar?

 thanks,
 Alex.

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





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

  




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



Re: Does Struts 2 support clustering?

2008-04-10 Thread Ian Roughley
How are you clustering the HTTP session?  Usually this involves 
configuration of the app server so that it is stored in some type of 
non-transient storage.


/Ian

mojoRising wrote:

We have struts running great on a single server but when we test in our
clustered environment there are problems: The user is not staying on the
same server the initial request came in on, so their session is getting
lost.  Does struts 2 support a clustered enterprise environment? If so, is
there anything special that needs to be done to make this work? Our
environment is Apache,weblogic9.2, struts2.  

Thanks! 
--John
  



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



Re: any struts 2 unit testers out there?

2008-04-04 Thread Ian Roughley
Or look at the xwork / s2 test cases - there are some test classes in 
there that can help you. 


/Ian


Karr, David wrote:

And did you investigate using either of the common Java frameworks for
Mock objects, jMock and EasyMock? 

  

-Original Message-
From: paulbrickell [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 04, 2008 3:04 AM

To: user@struts.apache.org
Subject: RE: any struts 2 unit testers out there?


Actually thats an interesting post. To my mind it doesn't 
demonstrate a solution. It demonstrates the problem.


Here is why I think this.

Struts 2 is just frankly brilliant for people doing test 
first development.
The classes you create really are POJOs. There are no 
dependencies on any framework in my action classes. For 
example parameters are parsed well away from my action and 
the values are set using simple properties, things like 
sessions are simply maps. It is a truly new world for those 
of who have suffered the horror of mocking http requests, 
responses, context and the like.


But this simple scenario brings all that pain flooding back. 
I add a line in my action like this...


String yadaYada = getText(some.doodad);

And my lovely world comes unraveled real quick. Now I need 
mock objects up the ying-yang.


I started using the tutorial from the link posted (I am an 
Arsenal fan btw, so got two for the price of one, thanks), 
but it still doesn't provide a simple solution to the 
problem. To get this to work I have to build not just the 
application context but a mass of supporting objects to get a 
(partial) web application framework up and running before I 
can test my simple POJO.


I am not going to give up just yet, but I think I am still 
going to have to look for another way.


Cheers,
Paul B.




Relph,Brian wrote:

I recommend creating an action context.  Here is the basic guide I 
followed to do so:



  

http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-


junit/

If you are not using spring or the struts2 spring plugin, 
  
you can cut 


out all the code around the applicationContext.


-Original Message-
From: paulbrickell [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 11:44 AM
To: user@struts.apache.org
Subject: Re: any struts 2 unit testers out there?


I am trying to deal with the same issue. Did you get any resolution?

Following on from the reply asking for a stack trace, here 
  
is what I 


am getting...


java.lang.NullPointerException
at

  

com.opensymphony.xwork2.util.LocalizedTextUtil.findText(Locali
zedTextUtil.java:299)


at

  

com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
erSupport.java:172)


at

  

com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
erSupport.java:87)

	at 
  

com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)


SNIP
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

  

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
orImpl.java:39)


at

  

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
odAccessorImpl.java:25)


at java.lang.reflect.Method.invoke(Method.java:585)
	at 
  

org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)


at

  

org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRo
adie.java:98)

	at 
  

org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)


at

  

org.junit.internal.runners.MethodRoadie.runBeforesThenTestThen
Afters(MethodRoadie.java:87)

	at 
  

org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)

	at 
  

org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)


at

  

org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(
JUnit4ClassRunner.java:88)


at

  

org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4
ClassRunner.java:51)


at

  

org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4Class


Runner.java:44)
  

at

  

org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoa
die.java:27)


at

  

org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadi
e.java:37)


at

  

org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRu
nner.java:42)


at

  

org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:38)


at

  

org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
ecution.java:38)


at

  

org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
s(RemoteTestRunner.java:460)


at

  

org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
s(RemoteTestRunner.java:673)


at

  


[ANN] Struts2 Workshop - Early Bird Discount ends Friday, March 14th

2008-03-12 Thread Ian Roughley
We are pleased to announce a Struts2 workshop, from April 28-30 in 
Sunnyvale, CA.  Join us the week before JavaOne to learn about the next 
generation of evolution of the Struts web framework.


In this three day workshop-style training course you'll learn everything 
you need to know to effectively write applications using Struts2. We'll 
take a practical and hands-on approach, dividing the time into 40% 
theory and 60% exercises.  Our instructor, Ian Roughley, has extensive 
experience developing Struts2 applications; is a committer on the Apache 
Struts2 project; and is the author of Practical Apache Struts2 Web 2.0 
Projects.


Over this three day workshop you'll learn:
- Struts2 architecture and how you can take advantage of the features in 
your applications

- How to use existing domain models in your actions
- XML, annotation, and convention-based configuration
- How to create user-friendly URLs and REST interfaces
- Strategies for storing application state
- Techniques for creating wizards and using conversation scopes
- How to test your web applications
- Ways to expedite user interface creation using themes and templates
- How to secure your applications
- Available Ajax tags, how to integrate Ajax libraries, and how to 
return JSON  XML data

- Creating plug-ins to reuse common code
- How to integrate Struts2 into Spring and J2EE application stacks
- Getting the most out of Struts2 with tips, tricks, and best practices

As a special promotion, if you register before March 14th, you will 
receive a discounted price of $1350 - a $300 savings off the regular 
workshop price of $1650.


For more information and to register, visit 
http://www.fdar.com/training/struts2.


--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]


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



Re: authentication question

2008-03-12 Thread Ian Roughley
The easiest way is to always have the user call an action to get a JSP, 
even if it is a simple page.  You then also ensure that all data 
necessary for that page has been obtained.  The, by placing the JSP's in 
the WEB-INF directory you will prevent access directly from a browser 
(only from the s2 dispatcher).


Otherwise, I would suggest a servlet filter or header code for all JSPs 
that make the necessary checks.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



mojoRising wrote:

struts 2 - java - jsp
Hi. I am trying to configure an authentication/login interceptor. The idea
being of course being to prevent someone from accessing a page unless they
are logged in. We can assume that means they have a user object stored in
the session.
Now I understand how to plug in an interceptor to check for this, but what I
am missing is: How do I prevent someone from accessing a jsp page if they DO
NOT CALL an action, but type in the url themselves? E.g. If someone types in
http://www.mysite.com/pages/main.jsp how do I intercept that?
  


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



Re: authentication question

2008-03-12 Thread Ian Roughley
The easiest way is to always have the user call an action to get a JSP, 
even if it is a simple page.  You then also ensure that all data 
necessary for that page has been obtained.  The, by placing the JSP's in 
the WEB-INF directory you will prevent access directly from a browser 
(only from the s2 dispatcher).


Otherwise, I would suggest a servlet filter or header code for all JSPs 
that make the necessary checks.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



mojoRising wrote:

struts 2 - java - jsp
Hi. I am trying to configure an authentication/login interceptor. The idea
being of course being to prevent someone from accessing a page unless they
are logged in. We can assume that means they have a user object stored in
the session.
Now I understand how to plug in an interceptor to check for this, but what I
am missing is: How do I prevent someone from accessing a jsp page if they DO
NOT CALL an action, but type in the url themselves? E.g. If someone types in
http://www.mysite.com/pages/main.jsp how do I intercept that?
  


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2008-03-05 Thread Ian Roughley
There have been cases (unfortunately not with myself or the tech 
reviewer, otherwise it would have been corrected) when the same error 
message (No object in the CompoundRoot has a publicly accessible 
property named 'model' (no setter could be found). - [unknown location]) 
has been displayed.  I believe it may be based on OS.


The solution provided to me was to change the scope interceptor 
reference to use a session value of Model rather than model - see below.


 interceptor-ref name=scope
   param name=sessionModel/param
   param name=keypartialEvent/param
 /interceptor-ref

/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



guillermodl wrote:

Im having 1 little problems with Practical Apache Struts2 Web 2.0 Projects
examples
The first one is that even EntityManager do not persist when submiting the
contestants says detached persist, I have solved it using
entityMgr.merge(event); instead of entityMgr.persist(event);
the second is a problem with tomcat, when debuging(and only runnig the
debbuger, tomcat 5.5) under eclipse, the more strange is that it doesn't
happend if I add a user but creating a envent prints

avax.servlet.ServletException: Error setting expression 'model' with value
'[EMAIL PROTECTED]'

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

causa raĆ­z

Error setting expression 'model' with value
'[EMAIL PROTECTED]' - [unknown location]

com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)



No object in the CompoundRoot has a publicly accessible property named
'model' (no setter could be found). - [unknown location]
at
com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)

..

but getModel and setModel  are defined in BaseEventAction where interface
ModelDriven is used

I will try tomcat 6 to see if it is that solves, If you already know wath it
is, please, I will be here reading
  


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2008-03-05 Thread Ian Roughley
I'm not sure, and I'm only taking an educated guess at it being 
OS/platform-dependent (since a JAR that worked for me had problems for 
another user).  Unfortunately I can't reproduce the error.  I'm all for 
doing the work to fix the problem if someone has the problem and cycles 
to work through testing it.


/Ian

Dave Newton wrote:

--- Ian Roughley [EMAIL PROTECTED] wrote:
  
The solution provided to me was to change the scope interceptor 
reference to use a session value of Model rather than model - see

below.

  interceptor-ref name=scope
param name=sessionModel/param
param name=keypartialEvent/param
  /interceptor-ref



Hmm, why does that fix it? If it's an OS-dependent issue we should fix it for
real.

Dave


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

  


Re: Struts 2: map-backed bean

2008-03-04 Thread Ian Roughley
If you implement the RequestAware interface, the map will contain all 
the form values.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Agile Process * Open Source
Advanced Struts2 Workshop, April 28-30, Sunnyvale CA
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Cheng Wei Lee wrote:

In Struts 1, we could use map-backed form beans to deal with dynamic forms,
is there something equal in Struts 2?

  


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



Re: Dynamic Results

2008-02-15 Thread Ian Roughley
I think you'll find this happens will all the result types and not just 
the chart result.  If you have additional info in the result config as 
parameters, it will try to set is on the result type, fail with an 
exception, and then set it correctly on the action.


As to a resolution... as both result types and action can take 
parameters from the config, what is the best way to differentiate them 
without making the config more complicated?


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:

I understand the quirky plug-in, but that does not explain why OGNL is
looking for a setHeight(String) on ChartResult!  If I hardcode ints into
these two parms, life is good.  I am puzzled at why S2 is not executing
getHeight() on my ChartAction and substituting the height and weight into
these params.

Can you look at this
http://struts.apache.org/2.x/docs/result-configuration.htmland tell me how
the two differ?

Peace,
Scott

On Thu, Feb 14, 2008 at 3:35 PM, Dave Newton [EMAIL PROTECTED] wrote:

  

--- [EMAIL PROTECTED] wrote:


Anyone realize why this is not working?  I have get/set methods in my
ChartAction, but the getters are not fetching the values for the Result.

action name=chart class=actions.ChartAction
result type=chart
param name=height${height}/param
param name=width${width}/param
/result
/action
  

Probably because the chart result doesn't parse its parameters.

Dave


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






  


Re: Dynamic Results

2008-02-15 Thread Ian Roughley
My mistake, I was thinking of a similar problem where I needed to pass a 
static param to the next action being invoked.  In this case, the 
parameter had to be declared in the result stanza, but was not intended 
for the result type.  We also didn't want it to be noise on the action.  
In this case there was no clear context.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:

Actually when OGNL fails to locate a setXXX(String) on the result when
encountering result parm${width}  it fails with

 2008-02-15 09:17:25,991ERROR [http-8080-2] (
DefaultActionInvocation.java:createResult:198) - There was an exception
while instantiating the result of type
org.apache.struts2.dispatcher.ChartResult
 2008-02-15 09:17:26,241Caught OgnlException while setting property 'height'
on type 'org.apache.struts2.dispatcher.ChartResult'. - Class:
ognl.OgnlRuntime

and the action setter is never invoked. What would the value of recovery by
setting a result parameter on the action be?  As far as differentiating
between parameters in the config file goes, why wouldn't the lexical context
of the parameter determine the intended application of the value?





On Fri, Feb 15, 2008 at 9:00 AM, Ian Roughley [EMAIL PROTECTED] wrote:

  

I think you'll find this happens will all the result types and not just
the chart result.  If you have additional info in the result config as
parameters, it will try to set is on the result type, fail with an
exception, and then set it correctly on the action.

As to a resolution... as both result types and action can take
parameters from the config, what is the best way to differentiate them
without making the config more complicated?

/Ian

--
Ian Roughley
From Down  Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:


I understand the quirky plug-in, but that does not explain why OGNL is
looking for a setHeight(String) on ChartResult!  If I hardcode ints into
these two parms, life is good.  I am puzzled at why S2 is not executing
getHeight() on my ChartAction and substituting the height and weight
  

into


these params.

Can you look at this
http://struts.apache.org/2.x/docs/result-configuration.htmland tell me
  

how


the two differ?

Peace,
Scott

On Thu, Feb 14, 2008 at 3:35 PM, Dave Newton [EMAIL PROTECTED]
  

wrote:

  

--- [EMAIL PROTECTED] wrote:



Anyone realize why this is not working?  I have get/set methods in my
ChartAction, but the getters are not fetching the values for the
  

Result.


action name=chart class=actions.ChartAction
result type=chart
param name=height${height}/param
param name=width${width}/param
/result
/action

  

Probably because the chart result doesn't parse its parameters.

Dave


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






  




  


Re: Struts2 WebApp context

2008-02-14 Thread Ian Roughley
This question will probably result in an answer / better solution if 
asked on the Spring forums.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Rushikesh Thakkar wrote:

Thanks Ian and Laurie for looking into this.
Excuse me Laurie, for missing out an imp. info. that web.xml also contains
spring ContextLoaderListener declaration.

I now feel that it is more a spring / tomcat issue and not a really a
struts2 issue.
I observed the tomcat's console logs while it was shutting down. I could see
the info messages indicating that the spring context was being destroyed.
But when I 'reload' the context of the same web-app using Tomcat Manager
application, I don't see those info messages.

So, I guess I need to
   either change the way tomcat reloads the context (only if it's possible)
   or find out a way to reload spring context when Tomcat reloads the
web-app context.

Correct me if I'm wrong. Direct me if I'm right.. :)

- Rushikesh

On Wed, Feb 13, 2008 at 9:29 PM, Laurie Harper [EMAIL PROTECTED] wrote:

  

  (3) web.xml doesn't contain anything but struts2 filter declaration.

If that's the case, how is Spring getting initialized? Usually you would
configure one of Spring's context listeners, which will take care of
loading the Spring context on startup and destroying it when the
application is shut down / undeployed.

As Ian indicated, you'll need *some* sort of context listener to close
the Spring context (i.e. reverse whatever Spring setup logic you have),
whether it be one of the ones supplied by Spring or your own.

L.

Rushikesh Thakkar wrote:


I want to release a database connection while reloading the context
  

(using


Tomcat Manager web app) of a Struts2 Web Application. I am also using
  

Spring


and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and
  

Apache


Commons-dbcp with HSql standalone-database)

As I am using HSql 'standalone' database, even if the web application
context gets reloaded, the database connection is not released while
destroying the context. So I get 'Database is already in use by other
process' error. I want to know whether there is any way to implement
something like destroy() method of servlet in a Struts2 application.

I am not sure whether I can do it with spring configuration. Any idea?
  

If


there are many ways of doing it, kindly also tell which way is the best
  

for


me.

(1) struts.properties:

struts.objectFactory =
  

org.apache.struts2.spring.StrutsSpringObjectFactory


(2) applicationContext.xml (my spring configuration file)

beans default-autowire=autodetect

bean id=myDataSource class=
  

org.apache.commons.dbcp.BasicDataSource


destroy-method=close
property name=driverClassName value=org.hsqldb.jdbcDriver
  

/


property name=url
value=jdbc:hsqldb:file:C:/Projects/db/hsqlTest /
property name=username value=sa/
property name=password value=/
/bean
bean id=mySessionFactory class=
org.springframework.orm.hibernate3.LocalSessionFactoryBean
property name=dataSource ref=myDataSource/
property name=mappingResources
list


  

 valueno/bbs/webservice/client/config/model/certificate.hbm.xml/value


/property
property name=hibernateProperties
props
prop key=hibernate.dialect
org.hibernate.dialect.HSQLDialect/prop
prop key=hibernate.show_sqltrue/prop
/props
/property
/bean

bean id=hibernateTemplate class=
org.springframework.orm.hibernate3.HibernateTemplate
property name=sessionFactory
ref bean=mySessionFactory/
/property
/bean
bean id=testClientDao class=
webservice.client.dao.hibernate.TestClientDAO
property name=hibernateTemplate
ref bean=hibernateTemplate/
/property
/bean
!-- Some Strus2-Actions follow --
/beans

(3) web.xml doesn't contain anything but struts2 filter declaration.

  

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





  


Re: Scope interceptor / Practical Apache Struts 2

2008-02-14 Thread Ian Roughley
I just re-ran my local version of the code without problems, and 
verified that the base class does have a getModel() and setModel() 
methods.  If you contact me off-list I can supply another copy of the 
code, that might be a resolution.  Did you have any problems running the 
code from chapter 5?


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Selckin wrote:

Hello,

In Chapter 6 of Practical Apache Struts 2 Web 2.0 Projects, It explains how 
to use the scope interceptor to create sort of wizard pages.
I've been trying to figure these out, but cannot get this to work.
Even the included example (downloadable from 
http://www.apress.com/book/view/1590599039 ) do not work for me.

I was hoping someone could try them and tell me if they are indeed broken or if 
i am doing something wrong. And what that might be?

Running the examples with no changes and when going to the second step in the 
workflow I get the following error:

HTTP ERROR: 500
Error setting expression 'model' with value '[EMAIL PROTECTED]'

RequestURI=/app/event/selectLocation!input.action
Caused by:
Error setting expression 'model' with value '[EMAIL PROTECTED]' - [unknown 
location]
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
at 
org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
at 
org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
 cut 
Caused by: No object in the CompoundRoot has a publicly accessible property 
named 'model' (no setter could be found). - [unknown location]
at 
com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 cut  
Can provide full stack trace if needed


The following is also outputted from the example.

SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'duration' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'duration' with value '[Ljava.lang.String;@602f892f'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'name' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'name' with value '[Ljava.lang.String;@50d79dfe'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'timeZoneOffset' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters

Thanks.

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

  


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



Re: Struts2 WebApp context

2008-02-13 Thread Ian Roughley
Implement the ServletContextListener and configure it in web.xml - this 
has the initialize and destroy methods you are looking for, and they are 
called when the container loads and destroys your application.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Rushikesh Thakkar wrote:

I want to release a database connection while reloading the context (using
Tomcat Manager web app) of a Struts2 Web Application. I am also using Spring
and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and Apache
Commons-dbcp with HSql standalone-database)

As I am using HSql 'standalone' database, even if the web application
context gets reloaded, the database connection is not released while
destroying the context. So I get 'Database is already in use by other
process' error. I want to know whether there is any way to implement
something like destroy() method of servlet in a Struts2 application.

I am not sure whether I can do it with spring configuration. Any idea? If
there are many ways of doing it, kindly also tell which way is the best for
me.

(1) struts.properties:

struts.objectFactory = org.apache.struts2.spring.StrutsSpringObjectFactory

(2) applicationContext.xml (my spring configuration file)

beans default-autowire=autodetect

bean id=myDataSource class=org.apache.commons.dbcp.BasicDataSource
destroy-method=close
property name=driverClassName value=org.hsqldb.jdbcDriver /
property name=url
value=jdbc:hsqldb:file:C:/Projects/db/hsqlTest /
property name=username value=sa/
property name=password value=/
/bean
bean id=mySessionFactory class=
org.springframework.orm.hibernate3.LocalSessionFactoryBean
property name=dataSource ref=myDataSource/
property name=mappingResources
list

 valueno/bbs/webservice/client/config/model/certificate.hbm.xml/value
/property
property name=hibernateProperties
props
prop key=hibernate.dialect
org.hibernate.dialect.HSQLDialect/prop
prop key=hibernate.show_sqltrue/prop
/props
/property
/bean

bean id=hibernateTemplate class=
org.springframework.orm.hibernate3.HibernateTemplate
property name=sessionFactory
ref bean=mySessionFactory/
/property
/bean
bean id=testClientDao class=
webservice.client.dao.hibernate.TestClientDAO
property name=hibernateTemplate
ref bean=hibernateTemplate/
/property
/bean
!-- Some Strus2-Actions follow --
/beans

(3) web.xml doesn't contain anything but struts2 filter declaration.

  


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



[ANN] Struts2 Workshop: April 28-30, Sunnyvale CA

2008-02-11 Thread Ian Roughley
We are pleased to announce a Struts2 workshop, from April 28-30 in 
Sunnyvale, CA.  Join us the week before JavaOne to learn about the next 
generation of evolution of the Struts web framework.


In this three day workshop-style training course you'll learn everything 
you need to know to effectively write applications using Struts2. We'll 
take a practical and hands-on approach, dividing the time into 40% 
theory and 60% exercises.  Our instructor, Ian Roughley, has extensive 
experience developing Struts2 applications; is a committer on the Apache 
Struts2 project; and is the author of Practical Apache Struts2 Web 2.0 
Projects.


Over this three day workshop you'll learn:
- Struts2 architecture and how you can take advantage of the features in 
your applications

- How to use existing domain models in your actions
- XML, annotation, and convention-based configuration
- How to create user-friendly URLs and REST interfaces
- Strategies for storing application state
- Techniques for creating wizards and using conversation scopes
- How to test your web applications
- Ways to expedite user interface creation using themes and templates
- How to secure your applications
- Available Ajax tags, how to integrate Ajax libraries, and how to 
return JSON  XML data

- Creating plug-ins to reuse common code
- How to integrate Struts2 into Spring and J2EE application stacks
- Getting the most out of Struts2 with tips, tricks, and best practices

As a special promotion, if you register before March 14th, you will 
receive a discounted price of $1350 - a $300 savings off the regular 
workshop price of $1650.


For more information and to register, visit 
http://www.fdar.com/training/struts2.


--

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]


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



Re: Struts training...

2008-01-08 Thread Ian Roughley
I'm looking into providing some public training, at the moment I'm 
scouting out cities and locations that can accommodate training.  Of 
course, if its private training, then that's easy!


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Martin Gainty wrote:

pretty sure sun microsystems offers training in santa clara..is that too far
away?
http://developers.sun.com/events/techdays/self_paced_labs.jsp

anyone else?
M-
- Original Message -
From: Narayan Mandaleeka [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Monday, January 07, 2008 9:18 PM
Subject: Struts training...


  

Can some suggest a good training class for Struts around the Bay Area -


CA?
  

Thanks!
-Narayan





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

  


Re: S2: chart result type not recognized

2008-01-04 Thread Ian Roughley

How are you referencing the action?  I always use an img tag like this:

img src=serverIronLoadChart.action /

/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



John Cartwright wrote:

Hello All,

I'm having a little trouble getting a chart result type configured 
using the package declaration below.  Whenever I hit the associated 
URL, my browser prompts me to save a bin file  rather than 
displaying the chart.  The bin file is a valid png, but somehow Struts 
is not recognizing the returned type.  Can anyone suggest what I'm 
doing wrong?


Thanks!

-- john


package name=chart extends=jfreechart-default namespace=/chart
 action name=serverIronLoadChart
class=gov.noaa.eds.arcims.tng.action.ServerIronLoadChartAction
result type=chart
   param name=width400/param
   param name=height300/param
/result
 /action
  /package

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



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



Re: struts2: interceptor - validation doesn't work :-(

2008-01-04 Thread Ian Roughley

I didn't see an INPUT result configured, which will be needed.

/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Dave Newton wrote:

Please post the entire relevant code and configuration. I do this all the
time (annotating the getter, though, as Wes said) and don't have any
problems. You're extending ActionSupport?

d.

--- xianwinwin [EMAIL PROTECTED] wrote:

  

thanks wes, I tried this manipulation - didnt work
:-(



Wes Wannemacher wrote:


Try annotating the getter rather than the setter.

-Wes

On 1/3/08, xianwinwin [EMAIL PROTECTED] wrote:
  

yes i did :super:



newton.dave wrote:


Did you annotate the class with the @Validation() annotation?

d.

--- xianwinwin [EMAIL PROTECTED] wrote:

  

I've been struggling with this issue for a while and any pointer


would


be


appreciated.

I have a simple file with one field -name; I would like to validate


that


the
user put information in it.

I'm using the annotation in order to achieve this but for some reason


the


validation doesn't work (there's no return message that the user did


not


provide the info).

my file looks like this:


 @RequiredStringValidator(message=name is missing)
 public void setName(String name)
 {
 this.name=name;
 }


in the jsp page:
...
 s:textfield name=name label=your name: /



in the xml:
action name=UserTest_*  method={1}
class=com.simple.validation.Test
result name=error/pages/error.jsp/result
result name=success/pages/welcome.jsp/result

interceptor-ref name=guest/
/action


the guest interceptor is:
interceptor-stack name=guest 
interceptor-ref name=defaultStack/
/interceptor-stack

any idea?

--
View this message in context:



http://www.nabble.com/struts2%3A-interceptor---validation-doesn%27t-work-%3A-%28-tp14607863p14607863.html
  

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


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




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



  

--
View this message in context:



http://www.nabble.com/struts2%3A-interceptor---validation-doesn%27t-work-%3A-%28-tp14607863p14609244.html
  

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


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




--
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

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



  

--
View this message in context:



http://www.nabble.com/struts2%3A-interceptor---validation-doesn%27t-work-%3A-%28-tp14607863p14610928.html
  

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


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






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

  


Re: Question about validation mechanism

2007-12-19 Thread Ian Roughley
The validator interceptor doesn't do anything.  If you are using the s2 
tags, then the getter matching the name attribute will be called on the 
action or model.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Jeremy JGR. Grumbach wrote:

Hi,

 


I have a page add.jsp with a form and lots of fields. I have added a
validation in my struts configuration to validate the form.

During the form validation, if an error is detected, then an action
error is added to the request and struts redirects to the input
forward. In most of cases, it is the add.jsp page. And all the fields
that the user has entered are still there.

Does anybody know how the validator interceptor does to keep the values
that the user has entered?

 


Thanks in advance,

 


Jeremy

 

 



  


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



Re: New to Struts

2007-12-17 Thread Ian Roughley


bhaarat Sharma wrote:

I am reading Practical struts2 web 2.0 projects book.  I dont have a
lot of nice things to say 

Please contact me off list.  I am interested in why you have this opinion.

about the book but its practically the
complete struts2 book thats out there.

  


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



Re: New to Struts

2007-12-17 Thread Ian Roughley

Dave Newton wrote:

--- Ian Roughley [EMAIL PROTECTED] wrote:
  

bhaarat Sharma wrote:


I am reading Practical struts2 web 2.0 projects book.  I dont have a
lot of nice things to say 
  

Please contact me off list.  I am interested in why you have this opinion.



Doesn't mean he has *bad* things to say ;)
  
:-)  It's definitely not a reference book, with each and every tag, 
plug-in and attribute, and due to deadlines I missed some content I 
wanted in myself... so I'm just curious as to what he thought was wrong.

d.


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

  


Re: Is Struts2 ready for prime time?

2007-12-13 Thread Ian Roughley


Finally, in terms of education, there's some good books out now and 
there's a lot of sites providing tutorials (that reminds me, I'm going 
to order Ian's book today[1]).  However, I don't know of any 
professional training courses yet and there's far fewer developers 
already knowledgeable on S2 than S1.
Like Ted, I'm also putting together training options - specifically a 
quick start for s1 developers who want to get up and running with s2.  
So it would cover all the basics, as well as the more advanced 
features.  I'm also considering running it as public training rather 
than private - if any one has interest (haven't settled on cities yet), 
drop me a line off-list ([EMAIL PROTECTED]).


/Ian

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



Re: I18N problem

2007-12-05 Thread Ian Roughley
You should probably try using the key rather than the label 
attribute, I'm not even sure whether it will accept OGNL:


s:textfield key=blabla/


--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Angel Gruev wrote:

Hello

I have read the guide for internationalization but still I cannot get it
running.
1. I have a property file with internationalization data called 
ApplicationResources.properties (used for the old struts 1 applicaiton)
   There is a line blabla = test

2. In the struts.properties file I have added:
  struts.i18n.reload = true
  struts.custom.i18n.resources=ApplicationResources.properties

3. In the action configuraion i have added :
  interceptor-ref name=defaultStack /   (this stack contains the i18n
interceptor

4. In the jsp I have added:
  s:textfield label=%{getText('blabla')}/

The result is blabla , not test as expected.

Any ideas ?

Angel Gruev

  


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



Re: Practical Apache Struts2 - compile fails on annotation

2007-11-29 Thread Ian Roughley
This is chapter 3, right?  I just ran the command mvn clean compile 
from my local copy and everything compiles correctly.  Are you compiling 
from an IDE?  If so,  do you have all the JAR files in the project? 


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Robert Harrison wrote:

Dear All,
I am working through Roughley's book (Struts-2.0.9) and am having trouble
with the first example using annotations. The stack trace I get is:
December 10, 2007

December 10, 2007

org.apache.maven.BuildFailureException: Compilation failure

/home/rharri/workspace/app/src/main/java/com/fdar/apress/s2/ZCAction.java:[5,1]
cannot find symbol

symbol: class Result

@Result(name=success,value=/jsp/success.jsp,type=
ServletDispatcherResult.class)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:560)

at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:480)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:459)

at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:311)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation
failure

/home/rharri/workspace/app/src/main/java/com/fdar/apress/s2/ZCAction.java:[5,1]
cannot find symbol

symbol: class Result

@Result(name=success,value=/jsp/success.jsp,type=
ServletDispatcherResult.class)

at org.apache.maven.plugin.AbstractCompilerMojo.execute(
AbstractCompilerMojo.java:516)

at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)

at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:443)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)

... 16 more


Here is the relevant portion of web.xml:

filter-namestruts2/filter-name
filter-classorg.apache.struts2.dispatcher.FilterDispatcher
/filter-class
init-param
  param-nameactionPackages/param-name
  param-valuecom.fdar.apress.s2,com.apress.s2/param-value
/init-param
  /filter

(there is no filter mapping for struts2)


I can't find any setup differences in the Struts Wiki. The only similar
error I found using Google suggested  deleting the Struts and openSymphony
jars. I did and Maven re-installed the jars and gave the same error.


Please, what simple/stupid thing am I missing?


  


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



Re: Practical Apache Struts2 - compile fails on annotation

2007-11-29 Thread Ian Roughley
Weird.  I opened the ZCAction.java file, and I can see the imports right 
there :-)


--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Robert Harrison wrote:

Ian/Dave,
Thanks for the advice.  I constructed the project from the command line
using Maven2 (First time).  My OS is Suse10.0.  I have imported the  project
into Eclipse but  I've just used the IDE for editing and hints and have
still used the command line  for compilation.

The ZCAction.java file compiles if I import org.apache.struts2.config.Resultand
org.apache.struts2.dispatcher.ServletDispatcherResult (both suggested by
Eclipse). But both these classes are in the Struts2 core jar which is in the
Maven repository. File ownership and permissions are set correctly as well.

Bob

On Nov 29, 2007 1:01 PM, Ian Roughley [EMAIL PROTECTED] wrote:

  

This is chapter 3, right?  I just ran the command mvn clean compile
from my local copy and everything compiles correctly.  Are you compiling
from an IDE?  If so,  do you have all the JAR files in the project?

/Ian

--
Ian Roughley
From Down  Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Robert Harrison wrote:


Dear All,
I am working through Roughley's book (Struts-2.0.9) and am having
  

trouble


with the first example using annotations. The stack trace I get is:
December 10, 2007

December 10, 2007

org.apache.maven.BuildFailureException: Compilation failure


  

/home/rharri/workspace/app/src/main/java/com/fdar/apress/s2/ZCAction.java:[5,1]


cannot find symbol

symbol: class Result

@Result(name=success,value=/jsp/success.jsp,type=
ServletDispatcherResult.class)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:560)

at

  

org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle


(DefaultLifecycleExecutor.java:480)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:459)

at

  

org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures


(DefaultLifecycleExecutor.java:311)

at
  

org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(


DefaultLifecycleExecutor.java:278)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(
  

NativeMethodAccessorImpl.java


:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Caused by: org.apache.maven.plugin.CompilationFailureException:
  

Compilation


failure


  

/home/rharri/workspace/app/src/main/java/com/fdar/apress/s2/ZCAction.java:[5,1]


cannot find symbol

symbol: class Result

@Result(name=success,value=/jsp/success.jsp,type=
ServletDispatcherResult.class)

at org.apache.maven.plugin.AbstractCompilerMojo.execute(
AbstractCompilerMojo.java:516)

at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)

at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:443)

at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)

... 16 more


Here is the relevant portion of web.xml:

filter-namestruts2/filter-name
filter-classorg.apache.struts2.dispatcher.FilterDispatcher
/filter-class
init-param
  param-nameactionPackages/param-name
  param-valuecom.fdar.apress.s2,com.apress.s2/param-value
/init-param
  /filter

(there is no filter mapping for struts2)


I can't find any setup differences in the Struts Wiki. The only similar
error I found using Google suggested  deleting the Struts and
  

openSymphony


jars. I did and Maven re-installed the jars and gave the same error.


Please, what simple/stupid thing am I missing?



  

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





  


[ANN] Javapolis 2007

2007-11-26 Thread Ian Roughley

Hi everyone;

The announcement: for those attending Javapolis, I will be presenting a 
university session on Struts2 this year, on Tuesday December 2007.  
Originally, I was speaking to the organizers about a BOF session, but it 
seems like other topics have taken priority.  

The question: for those that are not officially attending Javapolis, 
and those that are, is anyone interested in an informal get together 
during the conference?  Meet some new people, have some beers, and maybe 
even talk about Struts2.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-24 Thread Ian Roughley

No idea.  I can check though.

/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Ted Husted wrote:

Amazon is showing the book as available now! yeah!

If you order through this link, the commission on the sale will be
donated to the ASF.

 * http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-1590599039

Ian, any word on whether Apress will be making their books available
for the Kindle?

-Ted.

On Nov 20, 2007 1:31 PM, Ian Roughley [EMAIL PROTECTED] wrote:
  

I'm pleased to announce the release of my newest book, Practical Apache
Struts2 Web 2.0 project.  And, no, I didn't pick the name :-)

Where Starting Struts2 was high level and provided pointers for
further exploration, this book dives deep into the framework providing a
practical guide and lots of code examples for developing web application
using Struts2.  For those that are new to the framework, there is
information on getting started, the request/response life cycle, and
architecture and configuration (XML and zero configuration/annotation).
And for those that are familiar with Struts2, more advanced topics such
as security (yes, container, custom and Acegi are all provided with
example code), workflows/wizards, RESTful web services, and Ajax are
covered.

For more information, the Apress web site is
http://www.apress.com/book/view/9781590599037.  I also believe it will
be available through most major bookstores.

/Ian

--
Ian Roughley
From Down  Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



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

  


Re: is there any book on struts 2 in the market.................

2007-11-24 Thread Ian Roughley
Practical Apache Struts2 Web 2.0 Project was published a few days ago.  
You can purchase it via Apache at


http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-1590599039

/Ian 


--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



wicketshafi wrote:

Hello,,

is there any book on struts2 in the market...

if it is there please send a message.

regards
-Shafi
  


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-24 Thread Ian Roughley

Sure:

   * ISBN10: 1-59059-903-9
   * ISBN13: 978-1-59059-903-7

I'm also going to try to see if the publisher will release a different 
chapter as the example, I just noticed that they have used the first one 
- which is more of an introduction, and not a good example of what the 
rest of the book is like.


/Ian

--
Ian Roughley
From Down  Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Martin Gainty wrote:

Ian-
If you provide the ISBN some of us can do a quick search at local bookstoreThanks/Martin__Disclaimer and confidentiality noteEverything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.  No idea. I can check though.  /Ian  --  Ian Roughley From Down  Around, Inc. Consulting * Training / Mentoring * Agile Process * Open Source web: http://www.fdar.com - email: [EMAIL PROTECTED]Ted Husted wrote:  Amazon is showing the book as available now! yeah!   If you order through this link, the commission on the sale will be  donated to the ASF.   * http://opensource.atlassian.com/confluence/oss/display/BOOKS/ISBN-1590599039   Ian, any word on whether Apress will be making their books available  for the Kindle?   -Ted.   On Nov 20, 2007 1:31 PM, Ian Roughley [EMAIL PROTECTED] wrote:I'm pleased to announce the release of my newest book, Practical Apache  Struts2 Web 2.0 project. And, no, I didn't pick the name :-)   Where Starting Struts2 was high level and provided pointers for  further exploration, this book dives deep into the framework providing a  practical guide and lots of code examples for developing web application  using Struts2. For those that are new to the framework, there is  information on getting started, the request/response life cycle, and  architecture and configuration (XML and zero configuration/annotation).  And for those that are familiar with Struts2, more advanced topics such  as security (yes, container, custom and Acegi are all provided with  example code), workflows/wizards, RESTful web services, and Ajax are  covered.   For more information, the Apress web site is  http://www.apress.com/book/view/9781590599037. I also believe it will  be available through most major bookstores.   /Ian   --  Ian Roughley  From Down  Around, Inc.  Consulting * Training / Mentoring * Agile Process * Open Source  web: http://www.fdar.com - email: [EMAIL PROTECTED] -  To unsubscribe, e-mail: [EMAIL PROTECTED]  For additional commands, e-mail: [EMAIL PROTECTED]   
_

Put your friends on the big screen with Windows VistaĀ® + Windows Liveā„¢.
http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_102007
  


[ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-20 Thread Ian Roughley
I'm pleased to announce the release of my newest book, Practical Apache 
Struts2 Web 2.0 project.  And, no, I didn't pick the name :-)


Where Starting Struts2 was high level and provided pointers for 
further exploration, this book dives deep into the framework providing a 
practical guide and lots of code examples for developing web application 
using Struts2.  For those that are new to the framework, there is 
information on getting started, the request/response life cycle, and 
architecture and configuration (XML and zero configuration/annotation).  
And for those that are familiar with Struts2, more advanced topics such 
as security (yes, container, custom and Acegi are all provided with 
example code), workflows/wizards, RESTful web services, and Ajax are 
covered.


For more information, the Apress web site is 
http://www.apress.com/book/view/9781590599037.  I also believe it will 
be available through most major bookstores.


/Ian

--
Ian Roughley

From Down  Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]


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



Re: s2 and DispatchAction

2007-11-12 Thread Ian Roughley
I wonder if you could use OGNL, i.e. ${paramName}, although I have not 
tested it.


[EMAIL PROTECTED] wrote:

as far as I know, no  :-(

  

How can i use a parameter to choose wich action executed?

I have a crud action etc user.action
is it possible to choose the action  fires  with a paramenter like
user.action?action=list rather  than user!list.action?



[EMAIL PROTECTED] wrote:


using wildcard:

action name=/home_* method={1}

/action

action URL for method login: /home_login

see : http://struts.apache.org/2.x/docs/wildcard-mappings.html




  

Hello

In struts 1.x was using the DispatchAction  and with a parameter like
action choosed wich action executed. Is there a way to do thiw in S2?

tnx

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








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


  

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









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

  


Re: any struts 2 unit testers out there?

2007-10-29 Thread Ian Roughley
And 4 - have you looked in the source for unit tests testing this 
functionality?


Tom Schneider wrote:

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

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

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


Session Mwamufiya wrote:
  

Hi All,

Would someone let me know whether it's possible to tweak something so that
JUnit test code can run on an action method that calls the ActionSupport
method getText() to fetch string resources from a package.properties file. 
As it stands, I keep getting a null exception when getText() is called

during the unit test.

Thanks,
Session


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






  


Re: struts2 validation for only one method in action

2007-10-17 Thread Ian Roughley
you can always use s:submit name=method:delete value=Delete / and 
s:submit value=Execute / - then you don't need the logic to 
determine which button was clicked in the execute() method, and you can 
use the validation config below.


/ian

Igor Vlasov wrote:

This is not a solution.

I have 2 submit button in one form: one for save and another for delete. All
of them submit the form data to execute() method. There I can determine
which button was pressed and do  an appropriate bussines action.

The problem is that i must to validate the data when OK button is pressed
and  NOT validate when DEL button is pressed.


ros wrote:
  
For struts it's 
interceptor-ref name=validation

cancel,execute,delete,edit,list,print
/interceptor-ref

Hope this helps.

ros


Igor Vlasov wrote:


And how to disable the SERVER side validation when delete button clicked
?



ros wrote:
  
Java Script validation fro button disabled by 


s:submit cssClass=button method=delete key=button.delete
   
onclick=document.getElementById('ticketForm').onsubmit = null; /



ros wrote:


If I have in one form DELETE and SAVE buttons, how to turn off client
side validation for DELETE button?

  

  



  


Re: Adding the ability to include a validation xml file from another inside another validation xml file in Struts2

2007-10-10 Thread Ian Roughley
Have you looked at the visitor validator?  It might serve your purposes 
if the fields are on objects in the action.


/Ian

Arup Francis wrote:

Hi,

   We have this problem of having to repeat certain validations for the same
fields in multiple validation xml files because they occur in multiple
scenarios and we have different validation files for the different
scenarios. Now this brings about duplication of code in the sense that in
future if I need to modify the validation for the fields then I have to do
it in multiple files which is quite a pain. I was thinking that if it was
possible to have the ability to include one validation file within another
validation xml then it would help us in removing the duplication of code
because I could define the validation for the fields in a single file and
then include that file in the multiple scenario validation files.

Its something like the s:include / that you have for the struts.xml using
which you can include other struts configuration files.

Struts 2 gurus - Please let me know on what you feel about this.
Maybe this can be added as an enhancement in future versions of struts2.

Arup
  


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



Re: Bug in 2.0.9 regarding validation localization?

2007-10-09 Thread Ian Roughley
I can confirm that it works.  Do you have the struts-messages.properties 
defined as an additional properties file in struts.xml?  This is not a 
standard property file name that is picked up by default.


/Ian

Dean Pullen wrote:

Further to my message below,
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey() method
hasn't been implemented until 2.0.8.

Can anyone confirm that they have localized validation working, as
below, with 2.0.9?

Thanks,

Dean.

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 19:23

To: Struts Users Mailing List
Subject: RE: Validation problem - key not found?

I've tried adding a package.properties with the same key but nothing
seems to help - I still seem to get the same exception.

Anyone?

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 18:08

To: Struts Users Mailing List
Subject: Validation problem - key not found?

 


Hi all.

 


Trying to do this:

 


@RequiredStringValidator(message = Hello, key = Hello.key)

public String getQuestion1Option()

{

return question1Option;

}

 

 


But receiving this error on submission of the action:

 


[09 Oct 2007 17:54:46] ERROR
org.apache.catalina.core.ContainerBase.[jboss.web].

[localhost].[/csi].[default]  - Servlet.service() for servlet default
threw exce

ption

java.lang.NullPointerException

at
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey(Locali

zedTextUtil.java:240)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findResourceBundle(Loc

alizedTextUtil.java:219)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTe

xtUtil.java:602)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findMessage(LocalizedT

extUtil.java:643)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:360)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:293)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:173)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:104)

at
com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:75)

at
com.opensymphony.xwork2.validator.DelegatingValidatorContext.getText(

DelegatingValidatorContext.java:106)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess

age(ValidatorSupport.java:66)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.addFiel

dError(ValidatorSupport.java:162)

at
com.opensymphony.xwork2.validator.validators.RequiredStringValidator.

validate(RequiredStringValidator.java:77)

 


etc

 

 


Any idea what's wrong? The key is in my struts-messages.properties and
struts-messages_en.properties

 


Cheers



Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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

  


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



Re: Bug in 2.0.9 regarding validation localization?

2007-10-09 Thread Ian Roughley
Now I know that it works with package.properties.  Have you tried using 
a key without a period?


/Ian

Dean Pullen wrote:

Even adding a package.properties or even a className.properties (where
className is my Action class name) doesn't resolve the problem.

This is a huge sticking point for me, I sincerely hope someone can help.

Dean.

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 20:05

To: Struts Users Mailing List
Subject: RE: Bug in 2.0.9 regarding validation localization?

Thanks Ian.

This is in struts.xml:
struts.custom.i18n.resources=struts-messages

If thats what you mean?

I get other localized properties from it no problem, e.g. using s:text
name=key.here /



-Original Message-
From: Ian Roughley [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 19:48

To: Struts Users Mailing List
Subject: Re: Bug in 2.0.9 regarding validation localization?

I can confirm that it works.  Do you have the struts-messages.properties

defined as an additional properties file in struts.xml?  This is not a 
standard property file name that is picked up by default.


/Ian

Dean Pullen wrote:
  

Further to my message below,
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey()


method
  

hasn't been implemented until 2.0.8.

Can anyone confirm that they have localized validation working, as
below, with 2.0.9?

Thanks,

Dean.

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 19:23

To: Struts Users Mailing List
Subject: RE: Validation problem - key not found?

I've tried adding a package.properties with the same key but nothing
seems to help - I still seem to get the same exception.

Anyone?

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 18:08

To: Struts Users Mailing List
Subject: Validation problem - key not found?

 


Hi all.

 


Trying to do this:

 


@RequiredStringValidator(message = Hello, key = Hello.key)

public String getQuestion1Option()

{

return question1Option;

}

 

 


But receiving this error on submission of the action:

 


[09 Oct 2007 17:54:46] ERROR
org.apache.catalina.core.ContainerBase.[jboss.web].

[localhost].[/csi].[default]  - Servlet.service() for servlet default
threw exce

ption

java.lang.NullPointerException

at
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey(Locali

zedTextUtil.java:240)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findResourceBundle(Loc

alizedTextUtil.java:219)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTe

xtUtil.java:602)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findMessage(LocalizedT

extUtil.java:643)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:360)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:293)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:173)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:104)

at
com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:75)

at
com.opensymphony.xwork2.validator.DelegatingValidatorContext.getText(

DelegatingValidatorContext.java:106)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess

age(ValidatorSupport.java:66)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.addFiel

dError(ValidatorSupport.java:162)

at
com.opensymphony.xwork2.validator.validators.RequiredStringValidator.

validate(RequiredStringValidator.java:77)

 


etc

 

 


Any idea what's wrong? The key is in my struts-messages.properties and
struts-messages_en.properties

 


Cheers



Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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

  



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


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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

  


Re: Bug in 2.0.9 regarding validation localization?

2007-10-09 Thread Ian Roughley
what is the values of struts.locale, and does the SalesSurveyAction 
extend ActionSupport or does your action implement the TextProvider and 
LocaleProvider interfaces?


Also, do you have struts.i18n.reload=true, or are you restarting the app 
server after each modification?


/Ian

Dean Pullen wrote:

Just to refresh, we now have:

@RequiredStringValidator(message = hello, key = hello)
public String getQuestion1Option()
{
return question1Option;
}

In class: SalesSurveyAction, in package: com.msp.web.csi.surveys.sales

I have a SalesSurveyAction.properties and a package.properties, (exact
naming), in the same folder.

They both contain: hello=Hello



-Original Message-
From: Ian Roughley [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 21:00

To: Struts Users Mailing List
Subject: Re: Bug in 2.0.9 regarding validation localization?

Now I know that it works with package.properties.  Have you tried using 
a key without a period?


/Ian

Dean Pullen wrote:
  

Even adding a package.properties or even a className.properties (where
className is my Action class name) doesn't resolve the problem.

This is a huge sticking point for me, I sincerely hope someone can


help.
  

Dean.

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 20:05

To: Struts Users Mailing List
Subject: RE: Bug in 2.0.9 regarding validation localization?

Thanks Ian.

This is in struts.xml:
struts.custom.i18n.resources=struts-messages

If thats what you mean?

I get other localized properties from it no problem, e.g. using


s:text
  

name=key.here /



-Original Message-
From: Ian Roughley [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 19:48

To: Struts Users Mailing List
Subject: Re: Bug in 2.0.9 regarding validation localization?

I can confirm that it works.  Do you have the


struts-messages.properties
  

defined as an additional properties file in struts.xml?  This is not a



  

standard property file name that is picked up by default.

/Ian

Dean Pullen wrote:
  


Further to my message below,
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey()

  

method
  


hasn't been implemented until 2.0.8.

Can anyone confirm that they have localized validation working, as
below, with 2.0.9?

Thanks,

Dean.

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 19:23

To: Struts Users Mailing List
Subject: RE: Validation problem - key not found?

I've tried adding a package.properties with the same key but nothing
seems to help - I still seem to get the same exception.

Anyone?

-Original Message-
From: Dean Pullen [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 18:08

To: Struts Users Mailing List
Subject: Validation problem - key not found?

 


Hi all.

 


Trying to do this:

 


@RequiredStringValidator(message = Hello, key = Hello.key)

public String getQuestion1Option()

{

return question1Option;

}

 

 


But receiving this error on submission of the action:

 


[09 Oct 2007 17:54:46] ERROR
org.apache.catalina.core.ContainerBase.[jboss.web].

[localhost].[/csi].[default]  - Servlet.service() for servlet default
threw exce

ption

java.lang.NullPointerException

at
com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey(Locali

zedTextUtil.java:240)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findResourceBundle(Loc

alizedTextUtil.java:219)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTe

xtUtil.java:602)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findMessage(LocalizedT

extUtil.java:643)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:360)

at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedText

Util.java:293)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:173)

at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSuppo

rt.java:104)

at
com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:75)

at
com.opensymphony.xwork2.validator.DelegatingValidatorContext.getText(

DelegatingValidatorContext.java:106)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMess

age(ValidatorSupport.java:66)

at
com.opensymphony.xwork2.validator.validators.ValidatorSupport.addFiel

dError(ValidatorSupport.java:162)

at
com.opensymphony.xwork2.validator.validators.RequiredStringValidator.

validate(RequiredStringValidator.java:77)

 


etc

 

 


Any idea what's wrong? The key is in my struts-messages.properties
  

and
  

struts-messages_en.properties

 


Cheers



Scanned by MailDefender - managed email security from intY -
www.maildefender.net

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

Re: ModelDriven Resource Bundle not working ?

2007-10-08 Thread Ian Roughley
Model properties files are used for supplying field description and 
validation messages for a model object.  I know it works ;-)  but I 
don't know how you are using it from the code supplied.


/Ian

Dave Newton wrote:

Hmm, in the docs [1] it says that it will search for
ModelDriven's model, although I haven't tried it
myself.

d.

[1]
http://struts.apache.org/2.x/docs/localization.html

--- Zarar Siddiqi [EMAIL PROTECTED] wrote:

  

I thought you could only specify properties files
for action beans,
not model ones. So in your case try specifying
PersonneFilterAction.properties

Zarar


On 10/8/07, pilou [EMAIL PROTECTED] wrote:


hi
I noticed that the property bundles named with the
  

Model Bean class name


does not seem to work.
Here is my example :
the bean class and bundle and action class are in
  

the same package,


Bundles name = PersonneFilterBean.properties

Java sources for the bean =
==

package exemple.action.admin;

public class PersonneFilterBean {

   private String nom;
   private Integer age;

   public String getNom() {
  return nom;
   }

   public void setNom(String nom) {
  this.nom = nom;
   }

   public Integer getAge() {
  return age;
   }

   public void setAge(Integer age) {
  this.age = age;
   }
}


Java source for the ACTION =
==

public class PersonneFilterAction extends
  

ExempleAction implements


ModelDrivenPersonneFilterBean {

   private static final long serialVersionUID =
  

-2355406819601885551L;


   private PersonneFilterBean m_personneFilterBean
  

= new


PersonneFilterBean();

   @Override
   public String execute() throws Exception {
  getLog().debug(OK success !);
  return SUCCESS;
   }

   public PersonneFilterBean getModel() {
  getLog().debug(OK success !);
  return m_personneFilterBean;
   }
}


thanks for help
--
View this message in context:
  

http://www.nabble.com/ModelDriven-Resource-Bundle-not-working---tf4588469.html#a13097564
  

Sent from the Struts - User mailing list archive
  

at Nabble.com.



  

-
  

To unsubscribe, e-mail:
  

[EMAIL PROTECTED]


For additional commands, e-mail:
  

[EMAIL PROTECTED]

  


-
  

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






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

  


Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
Is the exception occurring during the call to execute() (or equivalent) 
business logic method?  This is where the exception handler interceptor 
is applied.  It seems like the exception you are receiving is from a 
rendering phase outside the execution of the actions logic.


/Ian

mikeh96 wrote:

Thanks for taking the time.. unfortunately, the exceptions are still
percolating up.
Do you have it working?  





Brian Trzupek wrote:
  
I am not 100% sure on this, but I think you need to have  
struts.devMode = false in struts.properties.


Give that a whirl.

Brian-

On Sep 30, 2007, at 9:43 PM, mikeh96 wrote:


I am unable to trap an exception and it's being pushed up until it  
becomes a

500 Servlet Exception.

Basically, I want to catch the exception if a user mistypes an  
action name


I am using struts2 (2.0.9).

Here's the top of the trace:
org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource '/templates/screens/inddd2ex.vm'
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource( 
ResourceManagerImpl.java:458)


Here's my struts.xml file

(thanks for helping)

package name=default extends=struts-default

interceptors
interceptor-stack name=simpleStack
interceptor-ref name=defaultStack /
/interceptor-stack
/interceptors


global-results
result name=Exception type=velocity
  

/templates/screens/exception.vm/result


/global-results

global-exception-mappings
exception-mapping
   exception=java.lang.Exception
   result=Exception/
exception-mapping
   exception=org.apache.velocity.exception.ResourceNotFoundException
   result=Exception/
exception-mapping
   exception=java.lang.Runtime
   result=Exception/
/global-exception-mappings


action name=* class=com.opensymphony.xwork2.ActionSupport
interceptor-ref name=exception /
interceptor-ref name=defaultStack /
result type=velocity/templates/screens/{1}.vm/result
/action

/package
-- 
--

--
View this message in context: http://www.nabble.com/Struts-2%3A-- 
Unable-to-catch-exceptions-via-global-exception-mappings- 
tf4545971.html#a12972599

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


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

  

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






  


Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
The result is executed after the interceptors and after the action has 
executed.  Look at the invoke() method on the DefaultActionInvocation 
class.  Therefore, because your exception is in rendering the result, 
the exception is not managed by the interceptor.  If you threw the same 
exception from within the execute() method of an action, it would be 
handled as you are expecting.


I think this comes down to the reasoning behind the interceptor.  I see 
it as a means to manage the run-time business logic, and not 
developer-based configuration which will usually be managed during the 
construction phase.


/Ian

mikeh96 wrote:

thanks for looking.  I pasted the full stack trace below.   I am not using
any home grown action code (yet). This is coming from the
DefaultActionSupport during the rendering stage.

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)

Do I need to subclass and do something in the action.execute() code ?


here's the full trace

org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at
org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:491)
at
org.apache.struts2.dispatcher.VelocityResult.getTemplate(VelocityResult.java:221)
at
org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:150)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
at 
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
at java.lang.Thread.run(Thread.java:613)



Ian Roughley wrote:
  
Is the exception occurring during the call to execute() (or equivalent) 
business logic method?  This is where the exception handler interceptor 
is applied.  It seems like the exception you are receiving is from a 
rendering phase outside the execution of the actions logic.


/Ian



mikeh96 wrote:


Thanks for taking the time.. unfortunately, the exceptions are still
percolating up.
Do you have it working?  





Brian Trzupek wrote:
  
  
I am not 100% sure on this, but I think you need to have  
struts.devMode = false in struts.properties.


Give that a whirl.

Brian-

On Sep 30, 2007, at 9:43 PM, mikeh96 wrote:



I am unable to trap an exception and it's being pushed up until it  
becomes a

500 Servlet Exception.

Basically, I want to catch the exception if a user mistypes an  
action name


I am using struts2 (2.0.9).

Here's the top of the trace:
org.apache.velocity.exception.ResourceNotFoundException:
Unable to find resource '/templates/screens/inddd2ex.vm'
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource( 
ResourceManagerImpl.java:458)


Here's my struts.xml file

(thanks for helping)

package name=default extends=struts-default

interceptors
interceptor-stack name=simpleStack
interceptor-ref name=defaultStack /
/interceptor-stack
/interceptors


global-results
result name=Exception type=velocity
  
  

/templates/screens/exception.vm/result



/global-results

global-exception-mappings
exception-mapping
   exception=java.lang.Exception
   result=Exception/
exception-mapping
   exception=org.apache.velocity.exception.ResourceNotFoundException

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley

Yes, that's definitely a valid approach.

I guess the question I have is how are you using the feature?  It 
looks like you are simply providing a pass-through to view a velocity 
template that is the same as the action name.  Are you expecting the 
user to make a request to a template that will not exist?  I find that 
most of the time, once construction is complete, exceptions such as the 
one you are getting are never thrown, because the paths through the site 
are well know.


/Ian

mikeh96 wrote:

Thanks for the clarification.  Is the solution of extending VelocityResult
and configuring it with a 
template name to return (e.g. 404.vm)  if the requested template throws the
ResourceNotFoundException 
a viable one ?  Or is there a way to handle this more elegantly ?


thanks again for your time!

mike



Ian Roughley wrote:
  
The result is executed after the interceptors and after the action has 
executed.  Look at the invoke() method on the DefaultActionInvocation 
class.  Therefore, because your exception is in rendering the result, 
the exception is not managed by the interceptor.  If you threw the same 
exception from within the execute() method of an action, it would be 
handled as you are expecting.


I think this comes down to the reasoning behind the interceptor.  I see 
it as a means to manage the run-time business logic, and not 
developer-based configuration which will usually be managed during the 
construction phase.


/Ian

mikeh96 wrote:


thanks for looking.  I pasted the full stack trace below.   I am not
using
any home grown action code (yet). This is coming from the
DefaultActionSupport during the rendering stage.

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)

Do I need to subclass and do something in the action.execute() code ?


here's the full trace

org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at
org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:491)
at
org.apache.struts2.dispatcher.VelocityResult.getTemplate(VelocityResult.java:221)
at
org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:150)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
at java.lang.Thread.run(Thread.java:613)



Ian Roughley wrote:
  
  
Is the exception occurring during the call to execute() (or equivalent) 
business logic method?  This is where the exception handler interceptor 
is applied.  It seems like the exception you are receiving is from a 
rendering phase outside the execution of the actions logic.


/Ian



mikeh96 wrote:



Thanks for taking the time.. unfortunately, the exceptions are still
percolating up.
Do you have it working?  





Brian Trzupek wrote:
  
  
  
I am not 100% sure on this, but I think you need to have  
struts.devMode = false in struts.properties.


Give that a whirl.

Brian-

On Sep 30, 2007, at 9:43 PM, mikeh96 wrote:




I am unable to trap an exception and it's being pushed up until it  
becomes a

500 Servlet Exception.

Basically, I want to catch the exception if a user mistypes an  
action name


I am using

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley

I have no ideas about that one :)

mikeh96 wrote:

You are right... I am just trying to catch those rare events.

Now here's something crazy:  (and I have checked, and double checked,
restarted server, etc).
BUT if I add a  to my action, the exception mapping WORKS.  If I take it
away, the exception is not caught.

action name=* class=com.opensymphony.xwork2.ActionSupport
  bar
  interceptor-ref name=exception /
  interceptor-ref name=defaultStack /
  result type=velocity/templates/screens/{1}.vm/result
/action

That works like a charm, remove the foo/bar and I get 500 error.  struts.xml
file is the same as I posted.

Any ideas?


Ian Roughley wrote:
  

Yes, that's definitely a valid approach.

I guess the question I have is how are you using the feature?  It 
looks like you are simply providing a pass-through to view a velocity 
template that is the same as the action name.  Are you expecting the 
user to make a request to a template that will not exist?  I find that 
most of the time, once construction is complete, exceptions such as the 
one you are getting are never thrown, because the paths through the site 
are well know.


/Ian

mikeh96 wrote:


Thanks for the clarification.  Is the solution of extending
VelocityResult
and configuring it with a 
template name to return (e.g. 404.vm)  if the requested template throws

the
ResourceNotFoundException 
a viable one ?  Or is there a way to handle this more elegantly ?


thanks again for your time!

mike



Ian Roughley wrote:
  
  
The result is executed after the interceptors and after the action has 
executed.  Look at the invoke() method on the DefaultActionInvocation 
class.  Therefore, because your exception is in rendering the result, 
the exception is not managed by the interceptor.  If you threw the same 
exception from within the execute() method of an action, it would be 
handled as you are expecting.


I think this comes down to the reasoning behind the interceptor.  I see 
it as a means to manage the run-time business logic, and not 
developer-based configuration which will usually be managed during the 
construction phase.


/Ian

mikeh96 wrote:



thanks for looking.  I pasted the full stack trace below.   I am not
using
any home grown action code (yet). This is coming from the
DefaultActionSupport during the rendering stage.

com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)

Do I need to subclass and do something in the action.execute() code ?


here's the full trace

org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at
org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:491)
at
org.apache.struts2.dispatcher.VelocityResult.getTemplate(VelocityResult.java:221)
at
org.apache.struts2.dispatcher.VelocityResult.doExecute(VelocityResult.java:150)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:73)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
at java.lang.Thread.run(Thread.java:613)



Ian Roughley wrote:
  
  
  

Is the exception occurring during the call to execute() (or
equivalent) 
business logic method?  This is where the exception handler
interceptor

Re: JAAS struts 2 Tutorial?

2007-09-24 Thread Ian Roughley
You can find the key features of acegi here - 
http://www.acegisecurity.org/. 

I see the advantages as being able to customize the authentication and 
authorization from within the scope of the web application, and not 
external configuration via an app server.  But then, this also depends 
on the app server.


/Ian

wild_oscar wrote:

In the web app I'm currently developing (which uses JAAS authentication),
I've done the following:

1) Create an HttpServletRequestWrapper to override the isUserInRole method
2) Create an AnnotationRoles class to annotate my actions if they require
particular roles
3) Create an AnnotationRolesInterceptor (as described in this forum) to
determine if the user has the role required by the annotation

What are the advantages of using acegi over this custom implementation? And
what is the license model of acegi?


Ian Roughley wrote:
  
If you are not using container managed persistence, where the 
HttpRequest values are being set in the environment, you probably don't 
want to use the Principal or PrincipalAware interface, or even to wrap 
the HttpServletRequest (this email was in response to using a servlet 
wrapper to re-implement code already present in s2).


Options I've used are creating an interceptor to access the security 
context (I've not used JAAS personally), and then create an annotation 
to signify actions/methods that need security information assigned to 
them.  The same annotation, or another, could also be used to 
declaratively configure those actions that require a specific role from 
the security context in order to be invoked.


/Ian

Chris Pratt wrote:


On 9/18/07, Ian Roughley [EMAIL PROTECTED] wrote:
  
  

By implementing the PrincipalAware interface, the Principal object will
be injected into the action with those values from the request (the
user, roles, etc.).  The values can be be used in the action, or the
Principal can be exposed with a setter for the actions to use.




But if you don't use Container Managed Authentication, how do you get
the Principal into the request so that PrincipalAware can inject it,
without using a ServletFilter?
  (*Chris*)

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

  
  



  


Re: Bug in scenario

2007-09-24 Thread Ian Roughley
This is the fundamental way the value stack works - if it can't evaluate 
an expression at the topmost level, it starts to work it's way down 
until the expression can be evaluated. 

I guess my question really is why are you trying to set value on a null 
object?  It sounds to be like you need to:

(1) do the initialization in the prepare method, so the model is not null
(2) change the order of the stack, so that the model interceptor happens 
after the modelDriven interceptor


[EMAIL PROTECTED] wrote:

If your action class implements ModelDriven and Preparable and your prepare
method returns a null object, ParameterInterceptor tries to set the parms
which are names appropriate to properties in model object that is expected
to be on the top of stack.  However, since model was null, it was NOT SET on
top of the stack and all the parameters are now looked for in the action
class.  They are not found there (naturally) so all the parm setters fail.
Should the ModelDriven interceptor create a model when it is null?
  


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



Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Ian Roughley
By implementing the PrincipalAware interface, the Principal object will 
be injected into the action with those values from the request (the 
user, roles, etc.).  The values can be be used in the action, or the 
Principal can be exposed with a setter for the actions to use.


/Ian

Mark McLaren wrote:

Hi all,

I think this is a generic problem rather than something Struts 2
specific.  Ideally in this situation you would want to be able to
access getRemoteUser() and isUserInRole() from the request.

One approach is to use your application servers' container managed
security, e.g. Tomcat JAASRealm.

Alternatively, the best way I can come up with is by extending
HttpServletRequestWrapper so that you can perform a
setUserPrincipal(), setRemoteUser() (etc.) and then wrapping the
request with your HttpServletRequestWrapper inside a ServletFilter.
Here is a VERY simple example that I wrote of such a filter which sets
up a user called test using this idea.

https://bmarks-portlet.svn.sourceforge.net/svnroot/bmarks-portlet/bmarks-portlet/trunk/src/main/java/uk/ac/bris/portlet/bookmarks/web/SimpleAuthFilter.java

However, since this relies on a ServletFilter you will require a
slightly different mechanism for portlets.

Mark

On 9/17/07, Eugen Stoianovici [EMAIL PROTECTED] wrote:
  

I would like a tutorial on integrating jaas in struts2 too. Or rather
than a tutorial, i would like to see some working code. I've done a lot
of reading (i'm new to java web applications, it's been only a month
since i've started) and i have some understanding on how this should
work but i just can't picture it yet in a real app.

I know I'm not being helpful here, sorry. But if anyone wants to write a
tutorial on this, it would be greatly appreciated

regards
Eugen Stoianovici

Muhammad Momin Rashid wrote:


Hello Tom,

Thanks for your continued input.  The application isn't simple, it is
a J2EE application which will serve a large number of users (users
will be using Web Browser or Mobile Device to access the application).

Based on the help I got on this list, I have been successful in
setting up JAAS and authenticating the user.

Now I am just not sure if the user credentials are being kept.
Following is the code I wrote which processes the user's login.  Can
you see what I am missing?  I have placed the following code in the
execute method of my action, perhaps it isn't the right place?

Subject subject;
Set principalList;

String returnValue = SUCCESS;
try
{
SecurityAssociationHandler handler = new
SecurityAssociationHandler();
SimplePrincipal user = new SimplePrincipal(username);
handler.setSecurityInfo(user, password.toCharArray());
LoginContext loginContext = new LoginContext(ContentPlatform,
(CallbackHandler) handler);
loginContext.login();
subject = loginContext.getSubject();
principalList = subject.getPrincipals();
principalList.add(user);

System.out.println(o0o0o subject:
+ subject);
System.out.println(o0o0o principle:
+ principalList);
}
catch (LoginException e)
{
e.printStackTrace();
returnValue = ERROR;
}

return returnValue;


Regards,
Muhammad Momin Rashid.

tom tom wrote:
  

If it's simple application, you dont need JAAS, You
can do it via just session management isnt it? You
might need user, role, user-role  threee tables on
database thats it :)

If you are using Application server like Jboss, the
server itself got inbuilt features, which is
altogether a different discussion.


If the application is simple, do not make it
complicated,

we use JASS with CAS central authentication service
which provided SSO features.


hope this helps









--- Muhammad Momin Rashid [EMAIL PROTECTED] wrote:



Hello tom,

I am building a J2EE application, that is going to
be viewed using Web Browser and Mobile Devices.

I am trying to implement security so that only a
logged in user with the correct role can access the different parts
of the
application e.g. a non-logged in user can only access the public
information, a logged in user can access his private data, and an
logged in
admin user can access the admin console.

Regards,
Muhammad Momin Rashid.

tom tom wrote:
  

what exactly you are trying to do?


--- Muhammad Momin Rashid [EMAIL PROTECTED]


wrote:
  

Hello Everyone,

I am looking for a tutorial for integrating JAAS
into my Struts 2 + Hibernate Application.  Can anyone point me to
  

the
  

right resources?

Is JAAS the best way to go, or there are better
alternates?  If anyone thinks there are better alternates, can you
  

provide
  

me with the links to relevant tutorials?

Regards,
Muhammad Momin Rashid.



  

-


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


  





Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Ian Roughley
If you are not using container managed persistence, where the 
HttpRequest values are being set in the environment, you probably don't 
want to use the Principal or PrincipalAware interface, or even to wrap 
the HttpServletRequest (this email was in response to using a servlet 
wrapper to re-implement code already present in s2).


Options I've used are creating an interceptor to access the security 
context (I've not used JAAS personally), and then create an annotation 
to signify actions/methods that need security information assigned to 
them.  The same annotation, or another, could also be used to 
declaratively configure those actions that require a specific role from 
the security context in order to be invoked.


/Ian

Chris Pratt wrote:

On 9/18/07, Ian Roughley [EMAIL PROTECTED] wrote:
  

By implementing the PrincipalAware interface, the Principal object will
be injected into the action with those values from the request (the
user, roles, etc.).  The values can be be used in the action, or the
Principal can be exposed with a setter for the actions to use.



But if you don't use Container Managed Authentication, how do you get
the Principal into the request so that PrincipalAware can inject it,
without using a ServletFilter?
  (*Chris*)

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

  


Re: Extended conversation/Wizards

2007-09-17 Thread Ian Roughley
The two options are (1) Spring WebFlow plugin as you mentioned, and (2) 
Session interceptor, that will move attributes from the action in and 
out of session scope for the duration of the wizard.


/Ian

Martin Gilday wrote:

Hi,
I am currently maintaining a WebWork 2 based web application.  A change
in requirements has come about which requires a fairly long wizard to be
added.  This will take in a fair amount of data entry, at least 6
screens long, with some ajax form population based on selections.  The
final database manipulation would only occur once the final screen has
been completed successfully.  The rest of the application is based on
Spring services with Hibernate 3.

We have been planning to upgrade, so to speak, the application to Struts
2 for some time.  This seems like the right time.  What I a looking at
is if there anything inside Struts 2 or an approach to take to achieve
this long conversation and delayed database commmit?  I think something
like JBoss Seam's conversation scope would be ideal for this, but I
would really rather not change frameworks for this (as WebWork/Struts2
has worked fantastically well).  In WebWork 2 there is some continuation
support borrowed from Rife, but has been marked experimental since the
start of the year.  I can see no mention of this on the Struts2 wiki. 
Is there any continuation support?  My other idea has been to look at

Spring Web Flow.  There seems to be a plugin to make this work with
Struts 2 http://code.google.com/p/struts2webflow/.  has anyone used this
in production?

Has anyone acheieved something like this in the past?  Any advice or
pointers very much appreciated.

Thanks,
Martin.

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

  


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



Re: Sanitize Text

2007-08-23 Thread Ian Roughley
This is a good approach.  In fact, you might start with the params 
interceptor - as it is responsible for assigning data to the action, and 
all that is needed is to sanitize before assignment. 


/Ian

Richard Sayre wrote:

I was wondering what the best approach would be for taking form data
passed to an Action and removing 'special characters' from the data.
I am having issues with users pasting text from word docs etc.  We
only support ISO-8859-1 as of now and there are some characters that
Word will replace such as ' and  with character that are outside the
8839-1 character set.

I was thinking about an interceptor that would sanitize the request
parameters before they are passed to the action.  Is this a good
approach?  Can anyone suggest a better one?  It does not matter if it
uses Struts or not.

Thank you

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

  


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



Re: multilingual support in struts2

2007-08-20 Thread Ian Roughley
This is not one of the supported patterns.  Although, you should be able 
to provide a TextProvider implementation to do what you want, rather 
than using the implementation provided in ActionSupport.


/Ian

Hari Prasad wrote:

Hi frends,
I'm able to load my properties from classpath, provided all are in the same
folder..
I mean, all my property files in different languages are in a single folder
and its working for me.
but now, since i have more property files, i want to make it more organised
and so
i want to put all property files of a specific language , in a specific
folder.Does this work in struts2?

In short, what i have is

WEB-INF/classes/resources/home_en.properties
WEB-INF/classes/resources/home_fr.properties

and what i want is

WEB-INF/classes/resources/en/home_en.properties
WEB-INF/classes/resources/fr/home_fr.properties

can anyone tell me, whether is works


  


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



Re: struts2 ajax jsps

2007-08-15 Thread Ian Roughley
I think there was a discussion from Matt about this (appfuse using html 
extensions) a while back, you might want to check the archives.  On the 
s2 side, there are options, but I'm not sure there is an easy solution 
for using .html as an extension.


/Ian

Struts2 Fan wrote:

Opps How can I make struts to ignore this and read them as html? Or do I
have to change the extention to get it work.

Thanks for the answer.


Ian Roughley wrote:
  

This line:

There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. 

Seems to suggest that you may have changed the extension from .action 
to .html, so s2 is looking for an action called TabContainer.


/Ian
Struts2 Fan wrote:


I met the same error, too.

I have just a simple jsp

 start of simple.jsp 
%@ include file=/common/taglibs.jsp %
head
s:head theme=ajax/s:head
/head
s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height:
300px; doLayout=true
s:div theme=ajax id=left label=left
s:form
s:textfield name=tt label=Test Text/  br/
s:textfield name=tt2 label=Test Text2/
/s:form
/s:div
s:div theme=ajax id=right label=right
This is the right panebr/
/s:div
/s:tabbedPanel
 end of simple.jsp 

Here it gives the following error

 start of error 
 ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action
or
result
There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125

Re: struts2 ajax jsps

2007-08-15 Thread Ian Roughley
As it seems like you want to find a solution the option is to write 
an ActionMapper that reverses the order the URLs are currently 
determined.  Instead of looking for an action first, you would need to 
look for a static resource first, and then if not found check for an action.


/Ian

Struts2 Fan wrote:

I know that discussion but it html extention locks some of the
functionality of struts2, it would be better to change it from html to
something else. If you say *it is not easy*, at least I will post a message
on the appfuse forum. 



Ian Roughley wrote:
  
I think there was a discussion from Matt about this (appfuse using html 
extensions) a while back, you might want to check the archives.  On the 
s2 side, there are options, but I'm not sure there is an easy solution 
for using .html as an extension.


/Ian

Struts2 Fan wrote:


Opps How can I make struts to ignore this and read them as html? Or
do I
have to change the extention to get it work.

Thanks for the answer.


Ian Roughley wrote:
  
  

This line:

There is no Action mapped for namespace
/struts/dojo/src/widget/templates
and action name TabContainer. 

Seems to suggest that you may have changed the extension from .action 
to .html, so s2 is looking for an action called TabContainer.


/Ian
Struts2 Fan wrote:



I met the same error, too.

I have just a simple jsp

 start of simple.jsp 
%@ include file=/common/taglibs.jsp %
head
s:head theme=ajax/s:head
/head
s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px;
height:
300px; doLayout=true
s:div theme=ajax id=left label=left
s:form
s:textfield name=tt label=Test Text/  br/
s:textfield name=tt2 label=Test Text2/
/s:form
/s:div
s:div theme=ajax id=right label=right
This is the right panebr/
/s:div
/s:tabbedPanel
 end of simple.jsp 

Here it gives the following error

 start of error 
 ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find
action
or
result
There is no Action mapped for namespace
/struts/dojo/src/widget/templates
and action name TabContainer. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at
net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke

Re: struts2 ajax jsps

2007-08-14 Thread Ian Roughley

This line:

There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. 

Seems to suggest that you may have changed the extension from .action 
to .html, so s2 is looking for an action called TabContainer.


/Ian
Struts2 Fan wrote:

I met the same error, too.

I have just a simple jsp

 start of simple.jsp 
%@ include file=/common/taglibs.jsp %
head
s:head theme=ajax/s:head
/head
s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height:
300px; doLayout=true
s:div theme=ajax id=left label=left
s:form
s:textfield name=tt label=Test Text/  br/
s:textfield name=tt2 label=Test Text2/
/s:form
/s:div
s:div theme=ajax id=right label=right
This is the right panebr/
/s:div
/s:tabbedPanel
 end of simple.jsp 

Here it gives the following error

 start of error 
 ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action or
result
There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
at

Re: Extending ActionConfig in Struts2

2007-08-08 Thread Ian Roughley
Have you tried overriding the struts.configuration property with a new 
Confguration class that builds and returns your new ActionConfig?



Vinod Singh wrote:

Any clues??

Thanks,

Vinod
 Original Message 
Subject: Extending ActionConfig in Struts2
From: Vinod Singh [EMAIL PROTECTED]
To: user@struts.apache.org user@struts.apache.org
Date: Tuesday, August 07, 2007 3:05:36 PM

Hi All,

The Struts 1.x provides a facility to extend the ActionMapping by
defining it in web.xml in following manner-

init-param
param-namemapping/param-name
param-valueCustomActionMapping/param-value
/init-param

In Struts 2.x I don't see anyway to extend ActionConfig.

The ActionConfig class is hard coded in addAction(...) method of
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.

Can anyone guide me in extending ActionConfig, if I am missing 
something?


Thanks,

Vinod


  





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



Re: Possible to package struts2 actions/code in a reusable jar?

2007-08-08 Thread Ian Roughley
Looks like you are talking about creating a plugin.  I think the issue 
is that struts.xml needs to be renamed to the plugin specific name. 


WiltOnTilt wrote:

We have several projects that will have many common actions and links to
common JSP names.  For example, all of our projects will have a Welcome
action and a related welcome.jsp.

I'd like to be able to create a common-actions.jar that would essentially
contain all of the source code needed for each common action to run (Action
classes, beans, DAOs, Entity objects, etc).  The hope would be that I could
put the struts.xml in the jar as well as .properties files and then override
them as necessary under each project's src folder.  


So here's what I've done so far, my directory structure looks like this:

src
  

arson/


action/
biz/
model/
  

META-INF/
arson.properties
log4j.properties
struts.xml



I tried jarring up everything under src.

Then in eclipse, I added the external jar to the project, and put it at the
very top of my buildpath.  


When I try to access my Welcome action, it couldn't find it, giving me this
error:

There is no Action mapped for namespace / and action name Welcome. -
[unknown location]

Any idea if what I want to do is even possible, or what I could be doing
wrong?

Thanks!
Aaron
  


Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Ian Roughley

And you can place them on the domain objects and use a visitor validator ;)

Dave Newton wrote:

--- j alex [EMAIL PROTECTED] wrote:
  
My understanding is that the validators are tied to 
fields and not methods - right?



They *can* be tied to the fields (in other words,
every action method) but you can specify validations
based on the action name as well.

d.



   

Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/


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

  


Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Ian Roughley
The validation and the related messages are on the domain objects and 
not the action, so they are separate.  Then the action defines which 
domain object is validated via the visitor validation - there is also a 
prefix (not sure of the exact attribute off hand), which would ensure 
that coapp or primaryapp is used to differentiate the domain objects.


/Ian

j alex wrote:

Hi Ian,

From the documentation, VisitorFieldValidator seems interesting. Can you
please provide some inputs on if/how we can use this for the following
scenario :

the domain object Name  has properties firstname, lastname, initial etc.

now, Name could be associated with a primaryapplicant or a coapplicant
object.

In the JSP, we've s:text name=primaryapp.name.firstname in the 1st page ;
and s:text name=coapp.name.firstname in the next page.

How will i define a validation rule for the firstname field using
annotations which can be used for validating both these fields ; without
introducing any duplication. Also, i want to have the error message
customized so that if primary's name is invalid ; the msg should be please
enter valid firstname for primary and please enter valid firstname for
coapp if coapp name has an error.

I know this can be done easily in XML by having separate entries for primary
and coapp and using params to manipulate the error message accordingly.

Thanks,
Joseph

On 8/7/07, Ian Roughley [EMAIL PROTECTED] wrote:
  

And you can place them on the domain objects and use a visitor validator
;)

Dave Newton wrote:


--- j alex [EMAIL PROTECTED] wrote:

  

My understanding is that the validators are tied to
fields and not methods - right?



They *can* be tied to the fields (in other words,
every action method) but you can specify validations
based on the action name as well.

d.





  




Pinpoint customers who are looking for what you sell.
http://searchmarketing.yahoo.com/

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


  


  


Re: Struts 2 URL parameters lost

2007-07-31 Thread Ian Roughley
Since it works for the form, but not the wildcard action mapping, it 
might be an issue with the action mapper.  Try using a non-wildcard 
mapping to see if it makes a difference.


/Ian

JBL wrote:

We have a link to a Struts 2 action that includes a URL parameter
(.../something_method.action?name=NAME), and the URL parameter is getting
lost -- it doesn't show up in the action, the request map (when we implement
RequestAware), the parameter map (when we implement ParameterAware), or a
custom interceptor we put at the top of the interceptor stack.

When we submit a form to the same action with the same parameter (input
type=text name=name value=NAME/), it comes through just fine for both
maps (request and parameters), and ParametersInterceptor transfers the form
parameter values to the action just as you'd expect.

We've tried hard-coding the method name in struts.xml, figuring the wildcard
processor might chop off the request parameter; no luck. As early as we can
pick things out of the request cycle, the URL parameters appear to be gone.

struts.xml looks like:

struts
  package name=... namespace=... extends=struts-default
...
action name=something_* class=...SomethingAction method={1}
  result/WEB-INF/... .jsp/result
/action
  /package
/struts

We're using Struts 2.0.8.

There's a similar question in the Struts 2 FAQs about the
ParametersInterceptor not setting values, but the answer there turns out to
be that your setter and getter have to use the same type. (See
http://struts.apache.org/2.x/docs/faqs.html, in the Interceptors section.)

Ian Roughley has a handy book available as a free PDF on InfoQ.com
(http://www.infoq.com/minibooks/starting-struts2 - please forgive the plug);
it suggests on page 23 that you should be able to see URL parameters via the
ParametersInterceptor. Nothing I've seen elsewhere contradicts this, though
the ParametersInterceptor page
(http://struts.apache.org/2.x/docs/parameters-interceptor.html) says that it
would typically be used to apply form parameters to an action.

Any help would be appreciated.

Thanks,

Jon
  


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



Re: S2 + REST urls

2007-07-27 Thread Ian Roughley
I have found the order is important in the struts.xml file - i.e. if you 
are changing a property that is being used by another (say the names of 
the mappers for the CompositeActionMapper), you need to add the 
declaration of the property and then define the object (the 
CompositeActionMapper) that uses it.


/Ian

matihost wrote:

First of all, put that constants in struts.properties file next to
struts.xml
there are some problems with constants defined in struts.xml, some of them
does not work correctly



Yes, you are right, for example constant struts.locale still is not loaded 
correctly when it is in struts.xml file.


  

Then, you can create your namespace and mappings for images and csses, this
will add security,
and you will be able to hide real resource names



I do not understand well. Do you mean to create new package in  sruts.xml and 
add an action which serves static content ?

  

Also, to use restful urls you need only DefaultActionMapper, the other ones
are parameter automappers of restful urls, I do not use them



Yes, i think about it also, and as i mentioned before, i create workaround own 
mapping to serve static content which extends DefaultActionMapper and serve 
static content when action name taken from DefaultActionMapper contains dot.

--  
Mateusz Nowakowski




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

  


Re: Date Problem

2007-07-25 Thread Ian Roughley

I believe its localization.  try the date tag to specify a date format.

/Ian

rrecoba wrote:

Hi, IĀ“m using an input field where the user must put a date in the format
dd/MM/ 


But in the Action, when struts 2 set the value for the date attribute,  the
format changeĀ“s to  MM/dd/ , does anyone know why this is happening? 


Thanks a lot.-

  


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



Re: Date Problem

2007-07-25 Thread Ian Roughley

try setting it to a locale that uses a date format of dd/MM/.

rrecoba wrote:

I donĀ“t have the struts.locale, neither th struts.properties.  This is the
problem.



Ian Roughley wrote:
  
what is the locale set to?  It is the struts.locale property in the 
struts.xml or struts.properties


/Ian

rrecoba wrote:


Hi, thanks for your answer. I understand that the date tag is for showing
a
date not for input, is this ok?. My problem is that, when the user puts a
date in a form input field, in my action i get in other format. (I cannot
use datetimepicker)

Thanks.-


Ian Roughley wrote:
  
  

I believe its localization.  try the date tag to specify a date format.

/Ian

rrecoba wrote:



Hi, IĀ“m using an input field where the user must put a date in the
format
dd/MM/ 

But in the Action, when struts 2 set the value for the date attribute, 
the

format changeĀ“s to  MM/dd/ , does anyone know why this is
happening? 


Thanks a lot.-

  
  
  

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





  
  



  


Re: Date Problem

2007-07-25 Thread Ian Roughley
what is the locale set to?  It is the struts.locale property in the 
struts.xml or struts.properties


/Ian

rrecoba wrote:

Hi, thanks for your answer. I understand that the date tag is for showing a
date not for input, is this ok?. My problem is that, when the user puts a
date in a form input field, in my action i get in other format. (I cannot
use datetimepicker)

Thanks.-


Ian Roughley wrote:
  

I believe its localization.  try the date tag to specify a date format.

/Ian

rrecoba wrote:


Hi, IĀ“m using an input field where the user must put a date in the format
dd/MM/ 

But in the Action, when struts 2 set the value for the date attribute, 
the

format changeĀ“s to  MM/dd/ , does anyone know why this is
happening? 


Thanks a lot.-

  
  

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






  


Re: Struts 2 Theme that doesn't generate extra HTML

2007-07-16 Thread Ian Roughley
Then use HTML and the property tag to obtain value from the action or 
value stack.  Its only the form tags that use themes/freemarker templating.


/Ian

NƩstor BoscƔn wrote:

That's correct, but in this project I have to work with OGNL and the Struts
2 Tags.

Regards,

NƩstor BoscƔn 


-Mensaje original-
De: Ian Roughley [mailto:[EMAIL PROTECTED] 
Enviado el: Lunes, 16 de Julio de 2007 09:10 a.m.

Para: Struts Users Mailing List
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML

You can always use JSTL and HTML.

/Ian

Chris Pratt wrote:
  
Simple seems to be the closest, but unfortunately it is still run 
through the Freemarker templates, so it has the same overhead that the 
other themes have.


You can, change the simple theme to remove those li  ul the same 
way any other theme can be modified.


But I'd love to find a way to use Struts 2 without theme support at 
all, with CSS and some good patterns you can achieve the same thing 
with a lot less overhead.


 (*Chris*)

On 7/15/07, NƩstor BoscƔn [EMAIL PROTECTED] wrote:


Hi

Is there a Struts 2 Theme that doesn't generate extra HTML for the 
tags. For example XHTML generates a lot of table, tr and td and 
Simple will generate li, ul errors for Field Errors. Also in 
Simple Theme I can't get s:form/ to generate the JavaScript code 
for Client Side Validation.


Regards,

NƩstor BoscƔn


  

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




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


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

  


Re: Struts 2 Theme that doesn't generate extra HTML

2007-07-16 Thread Ian Roughley
You have to pick your poison.  You use the tags with their advantages 
and disadvantages, or you implement what you need (client side 
validation) manually.


/Ian

NƩstor BoscƔn wrote:

Yes Thanks, that's something I can do but what about the JavaScript code for
the Client-Side Validation?. 


Regards,

NƩstor BoscƔn 


-Mensaje original-
De: Ian Roughley [mailto:[EMAIL PROTECTED] 
Enviado el: Lunes, 16 de Julio de 2007 11:51 a.m.

Para: Struts Users Mailing List
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML

Then use HTML and the property tag to obtain value from the action or value
stack.  Its only the form tags that use themes/freemarker templating.

/Ian

NƩstor BoscƔn wrote:
  
That's correct, but in this project I have to work with OGNL and the 
Struts

2 Tags.

Regards,

NƩstor BoscƔn

-Mensaje original-
De: Ian Roughley [mailto:[EMAIL PROTECTED] Enviado el: Lunes, 16 de Julio 
de 2007 09:10 a.m.

Para: Struts Users Mailing List
Asunto: Re: Struts 2 Theme that doesn't generate extra HTML

You can always use JSTL and HTML.

/Ian

Chris Pratt wrote:
  

Simple seems to be the closest, but unfortunately it is still run 
through the Freemarker templates, so it has the same overhead that 
the other themes have.


You can, change the simple theme to remove those li  ul the same 
way any other theme can be modified.


But I'd love to find a way to use Struts 2 without theme support at 
all, with CSS and some good patterns you can achieve the same thing 
with a lot less overhead.


 (*Chris*)

On 7/15/07, NƩstor BoscƔn [EMAIL PROTECTED] wrote:

  

Hi

Is there a Struts 2 Theme that doesn't generate extra HTML for the 
tags. For example XHTML generates a lot of table, tr and td 
and Simple will generate li, ul errors for Field Errors. Also in 
Simple Theme I can't get s:form/ to generate the JavaScript code 
for Client Side Validation.


Regards,

NƩstor BoscƔn


  


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


  

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


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

  




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

  


Re: Has anyone tried this in S2

2007-06-29 Thread Ian Roughley
Take a look at the value stack via the debug tag. 

Usually the property tag will keep stepping through the value stack 
until a getter for the property is found (the object for the current 
iteration is placed on the top of the value stack).  Although, if you 
are explicitly defining the object (via id and #test) there shouldn't be 
a problem. 


/Ian

tom tom wrote:


Hi,

I got three iterations which I tried as below in the
jsp, First two and Array of certain DTO and last
iterator is a String array. There is no jsp
compilation error, but the issue is it produced
misleading results.

Is there any limitation in S2 for the depth of the
iteration. Is this way of using recommended?

Sometimes where it is suppose to print empty value it
prints something else (looks like from the previous
iterator)

s:iterator value=#session.ITER1 id=qnn


s:iterator value=#qnn.ITER2 id=qa


s:iterator value=#qa.ITER3 id=test
  s:property value=#test /
/s:iterator 

/s:iterator 

/s:iterator 




 

Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 


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

 



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



Re: [S2] Template testing

2007-06-27 Thread Ian Roughley
Take a look in the source, I believe there are examples on how the theme 
templates are tested.


/Ian

Mark P Ashworth wrote:


Good Day,

I am busy in the process of developing a theme that uses the css_xhtml theme
as the base and currently the process is

1. Make a change to the template
2. Deploy and run the application
3. Determine in the HTML why something does not look right

It would be cool if I could make a change and run a test case that shows the
output. This would help with some of the testing but of course I would still
need to run the theme in the application to determine if the theme rendered
correctly but I could cut out some of the testing iterations.

I guess another point is that a person only creates the theme once. Just
wondered how the Struts 2 developers were doing it.

Regards,
Mark P Ashworth


Laurie Harper wrote:
 


Mark P Ashworth wrote:
   


Is there a way to test how a tag like lt;formgt;lt;textfield
/gt;lt;/formgt; will be processed by a custom theme. I would like to
get
all of the theme processing done during development instead of
integration
time with the actual pages.
 

What do you want to test, exactly? If you have a custom theme, then you 
have defined how the tags will be processed (rendered). Are you looking 
for an automated testing strategy for verifying your custom theme works 
as intended, or something else?


L.


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



   



 



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



Re: Is S2 Ready for Prime Time?

2007-06-26 Thread Ian Roughley
Yes.  I know of several companies that are using s2 in production 
environments.  I also know of an extremely large company that has 
started to use s2 for prototyping. 

As far as your other questions go - this really depends on the project.  
Like any design decision, the choices need to made depending on the 
services and features required.


/Ian

[EMAIL PROTECTED] wrote:

***  Please don't blast me for asking.  I'm simply looking for 
educated and

objective feedback ***

Is your company using Struts2?  We are starting a Proof of Concept 
this week

and I honestly don't even know where to begin!  I have read so many
different viewpoints about S2 that I can't tell whether I'm coming or
going.  What interfaces to implement?  What companion frameworks to
leverage?  What interceptor stacks to use?  What about the choice of UI
toolkits?  I read last night how the ajax support was being extracted 
from

S2 and made a plug-in.  I realize these are not easy questions, but I am
leading a Struts 2 subcommittee and I am being asked for 
recommendations and

timetables.  Do you think S2 is ready for prime time?

Thanks,
Scott



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



Re: [S2] login action w/FORM authentication?

2007-06-25 Thread Ian Roughley
yes - it is definitely possible.  The thing to remember is that if you 
are using struts2 tags (which I'm pretty sure you are), you need to 
redirect through an action first so the value stack is available to the tag.


/Ian

Jon Wilmoth wrote:


To add a little more context...The login action loads the login.jsp just fine 
when called directly, but doesn't work when invoked by the servlet container.  
Instead I see the following in the Tomcat log:

Jun-25-2007 10:31:30:865 AM, PDT [DEBUG] 
(org.apache.catalina.authenticator.FormAuthenticator) - Save request in session 
'930B154E1AD9BFB1283165CD888441EF'
Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] 
(org.apache.catalina.core.ApplicationDispatcher) - servletPath=/login.action, 
pathInfo=null, queryString=null, name=null
Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] 
(org.apache.catalina.core.ApplicationDispatcher) -  Path Based Forward
Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] 
(org.apache.catalina.core.ApplicationDispatcher) -  Disabling the response for 
futher output

I tried configuring the app to go directly to the login jsp page, but the 
struts2 tags throw the following NullPointer:

Jun-25-2007 10:36:03:552 AM, PDT [ERROR] 
(org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mywebapp].[jsp])
 - Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
at 
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
at 
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
at org.apache.jsp.login_jsp._jspx_meth_s2ib_005furl_005f0(login_jsp.java:503)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:111)

If this is off topic and I should post this to the Tomcat user list please let 
me know...it just seems to me that other S2 users may have this same question.

- Original Message 
From: Jon Wilmoth [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Sunday, June 24, 2007 9:21:02 PM
Subject: [S2] login action w/FORM authentication?


Is it possible to use an action as the webapp's login page?  I've tried the 
following web.xml/struts.xml entries with S2.0.8  Tomcat 5.5.23, but get a 404 
The requested resource (/mywebapp/login.action) is not available message.

login-config
   auth-methodFORM/auth-method
   form-login-config
   form-login-page/login.action/form-login-page
   form-error-page/loginFailure.action/form-error-page
   /form-login-config
   /login-config 


action name=login
   result/login.jsp/result
/action
 



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



Re: Implementing wizard like interface in struts

2007-06-25 Thread Ian Roughley
An interceptor, especially useful if the wizard is the only code in a 
specific directory.


/Ian

semaj wrote:


It's been a week; have not found any solutions... any idea guys!!

semaj wrote:
 


Hi there,

May be someone has already solved this problem. I need to implement a
wizard like page flow in my strut web application.

This is what I've done:
1. Created one big action form and put it in session scope.
2. Created action class extending DispatchAction
3. Created several jsps.

I successfully implemented the logic with previous, next, finish, and
cancel button. I removed the action form from session if the user clicks
cancel or finish buttons. The only problem i'm having is how to remove the
action form from session if the user navigates to other pages from menu
bar (without clicking cancel or finish buttons).

The other problem I'm having is how to navigate the user to first step if
he/she directly types the url of other subsequent pages.

I think i'm not the first person to face this problem. someone must have
already implemented this. Any hint will be greatly appreciated!!

There are different third party plugins for struts wizard. Do they solve
my problems?

Thanks,
semaj


   



 



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



Re: Implementing wizard like interface in struts

2007-06-25 Thread Ian Roughley
My mistake, are you using s1 or s2?  I was providing an s2 solution, but 
on further inspection you may have been asking about s1.


/Ian

semaj wrote:


I didn't get the picture what you are trying to say...

Ian Roughley wrote:
 

An interceptor, especially useful if the wizard is the only code in a 
specific directory.


/Ian

semaj wrote:

   


It's been a week; have not found any solutions... any idea guys!!

semaj wrote:


 


Hi there,

May be someone has already solved this problem. I need to implement a
wizard like page flow in my strut web application.

This is what I've done:
1. Created one big action form and put it in session scope.
2. Created action class extending DispatchAction
3. Created several jsps.

I successfully implemented the logic with previous, next, finish, and
cancel button. I removed the action form from session if the user clicks
cancel or finish buttons. The only problem i'm having is how to remove
   


the
 


action form from session if the user navigates to other pages from menu
bar (without clicking cancel or finish buttons).

The other problem I'm having is how to navigate the user to first step if
he/she directly types the url of other subsequent pages.

I think i'm not the first person to face this problem. someone must have
already implemented this. Any hint will be greatly appreciated!!

There are different third party plugins for struts wizard. Do they solve
my problems?

Thanks,
semaj


  

   




 


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



   



 



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



Re: Spring-webflow exception

2007-06-19 Thread Ian Roughley
The source is available from the project site on google code.  I haven't 
seen this error before, but I imagine it is a XML config issue.


/Ian

Rikard wrote:


Hi im trying out the spring-weblow example. But i get this exception:


09:43:42,494 ERROR [[/spaceport].listenerStart] Exception sending context
initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.springframework.org/schema/webflow-config]


but in the applicationContext.xml i got:

beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:aop=http://www.springframework.org/schema/aop;
  xmlns:flow=http://www.springframework.org/schema/webflow-config;
  xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd;
  default-autowire=byName
   

Does any one have any clue?

Thanks ! 

ps.. does anyone have the source code for the web-flow example ? 

 



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



Re: Spring-webflow exception

2007-06-19 Thread Ian Roughley
Let me know how it goes.  I've worked with it a little, but had to drop 
the integration due to time constraints.


/Ian

Rikard wrote:


Thanks Ian for the quick response. Now i can continue explore the
spring-webflow plugin!
:)


Ian Roughley wrote:
 

The source is available from the project site on google code.  I haven't 
seen this error before, but I imagine it is a XML config issue.


/Ian

Rikard wrote:

   


Hi im trying out the spring-weblow example. But i get this exception:


09:43:42,494 ERROR [[/spaceport].listenerStart] Exception sending context
initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate NamespaceHandler for namespace
[http://www.springframework.org/schema/webflow-config]


but in the applicationContext.xml i got:

beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xmlns:flow=http://www.springframework.org/schema/webflow-config;
 xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd;
 default-autowire=byName
  

Does any one have any clue?

Thanks ! 

ps.. does anyone have the source code for the web-flow example ? 




 


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



   


/
 



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



Re: Struts2 Not Executing Actions

2007-06-14 Thread Ian Roughley
Can you verify that the struts.xml is in the WAR file, and the location 
of it?


/Ian

Danny Hurlburt wrote:


Hello,

I am new to Struts2 and am running into some problems. I have read 
much of the

documentation on the wiki but I am still stuck.

I have added the filter declaration and filter mapping to web.xml. I have
confirmed that it gets invoked by setting a breakpoint in the doFilter
method. I have created the following struts.xml:

!DOCTYPE struts PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
   http://struts.apache.org/dtds/struts-2.0.dtd;
struts
   package name=root extends=struts-default namespace=/
   action name=HelloWorld class=tutorial.HelloWorld
   result/HelloWorld.jsp/result
   /action
   /package
/struts

I don't have a struts.properties file. I have not set any init-params 
for the
Struts2 filter in web.xml. That is, the default constant configuration 
is in

effect.

This is running in a web app with a context path of rgg. When making the
following request

http://localhost:7070/rgg/HelloWorld.action

I get the following stack trace (trimmed down for brevity):

There is no Action mapped for namespace / and action name HelloWorld. 
- [unknown location]
   
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) 

   
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) 

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

   
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) 



Has anyone else run into the same problem? Anyone have a solution?

Thanks - Dan

PS - I there anyway I can search the user mailing list before I post 
questions

to see if someone else has previously solved my problem or similar issue?



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




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



Re: Flash scope in Struts 2?

2007-06-06 Thread Ian Roughley
There is an interceptor and result in webwork that can be used with 
about 2 mins for package corrections.


/Ian

mraible wrote:


mraible wrote:
  

Does Struts 2 have support for a flash scope - where messages can be
easily stuffed into this scope so they live through a redirect?

Thanks,

Matt




I'll assume the answer is no.

  


Re: [ANN] Starting with Struts2 Book

2007-05-31 Thread Ian Roughley

No, no paypal account.  You can buy me a beer if I make it to apachecon.

James Mitchell wrote:
Ian,  Nice job!  I don't need the paper copy, but I'd like you to get 
the full price of the book.  Do you have a Paypal account that I could 
donate some funds to?



--
James Mitchell



On May 29, 2007, at 12:13 PM, Henri Yandell wrote:


The registration system at InfoQ is pretty slow; so I downloaded
directly from lulu.com.

Great work Ian, I hope it becomes the 'Thinking in Struts2' and is a
big success.

Hen

On 5/25/07, Ted Husted [EMAIL PROTECTED] wrote:

Is anyone else having trouble logging into the InfoQ site?

On 5/24/07, Ian Roughley [EMAIL PROTECTED] wrote:
 I am pleased to announce the release of the mini-book Starting with
 Struts2 from InfoQ.com.

 Starting with Struts2 is aimed at those who are new to Strut2, and
 those familiar with MVC frameworks but unfamiliar with Struts2.  It
 provides everything you need to know to get up and running using
 Struts2, and can be used as a starting point to explore the more
 intricate features of the Struts2 framework.   Topics include
 architecture and configuration, how to implementing actions, and
 supporting infrastructure such as validation and 
internationalization.
 Also included are productivity tips, providing a practical 
introduction

 on how best to use the framework.

 The eBook can be found at 
http://www.infoq.com/minibooks/starting-struts2


 /Ian

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




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




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



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



Re: [ANN] Starting with Struts2 Book

2007-05-30 Thread Ian Roughley

Yep.  Still in Boston.  I'll have to ping them about that.

/Ian

Ted Husted wrote:

On 5/29/07, Ian Roughley [EMAIL PROTECTED] wrote:

Ah - thanks for the link Ted.  And for all the kind words on the list.


Don't forget the blog :)

* http://husted.com/ted/blog/

Hey, isn't the New England JUG overdue for a Struts talk?

If you're still in the Boston area, I might be in town for the Ajax
Experience in October.

-Ted.

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



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



Re: [ANN] Starting with Struts2 Book

2007-05-29 Thread Ian Roughley

Ah - thanks for the link Ted.  And for all the kind words on the list.

/Ian

Ted Husted wrote:

Done :)

* http://struts.apache.org/index.html#Newbies

On 5/29/07, Musachy Barroso [EMAIL PROTECTED] wrote:

Good job! Finally a book to recommend to new users :)

musachy


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



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



Re: [ANN] Starting with Struts2 Book

2007-05-25 Thread Ian Roughley

doh.  Thanks.  The issue with starting in ww and moving to struts :-)

/Ian

Al Sutton wrote:

Do I get a prize for reporting the first typo :)...

On Page 64 there's a code snippet which reads;

ww:iterator value=peopleList status=stat 
   s:property value=peopleList[#stat.index].id / 
   s:property value=peopleList[#stat.index].name / 
   s:property value=peopleList[#stat.index].age / 
   s:property value=peopleList[#stat.index].height/ 
/ww:iterator 


Shouldn't th ww: be an s:?

 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ted
Husted
Sent: 25 May 2007 12:40
To: Struts Users Mailing List
Subject: Re: [ANN] Starting with Struts2 Book

Is anyone else having trouble logging into the InfoQ site?

On 5/24/07, Ian Roughley [EMAIL PROTECTED] wrote:
  
I am pleased to announce the release of the mini-book Starting with 
Struts2 from InfoQ.com.


Starting with Struts2 is aimed at those who are new to Strut2, and 
those familiar with MVC frameworks but unfamiliar with Struts2.  It 
provides everything you need to know to get up and running using 
Struts2, and can be used as a starting point to explore the more

intricate features of the Struts2 framework.   Topics include
architecture and configuration, how to implementing actions, and 
supporting infrastructure such as validation and internationalization.
Also included are productivity tips, providing a practical 
introduction on how best to use the framework.


The eBook can be found at 
http://www.infoq.com/minibooks/starting-struts2


/Ian



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



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

  


[ANN] Starting with Struts2 Book

2007-05-24 Thread Ian Roughley
I am pleased to announce the release of the mini-book Starting with 
Struts2 from InfoQ.com.


Starting with Struts2 is aimed at those who are new to Strut2, and 
those familiar with MVC frameworks but unfamiliar with Struts2.  It 
provides everything you need to know to get up and running using 
Struts2, and can be used as a starting point to explore the more 
intricate features of the Struts2 framework.   Topics include 
architecture and configuration, how to implementing actions, and 
supporting infrastructure such as validation and internationalization.  
Also included are productivity tips, providing a practical introduction 
on how best to use the framework.


The eBook can be found at http://www.infoq.com/minibooks/starting-struts2

/Ian


Re: Struts 2 validation and Redirect After Post

2007-05-23 Thread Ian Roughley
I think what you are after is a flash scope implementation.  There is a 
flash result and flash interceptor that Pat/Toby checked into the 
webwork project.  With a couple small changes they will work in s2.  At 
some point I guess they should be moved across.


/Ian

Fowler, Perryn wrote:


 Hi,
 
 I want to use the redirect after post pattern in order to have a web app that is well behaved when the user hits back, refresh etc etc
 
 I also want to use the Struts 2 validation framework.
 
 At first glance though, the two seem incompatible:
 
 If I have a form that I want to submit with a POST, I want the response to this to always be a REDIRECT to a GET.
 
 I probably want this even in the case of validation failures that cause the form to be re-displayed, but the validation 
 framework seems to assume that I would forward directly to the view in this case :
 
 ie: it stores error information in the current action to be queried and displayed by tags in the view.

 If I were to redirect to the view, this information would be lost.
 
 Is there something I have missed that supports having a redirect  on validation failures?
 
 cheers

 Perryn
 
 


This e-mail and any attachments to it (the Communication) is, unless otherwise stated, 
confidential,  may contain copyright material and is for the use only of the intended recipient. If you 
receive the Communication in error, please notify the sender immediately by return e-mail, delete the 
Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views 
expressed in the Communication are those of the individual sender only, unless expressly stated to be those 
of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities 
including ANZ National Bank Limited (together ANZ). ANZ does not accept liability in connection 
with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay 
arising from or in respect of the Communication.

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

  



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



Re: Struts 2 providing injection

2007-05-18 Thread Ian Roughley
Struts2, or more precisely XWork, uses an early version of Guice. 

I was wondering about doing the same thing on a current project, and my 
initial thought was that you would need to define the beans being 
injected via the struts.xml configuration file or to provide a way to 
supply the managed beans in to the Guice container.  I'm not sure that 
it will automatically find annotation on application code.


Bob?

/Ian


Will Smith wrote:

Hi, I have an action that I've been injecting with Guice. I just noticed
that there is an @Inject annotation defined in
com.opensymphony.xwork2.inject. I'm assuming that this allows you to use
struts 2 as the di provider. So I tried removing my
com.google.inject.*imports that bring in the @Inject annotation, to
see if struts would pick
this up. It didn't, and I get an error in my netbeans tomcat window. I 
was

unable to find any @Singleton type annotation so that I could apply the
correct scope to my class being injected, so I left the Guice one.

Am I correct in assuming that the @Inject annotation provided by 
struts2 is

to allow struts to do the di? If so, is there any documentation on this?
Also, while troubleshooting, I tried both specifiying Guice as the
objectFactory, and not specifying it. It didn't matter either way.

Thanks,
Will


This is the error:

1) Error at 
com.bugnthecode.blog.actions.BlogService.init(BlogService.java

:32):
Could not find a suitable constructor in
com.bugnthecode.blog.actions.BlogService. Classes must have either one 
(and
only one) constructor annotated with @Inject or a zero-argument 
constructor.


1 error[s]
   at 
com.google.inject.BinderImpl.createInjector(BinderImpl.java:277)

   at com.google.inject.Guice.createInjector(Guice.java:79)
   at com.google.inject.Guice.createInjector(Guice.java:53)
   at com.google.inject.Guice.createInjector(Guice.java:43)
   at com.google.inject.struts2.GuiceObjectFactory.buildBean(
GuiceObjectFactory.java:101)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(
ObjectFactory.java:152)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(
ObjectFactory.java:141)
   at com.opensymphony.xwork2.ObjectFactory.buildAction(
ObjectFactory.java:111)
   at com.opensymphony.xwork2.DefaultActionInvocation.createAction(
DefaultActionInvocation.java:270)
   at com.opensymphony.xwork2.DefaultActionInvocation.init(
DefaultActionInvocation.java:360)
   at com.opensymphony.xwork2.DefaultActionInvocation.access$000(
DefaultActionInvocation.java:38)
   at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(
DefaultActionInvocation.java:78)
   at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(
UtilTimerStack.java:455)
   at com.opensymphony.xwork2.DefaultActionInvocation.init(
DefaultActionInvocation.java:70)
   at com.opensymphony.xwork2.DefaultActionInvocation.init(
DefaultActionInvocation.java:66)
   at com.opensymphony.xwork2.DefaultActionProxy.prepare(
DefaultActionProxy.java:189)
   at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(
StrutsActionProxyFactory.java:41)
   at org.apache.struts2.dispatcher.Dispatcher.serviceAction(
Dispatcher.java:497)
   at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
FilterDispatcher.java:421)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(
MonitorFilter.java:368)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(

ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:869)
   at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection 


(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:619)




Re: Please help me get started

2007-04-20 Thread Ian Roughley
There is also a article / tutorial that I wrote late last year - 
http://www.infoq.com/articles/converting-struts-2-part1.  It has the 
basic steps to get running.


/Ian

Shahak Nagiel wrote:

Are you comfortable (at least to some degree) with all the technologies 
discussed in the Primer (http://struts.apache.org/primer.html)?  If not, that's 
probably a good place to start.

If you want/need a lot of hand-holding, your best bet is probably a good book (which tend to go into a 
lot more detail than most online tutorials/guides).  Problem is, Struts 2 is still too new and I don't 
think any books cover it.  However, there are books out there for Struts 1 (e.g.  
http://www.amazon.com/Struts-Complete-Reference-2nd/dp/0072263865/ref=pd_bbs_sr_1/103-0332319-3664651?ie=UTF8s=booksqid=1177008263sr=1-1)
 and for WebWork (e.g.  
http://www.amazon.com/WebWork-Action-Patrick-Lightbody/dp/1932394532/ref=pd_bbs_sr_1/103-0332319-3664651?ie=UTF8s=booksqid=1177008360sr=1-1)
 that should give you a very good foundation in these technologies as well as a good step-by-step 
tutorials.


- Original Message 
From: Session A Mwamufiya [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Thursday, April 19, 2007 2:38:17 PM
Subject: Please help me get started

Hello,

I tried following the Struts 2 bootstrap tutorial, but even the first piece 
looks like Martian to me.  Could someone please give me a step by step approach 
to setup struts 2 (like 1. move this file to here, 2. do this, ...), because 
the tutorial itself requires a tutorial to understand what it is we're supposed 
to be doing.

Please help, thanks.
Session


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






  


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



Re: struts2 equivalent of html:link tag?

2007-04-17 Thread Ian Roughley
s:a ... / generates a link in s2, you can use the action and namespace 
attributes with it.


Dave Newton wrote:

--- Allen Gilliland [EMAIL PROTECTED] wrote:
  

s:url value=/ui/something.jsp/
  

okay, but at that point there is no real reason to
use the s:url tag at all 



If you're not dealing with contexts, perhaps not.

  

html:link forward=loginlogin page/html:link

and had this in your struts config file ...

global-forwards
   forward name=login
path=/ui/login-redirect.jsp/
/global-forwards



In S1 my impression was that it was generally
recommended to direct all requests through actions to
avoid problems like this; that's one reason why the
ForwardAction and the forward attribute were
introduced: ending up with a link to a JSP is mostly
broken (IMO, anyway).

  

does struts2 have any equivalent for that?



AFAIK not beyond what has already been shown.

If you're simply dispatching to a JSP or something
else the normal container dispatcher can handle, why
not just add the following to your struts config?

action name=the/path
  result/WEB-INF/jsp/the.jsp/result
/action

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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

  


Re: struts2 equivalent of html:link tag?

2007-04-17 Thread Ian Roughley
My mistake (perhaps), I was scanning the email too fast.  It doesn't 
have the action and namespace attributes.  But it's not just for making 
dojo ajax requests either.  The href attribute can use the %{} notation 
to search the value stack and resolve expressions.


I usually use the two together -

   s:url id=register action=findUser namespace=/user /
   s:a href=%{register} Register/a


/Ian

Dave Newton wrote:

--- Ian Roughley [EMAIL PROTECTED] wrote:
  

s:a ... / generates a link in s2, you can use the
action and namespace attributes with it.



s:a.../ is pretty different than s:url.../ and I
would think not what the OP was looking for, which was
how to give links logical names.

I think the issue was largely solved by using
class-less (like me!) actions thusly:

action name=/a/url
  result/a/jsp/etc/result
/action

AFAICT s:a.../ is for making Dojo Ajax requests.

d.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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

  


Re: Architecture of Struts from a server application's point of view

2007-04-09 Thread Ian Roughley
I don't see why a restful URI or ajax call wouldn't be accessible via a 
VPN (if these are the APIs you are talking about).  I think it is more 
dependant on the VPN configuration than anything else.


/Ian


Session Mwamufiya wrote:

Hello,

 


I'm new to Struts 2 and have to design an architecture in which my server
applications would be included in Struts, which would be responsible for
providing a web interface for the apps.  However, I also need to communicate
with these server apps via a client that will use VPN access into the
server.  Are apps placed in Struts accessible from APIs other than those of
Struts' web interface?  I may not be clear enough in my question, but please
feel free to ask for clarification, and any attempt to answer it would be
greatly appreciated.

 


Thanks,

 


Session A. Mwamufiya

MBA | Tepper School of Business

MSE (Software Engineering) | School of Computer Science

Carnegie Mellon University

T: (412) 508-5455 | Email:  mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]

 



  


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



Re: Need more comprehensive AJAX Implementation Instructions

2007-03-11 Thread Ian Roughley
No - what I said was that I would be surprised if the s:form s2 tag 
DOES NOT generate a HTML form tag.  This was in response to your 
comment Also, is counter-intuitive for html users that a s:form 
actually renders a table, instead of simply render a form tag - which 
implies that no HTML form tag is generated for the s2 s:form tag.


/Ian

[EMAIL PROTECTED] wrote:
This is crazy!  Are you suggesting that maybe a FORM tag is written if 
you
modify the templates?  I would understand if you said maybe there is 
not a

FORM tag generated if you DO modify the templates!  Any solid framework
should be usable first and modifiable second.  Is the framework usable 
without

writing framework code first?

Scott

On 3/10/07, Ian Roughley [EMAIL PROTECTED] wrote:




[EMAIL PROTECTED] wrote:
 I have to agree with stanlick with this.

I would agree more work need to be done.
 I have abandoned in my project the more complex themes of struts and
kept
 it in the simple theme (with customized tag templates here and 
there)

 because of these Table tags coming out of nowhere.
 If you imply a deduction that a s:form tag implies in the 
presence of

a
 table  and that s:textfield are in truth
 trtd[label]/tdtdinput type=text ... /td/tr i'm imposing
an
 obsolete html table structure to a page. What if I wanted to use div
and
 span ?
use the xhtml_css theme
  What if I wanted to use a different table structure?

Then you have the opportunity to customize each theme to your particular
and specific need
 (two fields inside a simple td tag, for instance ?)
 Also, is counter-intuitive for html users that a s:form actually
renders
 a table, instead of simply render a form tag.

I haven't looked lately, but I imagine there is a form tag in there
somewhere, otherwise I don't see how it would work.  Even in the dojo
theme, I believe the
 As for documentation, I recommend and effort to map the relation 
between

 tag x freemarker template so this tag customization becomes easier
without
 having to browse the struts.view.jsp code.

Although this would be a worthwhile documentation effort, I'm not
convinced that it is that necessary.  Each of the freemarker templates
are named after the tag, and I have never had to look at the tags java
code in order to determine which template is rendered.



 Dave Newton [EMAIL PROTECTED]
 09/03/2007 18:40
 Please respond to
 Struts Users Mailing List user@struts.apache.org


 To
 Struts Users Mailing List user@struts.apache.org
 cc

 Subject
 Re: Need more comprehensive AJAX Implementation Instructions






 --- [EMAIL PROTECTED] wrote:

 Also, I have yet to see what an Action class might
 actually look like to handle the asynchronous call.


 It looks like any other Action.

 (BTW, Tiles is supported in S2 via the Tiles plugin,
 but Tiles 2 is still a bit fluxful.)

 d.





 


 Don't get soaked.  Take a quick peek at the forecast
 with the Yahoo! Search weather shortcut.
 http://tools.search.yahoo.com/shortcuts/#loc_weather

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











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



Re: Need more comprehensive AJAX Implementation Instructions

2007-03-10 Thread Ian Roughley



[EMAIL PROTECTED] wrote:

I have to agree with stanlick with this.
  

I would agree more work need to be done.
I have abandoned in my project the more complex themes of struts and kept 
it in the simple theme (with customized tag templates here and there) 
because of these Table tags coming out of nowhere.
If you imply a deduction that a s:form tag implies in the presence of a 
table  and that s:textfield are in truth 
trtd[label]/tdtdinput type=text ... /td/tr i'm imposing an 
obsolete html table structure to a page. What if I wanted to use div and 
span ?

use the xhtml_css theme

 What if I wanted to use a different table structure?
  
Then you have the opportunity to customize each theme to your particular 
and specific need

(two fields inside a simple td tag, for instance ?)
Also, is counter-intuitive for html users that a s:form actually renders 
a table, instead of simply render a form tag.
  
I haven't looked lately, but I imagine there is a form tag in there 
somewhere, otherwise I don't see how it would work.  Even in the dojo 
theme, I believe the
As for documentation, I recommend and effort to map the relation between 
tag x freemarker template so this tag customization becomes easier without 
having to browse the struts.view.jsp code.
  
Although this would be a worthwhile documentation effort, I'm not 
convinced that it is that necessary.  Each of the freemarker templates  
are named after the tag, and I have never had to look at the tags java 
code in order to determine which template is rendered.




Dave Newton [EMAIL PROTECTED] 
09/03/2007 18:40

Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Need more comprehensive AJAX Implementation Instructions






--- [EMAIL PROTECTED] wrote:
  
Also, I have yet to see what an Action class might 
actually look like to handle the asynchronous call.



It looks like any other Action.

(BTW, Tiles is supported in S2 via the Tiles plugin,
but Tiles 2 is still a bit fluxful.)

d.



 


Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

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



  


Re: [S2] There is no Action mapped for action name HelloWorld. - [unknown location]

2007-03-07 Thread Ian Roughley
I recently fixed the starter maven archetype, it might be a better 
starting point.


/Ian

Musachy Barroso wrote:
well, something is quite broken :), do you get any error log when you 
start

the app?

musachy

On 3/7/07, meeboo [EMAIL PROTECTED] wrote:



This might be well out of your reach, but I did as you said and 
downloaded

the config browser plugin. Under namespaces I can see

default
/config-browser
/com/bubbleclip/web/example

When I click one of the actions an exception occurs and I am told that

FreeMarker template error!

Expression extension is undefined on line 15, column 89 in
config-browser/showConfig.ftl.
The problematic instruction:
--
==gt; ${extension} [on line 15, column 87 in
config-browser/showConfig.ftl]

Is there a configuration error on my part perhaps? Even the 
config-browser

actions show this exception.



Musachy Barroso wrote:

 yes, that should be it. If you are learning||having problems, you can
use
 the Struts Config browser plugin:

 http://struts.apache.org/2.x/docs/config-browser-plugin.html

 to see the mapping of your actions and play around with them.

 musachy

 On 3/7/07, meeboo [EMAIL PROTECTED] wrote:


 Thanks for your quick reply, but I get a

 HTTP Status 404 - /com/bubbleclip/web/example/HelloWorld.action

 When you typed and access the action: you meant by typing
 
localhost:8080/application/com/bubbleclip/web/example/HelloWorld.action

 as
 the browser URL right?



 Musachy Barroso wrote:
 
  Try setting namespace=/com/bubbleclip/web/example, in the 
package,

 and
  access the action:
 
  {...}/com/bubbleclip/web/example/HelloWorld.action
 
  musachy
 
  On 3/7/07, meeboo [EMAIL PROTECTED] wrote:
 
 
  Hey all
 
  I recently decided to evaluate Struts2 for a big project, but am
 having
  difficulties mapping actions. I get the There is no Action
mapped...
  error
  when I try running the blank struts2 application.
 
  Here's my example.xml
 
  package name=example namespace=com/bubbleclip/web/example
  extends=struts-default
 
  action name=HelloWorld
  class=com.bubbleclip.web.example.HelloWorld
  result/web/example/HelloWorld.jsp/result
  /action
 
  action name=Login_* method={1}
  class=com.bubbleclip.web.example.Login
  result name=input/example/Login.jsp/result
  result type=redirect-actionMenu/result
  /action
 
  action name=* class=
 com.bubbleclip.web.example.ExampleSupport
  
  result/example/{1}.jsp/result
  /action
 
  !-- Add actions here --
  /package
 
  My directory tree looks like the following:
  application/src/com/bubbleclip/web/example/ExampleSupport.java
  application/src/com/bubbleclip/web/example/HelloWorld.java
  application/src/com/bubbleclip/web/example/Login.java
  application/src/com/bubbleclip/web/example/Login-validation.xml
  application/src/com/bubbleclip/web/example/Package.properties
  application/src/example.xml
  application/src/struts.xml
  application/web/index.html
  application/web/example/HelloWorld.jsp
  application/web/WEB-INF/web.xml
  --
  View this message in context:
 

http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9353654 


  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  Hey you! Would you help me to carry the stone? Pink Floyd
 
 

 --
 View this message in context:

http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9354348 


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


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




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



--
View this message in context:
http://www.nabble.com/There-is-no-Action-mapped-for-action-name-HelloWorld.unknown-location--tf3362312.html#a9355632 


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


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







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



Re: Unable to get Struts 2.0.6 working

2007-03-07 Thread Ian Roughley
I think you need to change the struts.properties file to enable .do as 
the extension rather than .action - this can also be achieved from the 
struts.xml file.


/Ian


ChristopherAngel wrote:

I am unable to get my own example web app working with struts 2.0.6

I am using Netbeans 5.5 and tomcat 5.5.17 and have included the following
jars:

commons-collections-3.2.jar  
freemarker-2.3.8.jar  
struts2-core-2.0.6.jar
commons-logging-1.0.4.jar
ognl-2.6.11.jar   
xwork-2.0.1.jar


struts.xml:
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;
struts
  package name=Struts extends=struts-default 
action name=StrutsSomething class=StrutsSomething

  result/StrutsSomething.jsp/result
/action
  /package
/struts

web.xml:
web-app id=WebApp_9 version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
display-nameStruts Something/display-name
filter
filter-namestruts2/filter-name
   
filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class

/filter
filter-mapping
filter-namestruts2/filter-name
url-pattern*.do/url-pattern
/filter-mapping
welcome-file-list
welcome-fileindex.html/welcome-file
/welcome-file-list
/web-app

When I deploy my webapp no errors are thrown but when i go to
http://localhost:8084/MyProject/StrutsSomething.do I get a 404.  The port
and host are correct as this is the tomcat instance I always use.

I have also put breakpoints in my StrutsSomething Action but it is not
reaching this code.

Please could some one tell me if there is anything in my configuration that
I am missing?



  


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



  1   2   >