Re: Struts 2.1 TabbedPanel scenario

2008-04-03 Thread Shoaib Gauhar

First of all, thanks for replying. I really appreciate it. Making a single
action class will make the classes very bulky and complex. I dont want to
have that. I used the remote tabs functionality in tabbed panel but all it
does is that it goes into a infinite recursive loop. It adds infinite number
of tabs and the page hangs. Maybe its an implementation error.

I dont know how to make the dataset common other than make one action class
which in my case is certainly achievable but not acceptable.

Let me make the scenario a bit more understandable.

I am working on a product which generates jsp pages and action classes in
struts 2. Lets suppose that the user has built two different jsps and action
classes. They work separately perfectly. Now, we are giving him the option
to make a tabbed pane by using those two sets of jsps and action classes.
One way would be to merge them and make one jsp and one action class. Which
in my case is again achievable but very complex and the code will not be
readable. The next idea which came to my mind (i dont know if it is
achievable or not) is to make one jsp but have two separate action classes.
Each tab remotely accessing the dataset of each action class.

There is no other idea which is coming to my mind at the moment. So, any
other idea will be highly appreciated. The worst thing is that the solution
must be generic. :,(

Thanks again,

Shoaib Ahmad Gauhar



Laurie Harper wrote:
 
 Shoaib Gauhar wrote:
 Hello,
 
 Here is the scenrio. I have two action classes. ClassA and ClassB. There
 is
 no relationship among these classes. You might say that if there is no
 relationship then why i have to put them in one single jsp. Well its a
 client's requirement.
 
 That's an implementation detail, not a functional requirement. Why does 
 the client care how you structure your actions?
 
 In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB.
 
 Each tab has fields concerned to their classes as defined above. Tab1 -
 ClassA and Tab2 - ClassB.
 
 Can we do it? I have tried this but what happens is that when i submit
 the
 data on Tab1, Tab2's data becomes empty.
 
 A request is only processed by one action. If you need both actions to 
 be able to process all the input from both tabs, you'll have to have 
 them both aware of the full dataset. There are a number of ways you 
 might achieve that, depending on what you're trying to achieve.
 
 So, any ideas will be highly appreciated. Furthermore, i am quite new to
 tabbed panel and would require clear tips and ideas.
 
 I haven't used that widget in Struts 2 so can't offer specific tips. 
 However, if you start by defining the functional requirements (rather 
 than the implementation details), it'll be easier to offer advice.
 
 L.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2.1-TabbedPanel-scenario-tp16446729p16465807.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]



Re: Actionerrors the Store Interceptor

2008-04-03 Thread Al Sutton

Chris,

I've used the StoreInterceptor and my opinion is that it just isn't flexible 
enough to use.


To illustrate the point, consider try following;

1) You have a View Action which displays all of the data of a specific type, 
which uses the StoreInterceptor in retrieve in order to show confirmation 
messages from an Update action.


2) You have an Edit Action which sends the user to edit.jsp via the 
dispatcher result type. edit.jsp has a menu taking the user to other places 
in the app.


3) You have an Update Action which is called by submitting a form on 
edit.jsp, this can return the user to edit.jsp using the dispatcher if there 
is a problem with the form data, or it can take the user to the View Action 
via a redirect if everything is OK. The Update Action uses the 
StoreInterceptor in STORE mode in order to send a confirmation back to the 
View Action.


Now, if the user gets to the edit stage submits the form, but has made a 
mistake which sends them back to edit.jsp, clicks on the menu to go to 
another action they end up seeing the error message twice, once when the get 
redirected back to edit.jsp from the UpdateAction, and a second time when 
they click on any of the links from the menu on edit.jsp.


If you want to track the resolution of this, you may want to look at the 
JIRA issue I raised about 10 months ago... 
https://issues.apache.org/struts/browse/WW-1963


Al.

- Original Message - 
From: Chris Pratt [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, April 02, 2008 10:55 PM
Subject: Re: Actionerrors  the Store Interceptor



Sorry Lucas, I'm still not seeing how that will help differentiate
between which result's need the messages collected and which don't?

And I have to agree with Laurie, that I don't understand the
difference between the store interceptor and what you're proposing.
 (*Chris*)

On Wed, Apr 2, 2008 at 2:47 PM, Lukasz Lenart
[EMAIL PROTECTED] wrote:

 Umm, that's what the Store Interceptor is.

 Not exactly, you have to specify for which action store the messages,
 and for which retrieve them back. There is no magic, everything hand
 coded ;-)



 Regards
 --
 Lukasz

 http://www.linkedin.com/in/lukaszlenart

 -


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: Actionerrors the Store Interceptor

2008-04-03 Thread Chris Pratt
On Wed, Apr 2, 2008 at 11:17 PM, Al Sutton [EMAIL PROTECTED] wrote:
 Chris,

  I've used the StoreInterceptor and my opinion is that it just isn't
 flexible enough to use.

  To illustrate the point, consider try following;

  1) You have a View Action which displays all of the data of a specific
 type, which uses the StoreInterceptor in retrieve in order to show
 confirmation messages from an Update action.

  2) You have an Edit Action which sends the user to edit.jsp via the
 dispatcher result type. edit.jsp has a menu taking the user to other places
 in the app.

  3) You have an Update Action which is called by submitting a form on
 edit.jsp, this can return the user to edit.jsp using the dispatcher if there
 is a problem with the form data, or it can take the user to the View Action
 via a redirect if everything is OK. The Update Action uses the
 StoreInterceptor in STORE mode in order to send a confirmation back to the
 View Action.

  Now, if the user gets to the edit stage submits the form, but has made a
 mistake which sends them back to edit.jsp, clicks on the menu to go to
 another action they end up seeing the error message twice, once when the get
 redirected back to edit.jsp from the UpdateAction, and a second time when
 they click on any of the links from the menu on edit.jsp.

  If you want to track the resolution of this, you may want to look at the
 JIRA issue I raised about 10 months ago...
 https://issues.apache.org/struts/browse/WW-1963


Yup, that pretty much describes exactly what we're seeing.  I think
the simplest fix would be to add a parameter to the s:actionerror,
s:actionmessage and s:fielderror tags, something like
remove=true, that when the message has been displayed, it removes it
from the list.  That way, if the result ends up forwarding rather than
redirecting, and the messages get shown and removed, there will be
nothing for the store interceptor to store and the messages will be
displayed only once.

It should be a fairly simple fix and be completely backward compatible
with anyone showing the messages multiple times on purpose.

Unfortunately I haven't been able to find a good work-around to this
and I really don't have the time in my project to not only learn the
code well enough to make this change, but then learn maven and enough
of the build procedures to integrate it into my project.  I would love
to hear from ANYONE who has figured a way out of this spiral.  Thanks.
  (*Chris*)

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



Re: xml based validation vs Annotations based validation

2008-04-03 Thread Lukasz Lenart
Hi,

 Wanted to get opinion from the struts2 user community if there are any
 advantages/disadvantages of using one approach over another (Xml vs Annotation
 based validation).

Nope ;-)

There is no one good answer for your question, because it depends ;-)
For me, the best thing is, you can combine all this two approach
together and even more, add method base validation (validate() and
validateXXX() ) to this stack.

I made some small test app to show such approach, you can download it
from here http://jdn.pl/files/test-app_0.zip (the site is in Polish
;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Security @ Struts2, using Acegy or Inspector

2008-04-03 Thread Lukasz Lenart
Hi,

  so, if I extend this action, the action will query and get security
  permission from database.. because i prefer database driven ..

You can do this with Acegi and even combine database with LDAP or with
something else.
I have used such solution in my projects.

  but i thinking a interceptor, but new in this area, i prefer a pattern that
  filter any action

Here you have simple solution how to integrate Acegi with Struts2
http://struts.apache.org/2.x/docs/can-we-use-acegi-security-with-the-framework.html


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [S2] Menu Tag Library struts-config.xml problem.

2008-04-03 Thread sassien

Of course, but in this page there is a section To upgrade from Struts Menu
1.x to Struts Menu 2.x... So I guess it should work with this. I wouldn't
have even tried if there hadn't been this section...
Anyway, I think someone managed already, and I would like to know how to
configure the files... %-|



newton.dave wrote:
 
 I don't know about S2/Struts-Menu integration, but I guarantee you that
 blindly following instructions for an S1 application has no chance of
 working
 in a typical S2 application.
 
 Dave
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Menu-Tag-Library-struts-config.xml-problem.-tp16447334p16467192.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]



[DEV-IMPLICATIONS] Re: Actionerrors the Store Interceptor

2008-04-03 Thread Al Sutton

Chris,

I'm familiar with the code, but the main problem is that there is a paper 
wall between the StoreInterceptor and the jsp tags, so that one does not 
know or rely on how the other works.


As far as I'm aware this is only a philosophical decision, and there is no 
technical reason why the tags can't removed information stored in the 
StoreInterceptor, but I'm pretty sure it would need the nod of those on the 
dev list to get into the final build.


Al.
- Original Message - 
From: Chris Pratt [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, April 03, 2008 7:31 AM
Subject: Re: Actionerrors  the Store Interceptor



On Wed, Apr 2, 2008 at 11:17 PM, Al Sutton [EMAIL PROTECTED] wrote:

Chris,

 I've used the StoreInterceptor and my opinion is that it just isn't
flexible enough to use.

 To illustrate the point, consider try following;

 1) You have a View Action which displays all of the data of a specific
type, which uses the StoreInterceptor in retrieve in order to show
confirmation messages from an Update action.

 2) You have an Edit Action which sends the user to edit.jsp via the
dispatcher result type. edit.jsp has a menu taking the user to other 
places

in the app.

 3) You have an Update Action which is called by submitting a form on
edit.jsp, this can return the user to edit.jsp using the dispatcher if 
there
is a problem with the form data, or it can take the user to the View 
Action

via a redirect if everything is OK. The Update Action uses the
StoreInterceptor in STORE mode in order to send a confirmation back to 
the

View Action.

 Now, if the user gets to the edit stage submits the form, but has made a
mistake which sends them back to edit.jsp, clicks on the menu to go to
another action they end up seeing the error message twice, once when the 
get

redirected back to edit.jsp from the UpdateAction, and a second time when
they click on any of the links from the menu on edit.jsp.

 If you want to track the resolution of this, you may want to look at the
JIRA issue I raised about 10 months ago...
https://issues.apache.org/struts/browse/WW-1963



Yup, that pretty much describes exactly what we're seeing.  I think
the simplest fix would be to add a parameter to the s:actionerror,
s:actionmessage and s:fielderror tags, something like
remove=true, that when the message has been displayed, it removes it
from the list.  That way, if the result ends up forwarding rather than
redirecting, and the messages get shown and removed, there will be
nothing for the store interceptor to store and the messages will be
displayed only once.

It should be a fairly simple fix and be completely backward compatible
with anyone showing the messages multiple times on purpose.

Unfortunately I haven't been able to find a good work-around to this
and I really don't have the time in my project to not only learn the
code well enough to make this change, but then learn maven and enough
of the build procedures to integrate it into my project.  I would love
to hear from ANYONE who has figured a way out of this spiral.  Thanks.
 (*Chris*)

-
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] checkboxes in each row of table - set values in action

2008-04-03 Thread lbastil

Thank you for reply!

I just wonder:

I understand it would work out of box for 1 User-Object, if I bound checkbox
to permission property of this user.
But I wonder it should work out of box if I use (as I described) Collection
of Users in Action
and on jsp side iterator tag, and checkbox tag within iterator is bound to
permission properties of users in the iterated Collection.

This does not matter, it should work the same as for single user object?


Thank you,
Basti


Laurie Harper wrote:
 
 lbastil wrote:
 Hello,
 
 I have the following problem:
 
 in action i have a collection of class User
 each class User have different attributes, one is: boolean permission
 
 in JSP I use struts 2 iterator tag to iterate the User Objects.
 For each User entry I create one row in table.
 for displaying/changing the boolean permission value I use S2 checkbox
 tag
 
 so far it works fine and show all data in collection of Users correct.
 
 But how can I set changed checkbox values (the permission attribute) back
 to
 action?
 
 If your checkbox is bound the the permission property of the user, 
 submitting the form should update the property. If that's not happening, 
 you need to give more details: what your JSP code looks like, and the 
 relevant bits of your action and User code, at least.
 
 L.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--checkboxes-in-each-row-of-table---set-values-in-action-tp16446895p16467308.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]



Re: [S2] Menu Tag Library struts-config.xml problem.

2008-04-03 Thread Laurie Harper
That's talking about upgrading from 1.x to 2.x of Struts Menu isn't it? 
I had a quick look at their Getting Started docs, and I think you would 
want to follow the Using Struts Menu outside of Struts documentation. 
The only thing I see that's Struts 1 specific is the plug-in 
configuration in struts-config.xml (a configuration file that is not 
used in Struts 2).


L.

sassien wrote:

Of course, but in this page there is a section To upgrade from Struts Menu
1.x to Struts Menu 2.x... So I guess it should work with this. I wouldn't
have even tried if there hadn't been this section...
Anyway, I think someone managed already, and I would like to know how to
configure the files... %-|



newton.dave wrote:

I don't know about S2/Struts-Menu integration, but I guarantee you that
blindly following instructions for an S1 application has no chance of
working
in a typical S2 application.

Dave






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



Re: [S2] checkboxes in each row of table - set values in action

2008-04-03 Thread Laurie Harper
Provided the checkbox is properly bound to the collection entry, yes. 
You need to specify the name of the s:checkbox (or any other input type) 
as userCollection[index].userProperty where 'userCollection' is the name 
of the Collection property on your action, index comes from the iterator 
and userProperty is the property to bind to.


L.

lbastil wrote:

Thank you for reply!

I just wonder:

I understand it would work out of box for 1 User-Object, if I bound checkbox
to permission property of this user.
But I wonder it should work out of box if I use (as I described) Collection
of Users in Action
and on jsp side iterator tag, and checkbox tag within iterator is bound to
permission properties of users in the iterated Collection.

This does not matter, it should work the same as for single user object?


Thank you,
Basti


Laurie Harper wrote:

lbastil wrote:

Hello,

I have the following problem:

in action i have a collection of class User
each class User have different attributes, one is: boolean permission

in JSP I use struts 2 iterator tag to iterate the User Objects.
For each User entry I create one row in table.
for displaying/changing the boolean permission value I use S2 checkbox
tag

so far it works fine and show all data in collection of Users correct.

But how can I set changed checkbox values (the permission attribute) back
to
action?
If your checkbox is bound the the permission property of the user, 
submitting the form should update the property. If that's not happening, 
you need to give more details: what your JSP code looks like, and the 
relevant bits of your action and User code, at least.


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: struts.xml

2008-04-03 Thread Adam Hardy

Adam Hardy on 02/04/08 12:23, wrote:
Can I have a second struts.xml in my test directory, and if so, how do I 
configure it?


I'm testing some stuff using HttpUnit which launches the whole webapp in 
my tests. Having a test-only struts.xml will keep the test mappings out 
of the real webapp, allow me to drop stuff I don't need for the tests, 
and make the tests faster.


From the lack of replies, I assume the answer is 'No, you cannot have an 
alternative struts.xml'.


I was checking the low-down on the wiki, where I found that the struts 
configuration xml can be in multiple files listed by the property in the 
struts.properties:


### A list of configuration files automatically loaded by Struts
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

Using this property, I can set up my maven environment to filter 
struts.properties as a resource and set that property explicitly, so in testing 
I can have 'struts-test.xml'


This works to a limited extent, i.e. one struts.xml for all testing, another for 
in-container deployment.


It's not quite ideal though, as I would prefer to choose the struts.xml on a 
per-test basis.


Does anyone know of something I've missed that allows this?

Thanks
Adam

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



org.apache.jasper.JasperException: tag 'select'

2008-04-03 Thread Alex Shneyderman
I am runing my app on jetty and I am getting the Error below (edited
to hide private info)

I have a page that contains this JSP:

s:action name=countriesLookup namespace=/lookup id=cl
executeResult=false /

s:actionerror/
s:form action=helloWorld
s:textfield label=What is your name? name=name /
s:textfield label=What is the date? name=dateNow /
s:textfield label=first Name name=firstName /
s:select list=#cl.countries name=country listKey=code
listValue=name /
s:submit /
/s:form

this works fine on first display. The trouble seems to occur when
there is validation error and I am redirected to input. All of a
sudden the list can not be looked up.


Anyone has an idea of what might be wrong?


This is with jetty being run from a maven plugin.

HTTP ERROR: 500

tag 'select', field 'list', name 'country': The requested list key
'#cl.countries' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unknown location]

RequestURI=/*
Caused by:

org.apache.jasper.JasperException: tag 'select', field 'list', name
'country': The requested list key '#cl.countries' could not be
resolved as a collection/array/map/enumeration/iterator type. Example:
people or people.{name} - [unknown location]
at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:402)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:285)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at 
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:139)
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 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at 
com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at 

Freemarker (old version that struts2 uses) disappearing pages

2008-04-03 Thread Jonny Cavell

I have a problem that seems to occur periodically.

My freemarker templates, served by struts2, stop appearing - I get a blank
page. There are no useful messages in the logs, other than saying that it
couldn't find the template (which it could find previously).

First question - does anybody know what this problem might be?

I would like to upgrade to the latest version of Freemarker. However,
Struts2 in its wisdom has locked me down to version 2.3.8, and this was
released way back in 2006. Are there any plans to resolve this issue? 

I was hoping that upgrading might fix my problems..

Jonny




-- 
View this message in context: 
http://www.nabble.com/Freemarker-%28old-version-that-struts2-uses%29-disappearing-pages-tp16467449p16467449.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]



Re: s:radio issue

2008-04-03 Thread Dave Newton
--- Niral Trivedi [EMAIL PROTECTED] wrote:
 I am using Struts 2.0.11 on RAD7, Webspher 6.1, JDK 1.5.

Hey, me too. My sympathies.

 I am trying to create radio buttons using a dynamic Map as below:
 
 s:bean name=java.util.HashMap id=keepRemoveRadioMap
 s:param name=Keep value=john/
 s:param name=Remove value=doe/
 /s:bean
 
 td width=20% style=background-color:#fffade; vertical-align:center
 s:radio name=keepRemove list=keepRemoveRadioMap  onclick=
 changeKeep1() theme=simple/
 /td
 
 But when I try to load the page, it is giving Freemaker Template exception
 as below(I haven't pasted entire stack trace for readability) :

What happens if you use list=#keepRemoveRadioMap?

While I've never used the s:bean... tag, normally when you create an object
in the OGNL context like that you need to refer to it with a leading #
meaning that it's a named object, not a property of an object on the value
stack.

Dave


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



Re: Security @ Struts2, using Acegy or Inspector

2008-04-03 Thread Randy Burgess
A servlet filter is relatively easy if you are going to put restrictions on
the actions alone and you don't have to mess with interceptor stacks. We've
done both interceptors and a filter and the filter is lower maintenance.
Just put the filter before the struts 2 filter in your web.xml. If you want
to secure more than the actions then I think Acegi is the way to go.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



 From: Frans Thamura [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List user@struts.apache.org
 Date: Thu, 3 Apr 2008 07:13:20 +0700
 To: Struts Users Mailing List user@struts.apache.org
 Subject: Re: Security @ Struts2, using Acegy or Inspector
 
 If you anticipate having the complexity of a full ACL implementation, I'd
 just go ahead and use AceGI; why re-invent all that machinery? If you decide
 to roll your own, though, then the interceptor can access the action through
 the ActionInvocation object and, through the action, can access your POJO
 via whatever mechanism you want -- via ModelDriven's getModel() method,
 through an interceptor-specific interface you design, or whatever.
 
 
 my idea is to make a class that extend Action
 
 so, if I extend this action, the action will query and get security
 permission from database.. because i prefer database driven ..
 
 but i thinking a interceptor, but new in this area, i prefer a pattern that
 filter any action
 
 but.. i am loking also in AOP of spring or may be a HTTPFilter mechanism
 (still dont know, how to implement Struts2 based in the httpfilter)
 
 
 F



This email and any attachments (Message) may contain legally privileged 
and/or confidential information.  If you are not the addressee, or if this 
Message has been addressed to you in error, you are not authorized to read, 
copy, or distribute it, and we ask that you please delete it (including all 
copies) and notify the sender by return email.  Delivery of this Message to any 
person other than the intended recipient(s) shall not be deemed a waiver of 
confidentiality and/or a privilege.

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



struts2 datetimepicker multiple selections

2008-04-03 Thread zakaria ghandour

Hi,
i want to know if it 's possible to allow multiple selections in same
datetimepicker struts2 component? (to select more than one date) 
thanks
-- 
View this message in context: 
http://www.nabble.com/struts2-datetimepicker-multiple-selections-tp16467478p16467478.html
Sent from the Struts - User mailing list archive at Nabble.com.


Re: new to sturts

2008-04-03 Thread Musachy Barroso
Showcase uses sitemesh and the tab links are on the sitemesh template.
If you are just starting you will find it easier to play with
struts-blank (distributed with struts).

musachy

On Thu, Apr 3, 2008 at 10:50 AM, ghan_java [EMAIL PROTECTED] wrote:

  hi all, i am new to struts 2 ,
   i have download a struts's application (struts showcase) and run it . it's
  working fine ,  but i am not able to get how it's(page) header set (where
  are different tabs for different application)  .

  if i want to change this header , we i need to change ??

  --
  View this message in context: 
 http://www.nabble.com/new-to-sturts-tp16467538p16467538.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]





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

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



RE: struts.xml

2008-04-03 Thread Relph,Brian
 
Copy paste error, you need to initialize the Dispatcher with your testConfig 
map:

MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);
dispatcher = new Dispatcher(servletContext,
testConfig);
dispatcher.init();
Dispatcher.setInstance(dispatcher);


-Original Message-
From: Relph,Brian [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 9:48 AM
To: Struts Users Mailing List
Subject: RE: struts.xml


You need to have access to the Dispatcher and the ServletContext in your tests, 
but you could do something like this for per-unit test configurations:

ConfigurationProvider provider = new StrutsXmlConfigurationProvider(
struts-test.xml, true, servletContext);
dispatcher.getConfigurationManager().addConfigurationProvider(provider);
dispatcher.getConfigurationManager().reload();

If you set devMode = true for your tests, you might be able to avoid the 
reload() call.

If you have a just a single struts-test.xml for all of your tests, you could 
do something like this in your setUp():

MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);
dispatcher = new Dispatcher(servletContext,
new HashMapString, String());
dispatcher.init();
Dispatcher.setInstance(dispatcher); 


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 5:00 AM
To: Struts Users Mailing List
Subject: Re: struts.xml

Adam Hardy on 02/04/08 12:23, wrote:
 Can I have a second struts.xml in my test directory, and if so, how do 
 I configure it?
 
 I'm testing some stuff using HttpUnit which launches the whole webapp 
 in my tests. Having a test-only struts.xml will keep the test mappings 
 out of the real webapp, allow me to drop stuff I don't need for the 
 tests, and make the tests faster.

 From the lack of replies, I assume the answer is 'No, you cannot have an 
alternative struts.xml'.

I was checking the low-down on the wiki, where I found that the struts 
configuration xml can be in multiple files listed by the property in the
struts.properties:

### A list of configuration files automatically loaded by Struts 
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

Using this property, I can set up my maven environment to filter 
struts.properties as a resource and set that property explicitly, so in testing 
I can have 'struts-test.xml'

This works to a limited extent, i.e. one struts.xml for all testing, another 
for in-container deployment.

It's not quite ideal though, as I would prefer to choose the struts.xml on a 
per-test basis.

Does anyone know of something I've missed that allows this?

Thanks
Adam

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

--
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

-
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]



java.lang.NoSuchMethodError: org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)

2008-04-03 Thread DWilkerson
Hello all.

I am using MyEclipse, JBoss 4.0.2, and Struts 1.3.8. I have an exploded war
file directory that contains the skeleton files for my Struts app. When I
deploy to JBoss using the MyEclipse facilities for this, I get a
java.lang.NoSuchMethodError:
org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)

I tried posting on the MyEclipse forums for this, but their support people
advised to cross post on some Struts forums too. My stack trace and product
version info is below. Thanks in advance!!

dw

Daniel Wilkerson
SPARTA, Inc.
13501 Ingenuity Drive - Suite 132
Orlando, Fl. 32826-3009
TEL:(407)380-0076 ext.121
IDE: (321)235-7667
email:[EMAIL PROTECTED] 

==
Environment Info:
==
I am using the following products:
Eclipse Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
Build id: M20070921-1145

MyEclipse Version: 6.0.1.zmyeclipse601200710
Build id: 6.0.1-GA-200710

JBoss 4.0.2

Struts 1.3.8.

==
Offending Lines of Code (Tomcat Generated Servlets)
==
I checked the generated servlets to see the offending lines of code getting
executed in the stack trace below. The exception was thrown at lines 68 and
then again at 95.

* line 68 is:if (_jspx_meth_html_form_0(_jspx_page_context)) return;

* line 95 is: int _jspx_eval_html_form_0 =
_jspx_th_html_form_0.doStartTag();

==
The stack trace in my JBoss console is:
==
12:38:58,226 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError:
org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)
Lorg/apache/struts/config/ActionConfig;
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:823)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:467)
at
org.apache.jsp.form.exerciseControlViewInput_jsp._jspx_meth_html_form_0(org.
apache.jsp.form.exerciseControlViewInput_jsp:95)
at
org.apache.jsp.form.exerciseControlViewInput_jsp._jspService(org.apache.jsp.
form.exerciseControlViewInput_jsp:68)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
22)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja
va:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalVal
ve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci
ationValve.java:153)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
59)
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:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThre
ad.java:112)
at java.lang.Thread.run(Thread.java:595)



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



RE: struts.xml

2008-04-03 Thread Relph,Brian

You need to have access to the Dispatcher and the ServletContext in your tests, 
but you could do something like this for per-unit test configurations:

ConfigurationProvider provider = new StrutsXmlConfigurationProvider(
struts-test.xml, true, servletContext);
dispatcher.getConfigurationManager().addConfigurationProvider(provider);
dispatcher.getConfigurationManager().reload();

If you set devMode = true for your tests, you might be able to avoid the 
reload() call.

If you have a just a single struts-test.xml for all of your tests, you could 
do something like this in your setUp():

MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);
dispatcher = new Dispatcher(servletContext,
new HashMapString, String());
dispatcher.init();
Dispatcher.setInstance(dispatcher); 


-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 5:00 AM
To: Struts Users Mailing List
Subject: Re: struts.xml

Adam Hardy on 02/04/08 12:23, wrote:
 Can I have a second struts.xml in my test directory, and if so, how do 
 I configure it?
 
 I'm testing some stuff using HttpUnit which launches the whole webapp 
 in my tests. Having a test-only struts.xml will keep the test mappings 
 out of the real webapp, allow me to drop stuff I don't need for the 
 tests, and make the tests faster.

 From the lack of replies, I assume the answer is 'No, you cannot have an 
alternative struts.xml'.

I was checking the low-down on the wiki, where I found that the struts 
configuration xml can be in multiple files listed by the property in the
struts.properties:

### A list of configuration files automatically loaded by Struts 
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

Using this property, I can set up my maven environment to filter 
struts.properties as a resource and set that property explicitly, so in testing 
I can have 'struts-test.xml'

This works to a limited extent, i.e. one struts.xml for all testing, another 
for in-container deployment.

It's not quite ideal though, as I would prefer to choose the struts.xml on a 
per-test basis.

Does anyone know of something I've missed that allows this?

Thanks
Adam

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

--
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

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



new to sturts

2008-04-03 Thread ghan_java

hi all, i am new to struts 2 , 
 i have download a struts's application (struts showcase) and run it . it's
working fine ,  but i am not able to get how it's(page) header set (where
are different tabs for different application)  .

if i want to change this header , we i need to change ??

-- 
View this message in context: 
http://www.nabble.com/new-to-sturts-tp16467538p16467538.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]



Re: java.lang.NoSuchMethodError: org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)

2008-04-03 Thread Antonio Petrelli
2008/4/3, DWilkerson [EMAIL PROTECTED]:

 I am using MyEclipse, JBoss 4.0.2, and Struts 1.3.8

...
 java.lang.NoSuchMethodError:

 org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)



ModuleConfig.findActionConfigId has been introduced since Struts 1.3.6.
http://struts.apache.org/1.x/apidocs/org/apache/struts/config/ModuleConfig.html#findActionConfigId(java.lang.String)

Probably you are messing with JARs of the taglib and the core. Are you sure
that they are of the same Struts version?

Antonio


RE: java.lang.NoSuchMethodError: org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)

2008-04-03 Thread DWilkerson
Thanks for the reply Antonio. I sincerely appreciate it. 

I solved the problem. Figures as soon as I go on a posting spree...lol. It's
the way it always works. 

When clicking Redeploy in MyEclipse to push your updated files to the
server, MyEclipse didn't delete the Struts 2 jars from my deployed
WEB-INF/lib directory. I had been experimenting with Struts 2. Now, I can
see why I got that error. The fix was to remove the war file using the
remove button on the MyEclipse deployment dialog, bounce JBoss, then
redeploy. Now only the 1.3.8 jars are there and no more error. Life is good
again. 

Thanks again!
dw 

-Original Message-
From: Antonio Petrelli [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 11:05 AM
To: Struts Users Mailing List
Subject: Re: java.lang.NoSuchMethodError:
org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/String;)

2008/4/3, DWilkerson [EMAIL PROTECTED]:

 I am using MyEclipse, JBoss 4.0.2, and Struts 1.3.8

...
 java.lang.NoSuchMethodError:

 org.apache.struts.config.ModuleConfig.findActionConfigId(Ljava/lang/St
 ring;)



ModuleConfig.findActionConfigId has been introduced since Struts 1.3.6.
http://struts.apache.org/1.x/apidocs/org/apache/struts/config/ModuleConfig.h
tml#findActionConfigId(java.lang.String)

Probably you are messing with JARs of the taglib and the core. Are you sure
that they are of the same Struts version?

Antonio



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



Re: [DEV-IMPLICATIONS] Re: Actionerrors the Store Interceptor

2008-04-03 Thread Chris Pratt
On Thu, Apr 3, 2008 at 1:03 AM, Al Sutton [EMAIL PROTECTED] wrote:
 Chris,

  I'm familiar with the code, but the main problem is that there is a paper
 wall between the StoreInterceptor and the jsp tags, so that one does not
 know or rely on how the other works.

  As far as I'm aware this is only a philosophical decision, and there is no
 technical reason why the tags can't removed information stored in the
 StoreInterceptor, but I'm pretty sure it would need the nod of those on the
 dev list to get into the final build.


Actually it wouldn't be removing information stored in the
StoreInterceptor as much as removing the already shown messages from
the lists stored in the Action.  So, by the time he StoreInterceptor
got control, there would be nothing to store.
  (*Chris*)

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



Initialization before the Application Startup.

2008-04-03 Thread JiVi

Hi All,

I'm new to Struts2 . I dont know about Struts1.x either. Jus thought of
starting with Struts2.

I'm creating a web application. I jus want to initialize the system before
the application startup. Like reading certain config files, initializing the
Connection Pool, creating DAO factory.. etc.
I read somewhere that Struts1 has plugins to support this. But i couldnt
find anything in Struts2.
Please help me out.

Thanks and Regards,
Jijo

-- 
View this message in context: 
http://www.nabble.com/Initialization-before-the-Application-Startup.-tp16467793p16467793.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]



connecting s:autocompleter and s:div

2008-04-03 Thread manishbel

Hello,

I wish to connect the s:autocompleter and s:div so that when the value in
autocompleter changes i need to refresh the div content to retrieve its
values.

here the code that i currently have 

s:div cssClass=formcontainer href=%{EmailDistributionList_Load}
theme=ajax listenTopics=distributionListNameChange autoStart=false
formId=EmailDistributionList 

s:autocompleter name=emailDistributionList.distributionListName
keyName=emailDistributionList.id
list=emailDistributionLists  listKey=id
listValue=distributionListName searchType=substring 
notifyTopics=distributionListNameChange theme=ajax / 

this cuases the div to load over again and again.

Thanks
Manish

-- 
View this message in context: 
http://www.nabble.com/connecting-s%3Aautocompleter-and-s%3Adiv-tp16467799p16467799.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]



Initialization before the Application Startup.

2008-04-03 Thread JiVi

Hi All,

I'm new to Struts2 . I dont know about Struts1.x either. Jus thought of
starting with Struts2.

I'm creating a web application. I jus want to initialize the system before
the application startup. Like reading certain config files, initializing the
Connection Pool, creating DAO factory.. etc.
I read somewhere that Struts1 has plugins to support this. But i couldnt
find anything in Struts2.
Please help me out.

Thanks and Regards,
Jijo

-- 
View this message in context: 
http://www.nabble.com/Initialization-before-the-Application-Startup.-tp16467802p16467802.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]



Re: [DEV-IMPLICATIONS] Re: Actionerrors the Store Interceptor

2008-04-03 Thread Al Sutton
The action messages and errors are stored in a request attribute which is 
why the don't survive a redirect.


I played around with some ideas and found that Freemarker (the template 
language used for the tags), is just too dumb to clear session scoped 
variables (which would survive a redirect and are used by the 
MessageStoreInterceptor), so I guess we're kind of stuffed until someone 
works on the core code and comes up with a method that works.


Al.

P.S. The errors are delt with inside Xwork and not S2.1, so it's not a 
simple job :(.


- Original Message - 
From: Chris Pratt [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, April 03, 2008 4:42 PM
Subject: Re: [DEV-IMPLICATIONS] Re: Actionerrors  the Store Interceptor



On Thu, Apr 3, 2008 at 1:03 AM, Al Sutton [EMAIL PROTECTED] wrote:

Chris,

 I'm familiar with the code, but the main problem is that there is a 
paper

wall between the StoreInterceptor and the jsp tags, so that one does not
know or rely on how the other works.

 As far as I'm aware this is only a philosophical decision, and there is 
no

technical reason why the tags can't removed information stored in the
StoreInterceptor, but I'm pretty sure it would need the nod of those on 
the

dev list to get into the final build.



Actually it wouldn't be removing information stored in the
StoreInterceptor as much as removing the already shown messages from
the lists stored in the Action.  So, by the time he StoreInterceptor
got control, there would be nothing to store.
 (*Chris*)

-
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]



[OT] Re: Initialization before the Application Startup.

2008-04-03 Thread Dave Newton
--- JiVi [EMAIL PROTECTED] wrote:
 I'm new to Struts2 . I dont know about Struts1.x either. Jus thought of
 starting with Struts2.
 
 I'm creating a web application. I jus want to initialize the system before
 the application startup. Like reading certain config files, initializing
 the
 Connection Pool, creating DAO factory.. etc.
 I read somewhere that Struts1 has plugins to support this. But i couldnt
 find anything in Struts2.
 Please help me out.

You may want to use a ServletContextListener.

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html

Dave


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



Re: any struts 2 unit testers out there?

2008-04-03 Thread paulbrickell

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(LocalizedTextUtil.java:299)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87)
at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
SNIP
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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(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(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


It is caused by ActionContext.getContext() returning null. Quite obviously I
do not have an action context during my unit testing.

Now I can certainly use the ActionContext.setContext() in my tests setup
method to push one into thread local storage and that works OK. It isn't
ideal though because ActionContext is a concrete class and so my choices
then become a bit limited. 

I could create an instance but when I try this I find I have to create a
rather large object model to make it actually work. To the point where I
despair and give up.

Alternatively I could use a mock library (like easy mock). But I am not
inclined to include a mocking library that requires byte code rewriting (not
even for testing).

What I really want to do is inject a text provider into the ActionSupport
class. At the top of the ActionSupport class is this...

private final transient TextProvider textProvider = new
TextProviderFactory().createInstance(getClass(), this);

Damn its final and so I cannot inject my own text provider. 

BUT it uses a factory, thats good. I know I will have a look at the factory
I bet I can monkey with that and inject a mock. Nope. It's all instance
based. No way I can get in there. And thats that. Now what do I do?

I can see two (half) workable solutions.

One is to override the the getText method in the action class when I
instantiate it during testing. So I end up doing this in all my action unit
tests...

Action action = new MyAction()
{
@Override
public String getText(String textName)
{
return mocked;
}
};

It works, but its cheese.

Or two I can add a level of indirection in my action class, like so...


String text =
MyTextProviderFactory.getInstance(class.name).getText(some.property);

Then I can use a delegate to the real text provider during live code and a
mock of my own text provider during testing. The question here is, Why for
the love of Pete, why?

So in conclusion there are at least four options for testing Action classes
that use get text.

1. Build an action context by hand. (Too hard)
2. Use a class rewriting mocking library. (Not on my watch)
3. Mock the get text method. (Cheese)
4. Add another level of indirection. (Man thats just annoying)

Comments?

BTW If you got this far, thanks for taking the time.
Paul B.




Session Mwamufiya wrote:
 
 Hi All,
 
 Would someone let me know whether it's possible to tweak something so 

Problem with submitting an additional param in a form

2008-04-03 Thread Peter Theissen

Hello everbody,

I'm new to Struts2 and also this mailing list.
I'm programming a user management for a non-profit organisation.

My question is now:
I have started with the basic struts2 application. In the index.jsp
there is a form which looks (nearly) like this:

   s:form action=saveReg validate=true
   s:param name=status value=waiting /   
   s:textfield id=id name=registration.id 
cssStyle=display:none/
   s:textfield id=firstName label=First Name 
name=registration.firstName/
   s:textfield id=lastName label=Laste Name 
name=registration.lastName/
   s:textfield id=email label=Email 
name=registration.email/
   s:submit theme=ajax targets=registrations 
notifyTopics=/save/

   /s:form

Why cant I append the paramter 'status' and pass it through to the 
action class?

I read a lot of docs and faqs but didnt find the answer.
Is it my mistake, a bug or do I need a certain workaround?
I thought about taking a display:none textfield, but it would make me
quite unhappy to start the project with dirty tricks and workarounds ;-)

Any help appreciated.

Best regards
Peter



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



clearFieldErrors() - where is it ?

2008-04-03 Thread it

Hi guys,

in struts2 i have a class that extends ActionSupport.

In my validate method i can use clearErrorsAndMessages(); but when i try
clearFieldErrors() eclipse can not find it .

Should i put setFieldErrors(null); or extend another class ?

I appreciate your replies.

Regards,

Leon


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



Re: Problem with submitting an additional param in a form

2008-04-03 Thread Ryan
I think what you are looking for is:
s:hidden name=status value=waiting /

This creates a hidden input field in the form which then passes the status
parameter to the request when the form submits.

On 4/3/08, Peter Theissen [EMAIL PROTECTED] wrote:

 Hello everbody,

 I'm new to Struts2 and also this mailing list.
 I'm programming a user management for a non-profit organisation.

 My question is now:
 I have started with the basic struts2 application. In the index.jsp
 there is a form which looks (nearly) like this:
 
   s:form action=saveReg validate=true
   s:param name=status value=waiting /
 s:textfield id=id name=registration.id cssStyle=display:none/
   s:textfield id=firstName label=First Name
 name=registration.firstName/
   s:textfield id=lastName label=Laste Name
 name=registration.lastName/
   s:textfield id=email label=Email
 name=registration.email/
   s:submit theme=ajax targets=registrations
 notifyTopics=/save/
   /s:form
 
 Why cant I append the paramter 'status' and pass it through to the action
 class?
 I read a lot of docs and faqs but didnt find the answer.
 Is it my mistake, a bug or do I need a certain workaround?
 I thought about taking a display:none textfield, but it would make me
 quite unhappy to start the project with dirty tricks and workarounds ;-)

 Any help appreciated.

 Best regards
 Peter



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




Re: Connecting s:autocompleter and s:div

2008-04-03 Thread Musachy Barroso
The problem is that the notify topics are published multiple times
(before request, after request and on error). A parameter is passed to
the topic listener indicating when the topic is fired. Search the
archives for examples (dojo.event.topic.subscribe), also look at the
ajax examples on showcase.

musachy

On Thu, Apr 3, 2008 at 1:00 PM, manishbel [EMAIL PROTECTED] wrote:

  Hello There,

  I am new to struts and have a requirement where i have to connect the
  autocompleter with the div e.g. when autocompleter's value changes  i need
  to refresh the contents of the div. i have written the following code to
  achieve that.

  The Div Code
  --
  s:div cssClass=formcontainer href=%{EmailDistributionList_Load}
  theme=ajax listenTopics=distributionListNameChange autoStart=false
  formId=EmailDistributionList 

  The AutoCompleter Code
  -
  s:autocompleter name=emailDistributionList.distributionListName
  keyName=emailDistributionList.id
 list=emailDistributionLists  listKey=id
 listValue=distributionListName 
 searchType=substring
  notifyTopics=distributionListNameChange theme=ajax /

  When the jsp loads it tries to refresh the page over and over submitting the
  request to EmailDistributionList_Load action.

  Any pointers would be greatly appreciated.

  Thanks
  Manish

  --
  View this message in context: 
 http://www.nabble.com/Connecting-s%3Aautocompleter-and-s%3Adiv-tp16467820p16467820.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]





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

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



RE: any struts 2 unit testers out there?

2008-04-03 Thread Relph,Brian

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(LocalizedTextUtil.java:299)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87)
at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
SNIP
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.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(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(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


It is caused by ActionContext.getContext() returning null. Quite obviously I do 
not have an action context during my unit testing.

Now I can certainly use the ActionContext.setContext() in my tests setup method 
to push one into thread local storage and that works OK. It isn't ideal though 
because ActionContext is a concrete class and so my choices then become a bit 
limited. 

I could create an instance but when I try this I find I have to create a rather 
large object model to make it actually work. To the point where I despair and 
give up.

Alternatively I could use a mock library (like easy mock). But I am not 
inclined to include a mocking library that requires byte code rewriting (not 
even for testing).

What I really want to do is inject a text provider into the ActionSupport 
class. At the top of the ActionSupport class is this...

private final transient TextProvider textProvider = new 
TextProviderFactory().createInstance(getClass(), this);

Damn its final and so I cannot inject my own text provider. 

BUT it uses a factory, thats good. I know I will have a look at the factory I 
bet I can monkey with that and inject a mock. Nope. It's all instance based. No 
way I can get in there. And thats that. Now what do I do?

I can see two (half) workable solutions.

One is to override the the getText method in the action class when I 
instantiate it during testing. So I end up doing this in all my action unit 
tests...

Action action = new MyAction()
{
@Override
public String getText(String textName)
{
return mocked;
}
};

It works, but its cheese.

Or two I can add a level of indirection in my action class, like so...


String text =
MyTextProviderFactory.getInstance(class.name).getText(some.property);

Then I can use a delegate to the real text provider during live code and a mock 
of my own text provider during testing. The question here is, Why for the love 
of Pete, 

s:iterator tag help

2008-04-03 Thread Eric Nelson
Hi.  This question may be very simple to answer, but it's driving me
crazy.  If I have code similar to:

 

s:iterator value=intList

/s:iterator

 

Where intList is of type ListInteger, how do I reference to current
Integer on the value stack without using s:property /?  So I want to
reference the current Integer with OGNL or EL expression language like:

 

select

s:iterator value=intList

option value=${currInt} s:if test=${currInt ==
1}selected/s:if${currInt}/option

/s:iterator

/select

 

Here, currInt is the reference to the current Integer on the value
stack.  I hope this makes sense.  Any help would be greatly appreciated.

 

Thanks,

 

Eric Nelson

Software Engineer Program Manager

 



Re: s:iterator tag help

2008-04-03 Thread Musachy Barroso
Use the id attribute in the for tag, like id=currInt.

musachy

On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson [EMAIL PROTECTED] wrote:
 Hi.  This question may be very simple to answer, but it's driving me
  crazy.  If I have code similar to:



  s:iterator value=intList

  /s:iterator



  Where intList is of type ListInteger, how do I reference to current
  Integer on the value stack without using s:property /?  So I want to
  reference the current Integer with OGNL or EL expression language like:



  select

  s:iterator value=intList

 option value=${currInt} s:if test=${currInt ==
  1}selected/s:if${currInt}/option

  /s:iterator

  /select



  Here, currInt is the reference to the current Integer on the value
  stack.  I hope this makes sense.  Any help would be greatly appreciated.



  Thanks,



  Eric Nelson

  Software Engineer Program Manager







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

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



Simple question in s:tabbedPanel

2008-04-03 Thread sharath karnati
Hi All,
   
I'm having following tabbedpanel,whenever I select a tabbed pane I'd like 
to call a javascript method. I tried onselect/onclick but these are not working.
   
 
  s:tabbedPanel id=tabContainer cssStyle=valign:top; height: 500px; 
doLayout=true 
   
  s:div id=Panel1 label=Admin theme=ajax  labelposition=top  
onselect=javascript:loading('Panel1');
  This is Panel1br/ 
  /s:div 
   
  s:div id=Panel2 label=Detail theme=ajax  labelposition=top  
onselect=javascript:loading('Panel2');
  This is Panel2br/ 
  /s:div
  /s:tabbedPanel
   
  Thanks for your help in advance.
   
  Regards,
  Sharath.

   
-
You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.

Re: s:iterator tag help

2008-04-03 Thread Musachy Barroso
I meant iterator tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso [EMAIL PROTECTED] wrote:
 Use the id attribute in the for tag, like id=currInt.

  musachy



  On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson [EMAIL PROTECTED] wrote:
   Hi.  This question may be very simple to answer, but it's driving me
crazy.  If I have code similar to:
  
  
  
s:iterator value=intList
  
/s:iterator
  
  
  
Where intList is of type ListInteger, how do I reference to current
Integer on the value stack without using s:property /?  So I want to
reference the current Integer with OGNL or EL expression language like:
  
  
  
select
  
s:iterator value=intList
  
   option value=${currInt} s:if test=${currInt ==
1}selected/s:if${currInt}/option
  
/s:iterator
  
/select
  
  
  
Here, currInt is the reference to the current Integer on the value
stack.  I hope this makes sense.  Any help would be greatly appreciated.
  
  
  
Thanks,
  
  
  
Eric Nelson
  
Software Engineer Program Manager
  
  
  
  



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




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

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



Re: s:iterator tag help

2008-04-03 Thread Dustin S.
Not sure I understand your question ... but

Are you aware of the status attribute in the iterator tag?

Something like:

s:iterator value=intList status=rowstatus
   option value=rowstatus.count...etc
/s:iterator
On Thu, Apr 3, 2008 at 2:54 PM, Musachy Barroso [EMAIL PROTECTED] wrote:

 I meant iterator tag ;)

 musachy

 On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso [EMAIL PROTECTED] wrote:
  Use the id attribute in the for tag, like id=currInt.
 
   musachy
 
 
 
   On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson 
 [EMAIL PROTECTED] wrote:
Hi.  This question may be very simple to answer, but it's driving me
 crazy.  If I have code similar to:
   
   
   
 s:iterator value=intList
   
 /s:iterator
   
   
   
 Where intList is of type ListInteger, how do I reference to
 current
 Integer on the value stack without using s:property /?  So I want
 to
 reference the current Integer with OGNL or EL expression language
 like:
   
   
   
 select
   
 s:iterator value=intList
   
option value=${currInt} s:if test=${currInt ==
 1}selected/s:if${currInt}/option
   
 /s:iterator
   
 /select
   
   
   
 Here, currInt is the reference to the current Integer on the value
 stack.  I hope this makes sense.  Any help would be greatly
 appreciated.
   
   
   
 Thanks,
   
   
   
 Eric Nelson
   
 Software Engineer Program Manager
   
   
   
   
 
 
 
   --
   Hey you! Would you help me to carry the stone? Pink Floyd
 



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

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




Re: rrrrr...why my field returns null????

2008-04-03 Thread Laurie Harper
If it works without theme set to ajax, it's probably a client-side 
issue. What browser are you using? Are there any Javascript errors reported?


L.

xianwinwin wrote:

thank you Laurie for your reply.

I made a type - its str not the Note. so the str is null :-(

when I remove the theme=ajax it works fine. BUT I need it there (the idea
that the form will disappear once the action is completed).

how do I get the value of the str? rr :-(
I've been trying different variation - nothing! 

thanks for any pointer!  




Laurie Harper wrote:
Your action doesn't have a bean of name/type Note, it only has a single 
String property 'str'. Did you mean this property is not being set? From 
the code you've included, it should be set from the textfield so you 
must have something configured wrong. What does your action mapping look 
like? Are you using the default interceptor stack or have you specified 
a different one?


L.

xianwinwin wrote:

Can anyone advise why my bean is null.

I have the following jsp page:

html
head
s:head theme=ajax/ 
/head

body
   
s:form 		

theme=ajax
id=myForm
		cssStyle=font-size :	8pt; font-family: verdana 
		action=notes_insert 
		method=post 


s:textarea rows=5 cols=60 name=str label=Add Note
required=true/


s:submit  align=center  targets=myForm theme=ajax/  

/s:form

when the user cllicks submit - the action 'insert' kicksin but the bean
(Note) is null (yes, i have getter and setter)




//action
@Validation
public class NoteAction extends BaseSupport implements Serializable
{   
private String str;

	 
	@SkipValidation

public String insert()
{   
System.out.println(the value is + str);
}


public String getStr()
{
return str;
}

public void setStr(String str)
{
this.str = str;
}
}



-
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]



s:include ou jsp:include

2008-04-03 Thread Pedro Herrera

Hi,
   What´s diference of use between s:include and jsp:include. 


Thanks

Herrera
-- 
View this message in context: 
http://www.nabble.com/s%3Ainclude-ou-jsp%3Ainclude-tp16473172p16473172.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]



RE: s:iterator tag help

2008-04-03 Thread Eric Nelson
I'm such an idiot.  This works great.  Thanks Musachy.

--Eric

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 2:54 PM
To: Struts Users Mailing List
Subject: Re: s:iterator tag help

I meant iterator tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso [EMAIL PROTECTED]
wrote:
 Use the id attribute in the for tag, like id=currInt.

  musachy



  On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson
[EMAIL PROTECTED] wrote:
   Hi.  This question may be very simple to answer, but it's driving
me
crazy.  If I have code similar to:
  
  
  
s:iterator value=intList
  
/s:iterator
  
  
  
Where intList is of type ListInteger, how do I reference to
current
Integer on the value stack without using s:property /?  So I
want to
reference the current Integer with OGNL or EL expression language
like:
  
  
  
select
  
s:iterator value=intList
  
   option value=${currInt} s:if test=${currInt ==
1}selected/s:if${currInt}/option
  
/s:iterator
  
/select
  
  
  
Here, currInt is the reference to the current Integer on the value
stack.  I hope this makes sense.  Any help would be greatly
appreciated.
  
  
  
Thanks,
  
  
  
Eric Nelson
  
Software Engineer Program Manager
  
  
  
  



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




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

-
To unsubscribe, e-mail: [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.1 TabbedPanel scenario

2008-04-03 Thread Laurie Harper
Have you looked at the s:action tag? It sounds like that could solve at 
least part of your problem. I'm still not clear how you expect two 
actions designed in isolation to suddenly be able to work in tandem 
without modification. As I say, you can't submit a request to more than 
one action at once -- at least, not without creating a third action to 
delegate to the other two...


L.

Shoaib Gauhar wrote:

First of all, thanks for replying. I really appreciate it. Making a single
action class will make the classes very bulky and complex. I dont want to
have that. I used the remote tabs functionality in tabbed panel but all it
does is that it goes into a infinite recursive loop. It adds infinite number
of tabs and the page hangs. Maybe its an implementation error.

I dont know how to make the dataset common other than make one action class
which in my case is certainly achievable but not acceptable.

Let me make the scenario a bit more understandable.

I am working on a product which generates jsp pages and action classes in
struts 2. Lets suppose that the user has built two different jsps and action
classes. They work separately perfectly. Now, we are giving him the option
to make a tabbed pane by using those two sets of jsps and action classes.
One way would be to merge them and make one jsp and one action class. Which
in my case is again achievable but very complex and the code will not be
readable. The next idea which came to my mind (i dont know if it is
achievable or not) is to make one jsp but have two separate action classes.
Each tab remotely accessing the dataset of each action class.

There is no other idea which is coming to my mind at the moment. So, any
other idea will be highly appreciated. The worst thing is that the solution
must be generic. :,(

Thanks again,

Shoaib Ahmad Gauhar



Laurie Harper wrote:

Shoaib Gauhar wrote:

Hello,

Here is the scenrio. I have two action classes. ClassA and ClassB. There
is
no relationship among these classes. You might say that if there is no
relationship then why i have to put them in one single jsp. Well its a
client's requirement.
That's an implementation detail, not a functional requirement. Why does 
the client care how you structure your actions?



In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB.

Each tab has fields concerned to their classes as defined above. Tab1 -
ClassA and Tab2 - ClassB.

Can we do it? I have tried this but what happens is that when i submit
the
data on Tab1, Tab2's data becomes empty.
A request is only processed by one action. If you need both actions to 
be able to process all the input from both tabs, you'll have to have 
them both aware of the full dataset. There are a number of ways you 
might achieve that, depending on what you're trying to achieve.



So, any ideas will be highly appreciated. Furthermore, i am quite new to
tabbed panel and would require clear tips and ideas.
I haven't used that widget in Struts 2 so can't offer specific tips. 
However, if you start by defining the functional requirements (rather 
than the implementation details), it'll be easier to offer advice.


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]



[S2] Struts with Web Services

2008-04-03 Thread Kelly.Graus

Hello,

I've been spending the last couple months familiarizing myself with a few
java based web technologies, mainly Struts 2, Spring, and Hibernate.  I have
a decent understanding of Struts, enough to make a few simple example
webapps that have helped me learn the concepts (along with a lot of help
from this message board!).

I'm now trying to design a real webapp that does more than one simple
task.  The basic idea is that I want a single User database that contains
login and registration information (user name, password, name, address,
etc).  When a user logs in, they are presented with a home page that shows
them all of the resources they are able to access (things like product
updates, product information, trial keys, etc).

Were I writing this webapp with what I know now, I would make a single
webapp that uses a database for user information, and a different database
that contains all of the information of the resources that the user is able
to access.  Authentication and authorization would be handled using Acegi
(of which I have a very limited understanding of).

However, we also have other webapps that we would like to be able to access
the same user login information.  One way (the only way I know of) would be
to have these other applications access the same user database and have all
of the same Acegi configuration.  Each webapp would have all of the
configuration needed to allow users to login, manage their accounts, etc. 
The vast majority of this configuration would be duplicated for each webapp.

It seems like a better way to handle this situation would be to have a
single web service that deals just with user login and registration.  Then
any webapp that needs to have a user login would just redirect to this web
service and get back some sort of User object.  Each individual webapp would
only need to configure Acegi for the specific resources that they provide. 
So my above example would look up the user in a database and present user
specific resources.  A webapp that allows a user to activate a product using
a product key would just have a database to map a user to the products they
have activated.

So finally my questions (sorry for the long winded explanation):

1. Is this login web service something that is actually commonly used?
2. Is this what a web service actually is, or am I applying that term where
it doesn't belong?
3. Is Acegi flexible enough to use in a setup like this?
4. Is there enough additional complexity in setting up a system like this
that it would also make sense to look into just duplicating the
configuration for each webapp?
5. Are there any good books, web tutorials, etc that talk about this?

I guess what I'm basically looking for is a little design direction,
possibly other technologies that provide these services so I'm not trying to
build an entire system from scratch.

Thanks in advance for your suggestions!

Kelly
-- 
View this message in context: 
http://www.nabble.com/-S2--Struts-with-Web-Services-tp16475805p16475805.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]



Re: Freemarker (old version that struts2 uses) disappearing pages

2008-04-03 Thread Jeromy Evans

Jonny Cavell wrote:

I have a problem that seems to occur periodically.

My freemarker templates, served by struts2, stop appearing - I get a blank
page. There are no useful messages in the logs, other than saying that it
couldn't find the template (which it could find previously).

First question - does anybody know what this problem might be?

  

No, other than a classpath/deployment problem.

I would like to upgrade to the latest version of Freemarker. However,
Struts2 in its wisdom has locked me down to version 2.3.8, and this was
released way back in 2006. Are there any plans to resolve this issue? 

  
The 2.1.1 version of Struts uses FreeMarker 2.3.11   You may be able to 
replace the 2.3.8 jar with the 2.3.11 jar without problems.


I doubt the problem is with FreeMarker.  It's more likely to be the 
FreeMarkerManager included with Struts 2 that's responsible for 
searching for templates in the classpath.




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



Re: [S2] Struts with Web Services

2008-04-03 Thread Lukasz Lenart
Hi,

  1. Is this login web service something that is actually commonly used?

Yes and no, mainly because WS is session-less and you have to manage
the session token by your self. We use such approach internally,
through ssl and we manage session expirations by hand.

  2. Is this what a web service actually is, or am I applying that term where
  it doesn't belong?

In my opinion, if you don't have global SOA architecture /
specification / whatever it can be what ever you want, but without
clear path it can be mess in the near future.

  3. Is Acegi flexible enough to use in a setup like this?

I think yes, you can extend almost everything / re-implement all the
classes and customize them to do what you want.

  4. Is there enough additional complexity in setting up a system like this
  that it would also make sense to look into just duplicating the
  configuration for each webapp?

If you will have common template / approach / guideline there be
nothing more just to setup individual settings for each webapp. In
other case, you will all the time invite the wheel.

  5. Are there any good books, web tutorials, etc that talk about this?

Google? IBM alfa works site ? ;-)

  I guess what I'm basically looking for is a little design direction,
  possibly other technologies that provide these services so I'm not trying to
  build an entire system from scratch.

I thing you should start building your SOA strategy and how to fit it
to your current projects / structure. It's better to thing twice.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Hi / Question - TabbedPanel with DisplayTag

2008-04-03 Thread Márcio Gurgel
Hi All!

This is my first e-mail.
My name is Márcio Gurgel, I'm from Brasília (Brazil). My english isn't very
well,  I hope you understand (:
There's 10 months that I'm working with J2EE.
I'll finish my graduation this semester, than I'm developing a final project
using Struts 2.

So, I have a question.. Hope you can help me.

My aplication uses displayTag for list rendering.
To make search's I use two tabs (Criteria and Results).
My problem is on the tab Results when it has paging.
When I click in the pagination, it just got lost.


I tried do resolve this doing:
1 - Seting requestURI= to call the action that returns the jsp with my
tabbed panel.
This way, returns the tab of Criteria selected (I want the Results tab).
2 - Seting requestURI= to call the action that returns the jsp with my
list (inside the Results tab).
This way my list opens in another frame.

Here's my code (I changed the Labels to english)
I atached a screen, as I sayd I dont trust in my english...


File UsuSeach.jsp (Contains tabbedPanel)
---

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

script type=text/javascript
   function selectTab(id) {
 var tabContainer = dojo.widget.byId(panelUsu);
 tabContainer.selectTab(id);
   }

/script

sx:head /

d:titleBar title=User's search/

s:url id=urlOpenCriteria action=OpenCriteria namespace=/user/
s:url id=urlSearch action=search namespace=/user/

sx:tabbedpanel id=panelUsu  templateCssPath=/css/dojo/TabContainer.css
sx:div label=Criteria id=tabCriteria href=%{urlOpenCriteria}
loadingText=Carregando /
sx:div label=Results id=tabResults href=%{urlSearch}
loadingText=Carregando refreshOnShow=false preload=false
executeScripts=true/
/sx:tabbedpanel

File UsuSeachCriteria.jsp (Criteria)
---

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

sx:head/
s:div cssClass=errors
   s:actionerror /
  s:fielderror /
/s:div

s:form action=search namespace=/user
s:textfield name=currentUsu.chv id=currentUsu.chv label=User's
name /
s:textfield name=currentUsu.eMail id=usu.eMail label=E-mail /
sx:datetimepicker name=currentUsu.dtGvr id=currentUsu.dtGvr
label=Data gravação toggleType=fade toggleDuration=500/
d:buttonBar
sx:submit id=buttonSearch name=buttonSearch value=Search
onclick=selectTab('tabResults') targets=tabResults /
/d:buttonBar
/s:form

File UsuSeachResults.jsp (Results)
---
%@ taglib prefix=s uri=/struts-tags%
%@ taglib prefix=sx uri=/struts-dojo-tags %
%@ taglib prefix=d uri=sgvdba-tags%
%@ taglib prefix=display uri=http://displaytag.sf.net%

sx:head /

br/
sx:div cssClass=errors
   s:actionerror /
  s:fielderror /
/sx:div

s:form action=exclude namespace=/user
display:table sort=page
requestURI=/usuario/abrirPesquisa.action cellpadding=0
cellspacing=0 id=listUsu
class=list name=listUsuPesquisa pagesize=10
display:columntitle='input type=checkbox
name=selectAll id=selectAll value= onclick=checkAll()/'
s:checkbox name=checkBox id=checkBox value=idUsus
theme=simple onclick=confirmAllChecked() /
/display:column
display:column sortProperty=chv title=User
property=chv///It's gonna be a link..
display:column title=E-mail property=EMail/
display:column title=Date property=dtGvr/
display:column title=Access level property=nvlAcso.dcr /
display:footer /
/display:table
br
d:buttonBar
sx:submit id=buttonNew name=buttonNew value=New /
sx:submit id=buttonExclude name=buttonExclude value=Exclude/
/d:buttonBar
/s:form



Tanks all!!!
[]'s


Re: struts.xml

2008-04-03 Thread Adam Hardy

Brian, thanks for the low-down. It works well.

Regards
Adam


Relph,Brian on 03/04/08 15:53, wrote:
 
Copy paste error, you need to initialize the Dispatcher with your testConfig map:


MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);
dispatcher = new Dispatcher(servletContext,
testConfig);
dispatcher.init();
Dispatcher.setInstance(dispatcher);


-Original Message-
From: Relph,Brian [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 9:48 AM

To: Struts Users Mailing List
Subject: RE: struts.xml


You need to have access to the Dispatcher and the ServletContext in your tests, 
but you could do something like this for per-unit test configurations:

ConfigurationProvider provider = new StrutsXmlConfigurationProvider(
struts-test.xml, true, servletContext);
dispatcher.getConfigurationManager().addConfigurationProvider(provider);
dispatcher.getConfigurationManager().reload();

If you set devMode = true for your tests, you might be able to avoid the 
reload() call.

If you have a just a single struts-test.xml for all of your tests, you could 
do something like this in your setUp():

MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);
dispatcher = new Dispatcher(servletContext,
new HashMapString, String());
dispatcher.init();
Dispatcher.setInstance(dispatcher); 



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 5:00 AM
To: Struts Users Mailing List
Subject: Re: struts.xml

Adam Hardy on 02/04/08 12:23, wrote:
Can I have a second struts.xml in my test directory, and if so, how do 
I configure it?


I'm testing some stuff using HttpUnit which launches the whole webapp 
in my tests. Having a test-only struts.xml will keep the test mappings 
out of the real webapp, allow me to drop stuff I don't need for the 
tests, and make the tests faster.


 From the lack of replies, I assume the answer is 'No, you cannot have an 
alternative struts.xml'.

I was checking the low-down on the wiki, where I found that the struts 
configuration xml can be in multiple files listed by the property in the
struts.properties:

### A list of configuration files automatically loaded by Struts 
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

Using this property, I can set up my maven environment to filter 
struts.properties as a resource and set that property explicitly, so in testing 
I can have 'struts-test.xml'

This works to a limited extent, i.e. one struts.xml for all testing, another 
for in-container deployment.

It's not quite ideal though, as I would prefer to choose the struts.xml on a 
per-test basis.

Does anyone know of something I've missed that allows this?



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



Re: Hi / Question - TabbedPanel with DisplayTag

2008-04-03 Thread Jeromy Evans

Hi Márcio,

First, check that the sort and pagination links rendered in the HTML 
appear valid.  I have seen cases where the URL is corrupt because it 
includes the original request parameters, resulting in the action being 
invoked with an unexpected result.


They should look like: 
http://foo.bar.com/context/requestUri?sort=namedir=ascoriginalParameters=originalValues.


The next issue is that displaytag uses default links that cause a 
complete page reload.  By got lost, I presume you mean you clicked on 
the sort link and the resulting page did not show the current tag.  This 
is a complication of using complex widgets in html.  The only 
work-around with displaytag is to ensure all state about the page layout 
(such as which tab is visible) is available as a request param or read 
from a cookie on a reload so that when the page is redrawn with the 
correct tab and content displayed.


Finally, an approach to avoid that issue is use an ajax table widget. 
That is, one that can refresh it's data without performing a full page 
reload.  The AjaxTags library includes a direct implementation of the 
displaytag table (ajax:displaytag) [1]. I've never used it.  As you're 
using Dojo tabs you may like to consider Dojo's datagrid as well.  I use 
YUI's version.


[1] http://ajaxtags.sourceforge.net/usage.html

Hope that helps!

regards,
Jeromy Evans

Márcio Gurgel wrote:

Hi All!

This is my first e-mail.
My name is Márcio Gurgel, I'm from Brasília (Brazil). My english isn't very
well,  I hope you understand (:
There's 10 months that I'm working with J2EE.
I'll finish my graduation this semester, than I'm developing a final project
using Struts 2.

So, I have a question.. Hope you can help me.

My aplication uses displayTag for list rendering.
To make search's I use two tabs (Criteria and Results).
My problem is on the tab Results when it has paging.
When I click in the pagination, it just got lost.


I tried do resolve this doing:
1 - Seting requestURI= to call the action that returns the jsp with my
tabbed panel.
This way, returns the tab of Criteria selected (I want the Results tab).
2 - Seting requestURI= to call the action that returns the jsp with my
list (inside the Results tab).
This way my list opens in another frame.

Here's my code (I changed the Labels to english)
I atached a screen, as I sayd I dont trust in my english...


File UsuSeach.jsp (Contains tabbedPanel)
---

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

script type=text/javascript
   function selectTab(id) {
 var tabContainer = dojo.widget.byId(panelUsu);
 tabContainer.selectTab(id);
   }

/script

sx:head /

d:titleBar title=User's search/

s:url id=urlOpenCriteria action=OpenCriteria namespace=/user/
s:url id=urlSearch action=search namespace=/user/

sx:tabbedpanel id=panelUsu  templateCssPath=/css/dojo/TabContainer.css
sx:div label=Criteria id=tabCriteria href=%{urlOpenCriteria}
loadingText=Carregando /
sx:div label=Results id=tabResults href=%{urlSearch}
loadingText=Carregando refreshOnShow=false preload=false
executeScripts=true/
/sx:tabbedpanel

File UsuSeachCriteria.jsp (Criteria)
---

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

sx:head/
s:div cssClass=errors
   s:actionerror /
  s:fielderror /
/s:div

s:form action=search namespace=/user
s:textfield name=currentUsu.chv id=currentUsu.chv label=User's
name /
s:textfield name=currentUsu.eMail id=usu.eMail label=E-mail /
sx:datetimepicker name=currentUsu.dtGvr id=currentUsu.dtGvr
label=Data gravação toggleType=fade toggleDuration=500/
d:buttonBar
sx:submit id=buttonSearch name=buttonSearch value=Search
onclick=selectTab('tabResults') targets=tabResults /
/d:buttonBar
/s:form

File UsuSeachResults.jsp (Results)
---
%@ taglib prefix=s uri=/struts-tags%
%@ taglib prefix=sx uri=/struts-dojo-tags %
%@ taglib prefix=d uri=sgvdba-tags%
%@ taglib prefix=display uri=http://displaytag.sf.net%

sx:head /

br/
sx:div cssClass=errors
   s:actionerror /
  s:fielderror /
/sx:div

s:form action=exclude namespace=/user
display:table sort=page
requestURI=/usuario/abrirPesquisa.action cellpadding=0
cellspacing=0 id=listUsu
class=list name=listUsuPesquisa pagesize=10
display:columntitle='input type=checkbox
name=selectAll id=selectAll value= onclick=checkAll()/'
s:checkbox name=checkBox id=checkBox value=idUsus
theme=simple onclick=confirmAllChecked() /
/display:column

Re: [S2] Struts with Web Services

2008-04-03 Thread Wes Wannemacher
I see that Lukasz already has a longer response, but if I am reading
your request properly, then I think you might be looking for CAS -

http://www.ja-sig.org/products/cas/

-Wes

On Thu, 2008-04-03 at 16:00 -0700, Kelly.Graus wrote:
 Hello,
 
 I've been spending the last couple months familiarizing myself with a few
 java based web technologies, mainly Struts 2, Spring, and Hibernate.  I have
 a decent understanding of Struts, enough to make a few simple example
 webapps that have helped me learn the concepts (along with a lot of help
 from this message board!).
 
 I'm now trying to design a real webapp that does more than one simple
 task.  The basic idea is that I want a single User database that contains
 login and registration information (user name, password, name, address,
 etc).  When a user logs in, they are presented with a home page that shows
 them all of the resources they are able to access (things like product
 updates, product information, trial keys, etc).
 
 Were I writing this webapp with what I know now, I would make a single
 webapp that uses a database for user information, and a different database
 that contains all of the information of the resources that the user is able
 to access.  Authentication and authorization would be handled using Acegi
 (of which I have a very limited understanding of).
 
 However, we also have other webapps that we would like to be able to access
 the same user login information.  One way (the only way I know of) would be
 to have these other applications access the same user database and have all
 of the same Acegi configuration.  Each webapp would have all of the
 configuration needed to allow users to login, manage their accounts, etc. 
 The vast majority of this configuration would be duplicated for each webapp.
 
 It seems like a better way to handle this situation would be to have a
 single web service that deals just with user login and registration.  Then
 any webapp that needs to have a user login would just redirect to this web
 service and get back some sort of User object.  Each individual webapp would
 only need to configure Acegi for the specific resources that they provide. 
 So my above example would look up the user in a database and present user
 specific resources.  A webapp that allows a user to activate a product using
 a product key would just have a database to map a user to the products they
 have activated.
 
 So finally my questions (sorry for the long winded explanation):
 
 1. Is this login web service something that is actually commonly used?
 2. Is this what a web service actually is, or am I applying that term where
 it doesn't belong?
 3. Is Acegi flexible enough to use in a setup like this?
 4. Is there enough additional complexity in setting up a system like this
 that it would also make sense to look into just duplicating the
 configuration for each webapp?
 5. Are there any good books, web tutorials, etc that talk about this?
 
 I guess what I'm basically looking for is a little design direction,
 possibly other technologies that provide these services so I'm not trying to
 build an entire system from scratch.
 
 Thanks in advance for your suggestions!
 
 Kelly


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



Re: s:radio issue

2008-04-03 Thread Niral Trivedi
Hi Dave,

Thanks for the reply. I've actually tried with #keepRemoveRadio as well but
got same result. In fact, I got it working by putting john or doe as
below for s:param property:

s:param name=*Keep* value=%{'john}/

Moving ahead, now stuck with a different issue. Actually, I want to create
name of the param dynamically by concatenating two strings. One is already a
struts2 s:set property and other is a static value. For example, I want to
do something like this:

Line 1: s:set name=prop1 value=%{someActionProp}/

s:bean name=java.util.HashMap id=keepRemoveRadioMap
*  s:param name=%{prop1}Keep value=%{prop1}john/
 s:param name=Remove value=%{prop1}doe/
* /s:bean

But I could not get the lines in bold working. Do you have any idea how to
concatenate two strings and assing it to a third variable? I tried
s:append but that doesn't work either. Using that I can only iterate and
print the values but cant assign to third variable.

Thanks

On Thu, Apr 3, 2008 at 8:40 AM, Dave Newton [EMAIL PROTECTED] wrote:

 --- Niral Trivedi [EMAIL PROTECTED] wrote:
  I am using Struts 2.0.11 on RAD7, Webspher 6.1, JDK 1.5.

 Hey, me too. My sympathies.

  I am trying to create radio buttons using a dynamic Map as below:
 
  s:bean name=java.util.HashMap id=keepRemoveRadioMap
  s:param name=Keep value=john/
  s:param name=Remove value=doe/
  /s:bean
 
  td width=20% style=background-color:#fffade; vertical-align:center
  s:radio name=keepRemove list=keepRemoveRadioMap  onclick=
  changeKeep1() theme=simple/
  /td
 
  But when I try to load the page, it is giving Freemaker Template
 exception
  as below(I haven't pasted entire stack trace for readability) :

 What happens if you use list=#keepRemoveRadioMap?

 While I've never used the s:bean... tag, normally when you create an
 object
 in the OGNL context like that you need to refer to it with a leading #
 meaning that it's a named object, not a property of an object on the value
 stack.

 Dave


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




Tiles in 1.3.9

2008-04-03 Thread balaji.m.cs

I need to integrate tiles in struts 1.3.9 i have included the jar files and
tlds as needed but im getting the exception...
 i don know whats the error


Apr 4, 2008 10:25:48 AM org.apache.struts.action.ActionServlet initChain
INFO: Loading chain catalog from code-source:/C:/Jdeveloper
1014/jdev/mywork/test/ViewController/public_html/WEB-INF/lib/struts-core-1.3.9.jar!org/apache/struts/chain/chain-config.xml
Apr 4, 2008 10:25:48 AM org.apache.struts.tiles.TilesPlugin
initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
Apr 4, 2008 10:25:49 AM org.apache.struts.chain.ComposableRequestProcessor
init
INFO: Initializing composable request processor for module prefix ''
Apr 4, 2008 10:25:49 AM
org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
java.lang.IllegalArgumentException: path must begin with a /
at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:1532)
at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:107)
at
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
at
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:450)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Apr 4, 2008 10:25:49 AM org.apache.struts.chain.commands.ExceptionCatcher
postprocess
WARNING: Exception from exceptionCommand 'servlet-exception'
java.lang.IllegalArgumentException: path must begin with a /
at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:1532)
at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:107)
at
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
at
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:450)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at

form within form

2008-04-03 Thread puneet duggal
hello friends Is it possible? that we can take form within form
   
-
Sent from Yahoo! Mail.
A Smarter Inbox.