doesn't have attribute in the tld.

2008-04-17 Thread zubair syed
Hi All,

the documentation or strut 2 core say  has a var as attribute . but
the tld doesn't define the var attribute.

please advice what is correct one.

Regards,
Zuber


RE: How to reflect table row data in the text boxes

2008-04-17 Thread Rishi Deepak
Thanks Sir, I will apply..

--- Lalchandra Rampersad
<[EMAIL PROTECTED]> wrote:

> You can simply create a javascript function that is
> called when the onClick
> or onSelect event of the table triggered.
> 
> Saludos
> Lalchandra
> 
> -Original Message-
> From: Rishi Deepak [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 17, 2008 5:05 AM
> To: user@struts.apache.org
> Subject: How to reflect table row data in the text
> boxes
> 
> Hi,
> My project has the requirement to display the
> records
> in table and when i click on a particular row, the
> data would be displayed in the text boxes.
> 
> I have applied Struts frame work and data is
> displayed
> in table, now any body can help how to show that
> data
> in textboxes on click to a record in table.
> 
> Is there ready made tool or sample code for that.
> 
> thanks in advance..
> Deepak.
> 
> 
>
-
> 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]
> 
> 



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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



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

2008-04-17 Thread Brad A Cupit
>> This hypothetical flash result could list the properties
>> that should survive the redirect
>> 
>> I'll investigate writing such a result / interceptor pair.  

Wouldn't that be the same as the ServletActionRedirectResult, where
param values can be ognl expressions? (assuming a version of struts 2
where bug WW-2170 is fixed).

Now, if this result/interceptor pair instead reads annotations on
properties in the action, or, if it stores the results in the session
(and then removed them on the next request) rather than as parameters in
the url, then it definitely is different from
ServletActionRedirectResult.

Having said that, I question using the session, since
redirect-after-post was designed to help alleviate back and refresh
button problems. If we store information in the session for the
redirect, then the first GET will find that information, but subsequent
GETs (perhaps the result of pressing back or refresh) will not find that
information, so the GET will have been inconsistent.

I guess this just pertains to flash scope in general though, and not any
particular implementation.

Brad Cupit
Louisiana State University - UIS

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



Re: Tiles2 runtime definition

2008-04-17 Thread stanlick
I think the tiles definition attributes should be exposed through the
tiles-plugin XML file.  My Wizard action is setting the nextPage so this
would eliminate the need to write a ViewPreparer to set the jsp in the tiles
definition.  I am now meddling around in the Preparer trying to construct
the URL that contains the page.  For this Preparer to be flexible, I really
don't want to presuppose anything.

ValueStack stack = (ValueStack) tilesContext.getRequestScope().get(
ServletActionContext.STRUTS_VALUESTACK_KEY);
String nextPage = stack.findString("nextPage");
HttpServletRequest request = (HttpServletRequest)
tilesContext.getRequest();

String fullUrl = request.getRequestURL().toString();
// find last slash and strip everything following
// int index = fullUrl.lastIndexOf("/");
// fullUrl = fullUrl.substring(0, index);
// MORE MESSY CODE HERE <---

// GROSS!!!
nextPage = "/tiles/wizard/"+nextPage+".jsp";
attributeContext.putAttribute(
"body",
new Attribute(nextPage));

On Thu, Apr 17, 2008 at 2:39 PM, Antonio Petrelli <
[EMAIL PROTECTED]> wrote:

> 2008/4/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > Right on Antonio!  Can you tell me how to fish the web context root from
> the
> >  Preparer?  I need to construct the page location from this and the
> nextPage
> >  itself.  Is there a list of key names someplace?  Finding this bit of
> data
> >  or that on the stack is typically where productivity takes a nosedive.
>  I
> >  used this key to get the stack:
> >
> >  stack = (ValueStack)
> >
>  
> tilesContext.getRequestScope().get(ServletActionContext.STRUTS_VALUESTACK_KEY);
>
> Unfortunately, Tiles plugin is not "so integrated" to Struts 2, so you
> have to access the value stack in another way.
> The TilesRequestContext.getRequest returns the request object, simply
> cast it to HttpServletRequest (in most cases).
> And the use the ServletActionContext.getValueStackMethod:
>
> http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html#getValueStack(javax.servlet.http.HttpServletRequest)
>
>
> HTH
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Scott
[EMAIL PROTECTED]


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

2008-04-17 Thread Guillaume Bilodeau

I'm aware of the chain result but I'd prefer to stick to the redirect result.

This hypothetical flash result could list the properties that should survive
the redirect, so I think we would avoid the problem with the CGLIB proxy.

I'll investigate writing such a result / interceptor pair.  I suppose the
chaining interceptor would be a good reference?

Cheers,
GB


Brad A Cupit wrote:
> 
>>> What would be great is if an interceptor would inject all
>>> properties that are shared by the previous and the current
>>> action (by name? by type?) in the current action, in a similar
>>> fashion to HTTP parameter injection.
> 
> If you use an ActionChainResult it will automatically do this, but
> action chaining is not recommended in favor or redirect-after-post
> (a.k.a. POST-redirect-GET).
> 
> If such a feature does exist (or were to exist) and copy the properties
> from Action1 to Action2 (with a redirect in between) it may actually
> cause problems similar to Action chaining: like when your Action is
> managed by Spring and Spring creates a CGLIB proxy and certain
> properties that are specific to CGLIB are copied from Action1 to Action2
> thereby messing up the proxy.  :-(
> 
> Brad Cupit
> Louisiana State University - UIS
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16754097.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: Problem: Lost ActionMessages after redirect to another action

2008-04-17 Thread Antonio Petrelli
2008/4/17, Marc Eckart <[EMAIL PROTECTED]>:
>  This works fine, but the action messages and action errors I want to display
>  are lost.
>  How can I store them over this action chain?

You can store them in the request scope, just as a normal attribute.

Antonio

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



Re: Tiles2 runtime definition

2008-04-17 Thread Antonio Petrelli
2008/4/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> Right on Antonio!  Can you tell me how to fish the web context root from the
>  Preparer?  I need to construct the page location from this and the nextPage
>  itself.  Is there a list of key names someplace?  Finding this bit of data
>  or that on the stack is typically where productivity takes a nosedive.  I
>  used this key to get the stack:
>
>  stack = (ValueStack)
>  
> tilesContext.getRequestScope().get(ServletActionContext.STRUTS_VALUESTACK_KEY);

Unfortunately, Tiles plugin is not "so integrated" to Struts 2, so you
have to access the value stack in another way.
The TilesRequestContext.getRequest returns the request object, simply
cast it to HttpServletRequest (in most cases).
And the use the ServletActionContext.getValueStackMethod:
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html#getValueStack(javax.servlet.http.HttpServletRequest)


HTH
Antonio

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



help to solve Could not find property [theme],, etc

2008-04-17 Thread Eduardo Solanas
im using lastest struts 2.1 test release and pre test release and the
problem is the same, im getting errors in console like :
Could not find property [.freemarker.RequestParameters]
Could not find property [templateDir]
Could not find property [org.apache.catalina.jsp_file]
etc my project starts and work fine but its very annoying, any solutions?
thanks


Re: datetimepicker doesn't show up

2008-04-17 Thread Dave Newton
Prototype doesn't play nicely with much of anything.

You'll most likely need to load Prototype last and hope for the best; an
older application of mine used both and that was how I worked around it.

That said, I don't particularly recommend mixing Prototype with much of
anything else because of the non-safe prototypal manipulations it does: use
it alone, or use something else (like jQuery, or Plain Ol' Dojo, or whatever
other library you want). More recent versions of Prototype may play better
with others.

Dave

--- tristan_colson <[EMAIL PROTECTED]> wrote:
> I tried adding the debug="true", and  got the following error when it
> rendered my JSP:
> FATAL exception raised: Could not load 'struts.widget.Bind'; last tried
> '__package__.js'
> 
> Googling this leads me to believe that perhaps some libraries aren't
> playing
> well together.
> Here are the other libraries that are already referenced in my :
> 
> 
>
>  >
> 
> 
> Does anyone know of particular problems with any of these playing together
> (and what I should do about it if there are problems?)
> 
> Thanks !
> 
> 
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
> > 
> > It looks right.
> > Turn on debugging with s:head
> > 
> > 
> > 
> > and use the FireFox FireBug plugin to determine if it failed to find any 
> > resources.
> > 
> > The template for the calendar is loaded via an ajax request. If that 
> > request fails you see nothing.
> > 
> > tristan_colson wrote:
> >> I am trying to use s:datetimepicker.
> >> I have the  in my  section.
> >> I have  like this:
> >> to  >> name="campaign.endDate" />
> >>
> >> The html renders like this:
> >> 
> >> 
> >> // Dojo configuration
> >> djConfig = {
> >> baseRelativePath: "/struts/dojo",
> >> isDebug: false,
> >> bindEncoding: "UTF-8",
> >> debugAtAllCosts: true // not needed, but allows the Venkman
> >> debugger
> >> to work with the includes
> >> };
> >> 
> >>  >> src="/struts/dojo/dojo.js">
> >>  >> src="/struts/simple/dojoRequire.js">
> >>  >> src="/struts/ajax/dojoRequire.js">
> >>  >> src="/struts/CommonFunctions.js">
> >>
> >> .
> >>
> >>  script type="text/javascript">
> >> dojo.require("dojo.widget.DatePicker");
> >> 
> >>  >> dojoType="dropdowndatepicker"   
> >> id="saveCampaign_campaign_startDate"name="dojo.campaign.startDate"  
> 
> >> inputName="campaign.startDate"  saveFormat="rfc">
> >>
> >> Note that the above div tag is empty. Seems like there should be
> >> something
> >> in it.
> >> The datetimepicker doesn't show up on the page.
> >>
> >> Am I using the tag wrong? Or might my environment be missing something?
> >> Many thanks for any help!
> >>
> >>   
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/datetimepicker-doesn%27t-show-up-tp16737339p16748386.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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



Re: Is it possible to make a pop up window using Struts?

2008-04-17 Thread Randy Burgess
In my example the popup window didn't do any processing because it is a
ForwardAction (org.apache.struts.actions.ForwardAction), the view just got
some values that were either in the session or passed on the query string.
If your form bean is configured properly the values from the query string
should get populated in the form.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: ryan webb <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List 
> Date: Thu, 17 Apr 2008 09:35:34 +0800
> To: Struts Users Mailing List 
> Subject: Re: Is it possible to make a pop up window using Struts?
> 
> Dear Randy,
> 
> Thank you very much for your kind reply..your method is very good. I will
> note your reply. =)
> Is it possible to transfer query string using this method? although i am not
> quite sure yet that this will work.
> 
> I will get parameter in my action class using *
> request.getParameter("orderNumber");* then store it to a form bean
> variable(String data type)then on popup window I will use *
> * accessing form bean variable (form bean property).
> 
> Again, I would like to thank you for your answer.
> 
> -Ryan Webb
> 
> 
> On Thu, Apr 17, 2008 at 3:56 AM, Randy Burgess <[EMAIL PROTECTED]> wrote:
> 
>> You can pass a query string to the popup window. Here is an example.
>> 
>> > 
>> href="javascript:popup('printOrder.do?orderNumber=${order.workOrderNumber}',
>> 600, 600, true);">
>> 
>> And then in the popup window to get the orderNumber param passed in above:
>> 
>> 
>> Reference Number: ${param.orderNumber}
>> 
>> 
>> You might want to change the href to # and put the window.open code in the
>> onclick event but other than that this will work fine. In this case order
>> Is a request attribute for this action.
>> 
>> Regards,
>> Randy Burgess
>> Sr. Web Applications Developer
>> Nuvox Communications
>> 
>> 
>> 
>>> From: ryan webb <[EMAIL PROTECTED]>
>>> Reply-To: Struts Users Mailing List 
>>> Date: Wed, 16 Apr 2008 16:40:25 +0800
>>> To: Struts Users Mailing List 
>>> Subject: Re: Is it possible to make a pop up window using Struts?
>>> 
>>> Antonio,
>>> 
 1) What Struts? Struts 1.2.9 (Netbeans bundle)
 2) You can still do it in Javascript. I see.. I just want to know if
>> you do
>>> it with struts.
>>> 
>>> I am having trouble with it..I created a pop up window using javascript
>> and
>>> i cant pass query string on new window.
>>> when i clicked a  I pass a paramId and paramProperty and I
>> cant
>>> make it appear to new window.
>>> 
>>> I have an action class that has *request.setAttribute("username",
>>> request.getParameter("username"));*
>>> on the new window I have *<%=
>> out.println(request.getAttribute("username"))
>>> %>* but this only displays the word NULL
>>> 
>>> I am new to struts..
>>> 
>>> Ryan
>>> 
>>> On Wed, Apr 16, 2008 at 4:22 PM, Antonio Petrelli <
>>> [EMAIL PROTECTED]> wrote:
>>> 
 2008/4/16, ryan webb <[EMAIL PROTECTED]>:
>  Is it possible to make a window pop up using struts?
>  usually this can be done in Javascript..
 
 1) What Struts?
 2) You can still do it in Javascript
 
 Antonio
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
>> 
>> 
>> 
>> 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.
>> 
>> 
>> 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.
>> 



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.


This email and any attachments ("Message") may contain legally privileged 
and/or confidential 

Re: datetimepicker doesn't show up

2008-04-17 Thread tristan_colson

I tried adding the debug="true", and  got the following error when it
rendered my JSP:
FATAL exception raised: Could not load 'struts.widget.Bind'; last tried
'__package__.js'

Googling this leads me to believe that perhaps some libraries aren't playing
well together.
Here are the other libraries that are already referenced in my :


   



Does anyone know of particular problems with any of these playing together
(and what I should do about it if there are problems?)

Thanks !




Jeromy Evans - Blue Sky Minds wrote:
> 
> It looks right.
> Turn on debugging with s:head
> 
> 
> 
> and use the FireFox FireBug plugin to determine if it failed to find any 
> resources.
> 
> The template for the calendar is loaded via an ajax request. If that 
> request fails you see nothing.
> 
> tristan_colson wrote:
>> I am trying to use s:datetimepicker.
>> I have the  in my  section.
>> I have  like this:
>> to > name="campaign.endDate" />
>>
>> The html renders like this:
>> 
>> 
>> // Dojo configuration
>> djConfig = {
>> baseRelativePath: "/struts/dojo",
>> isDebug: false,
>> bindEncoding: "UTF-8",
>> debugAtAllCosts: true // not needed, but allows the Venkman
>> debugger
>> to work with the includes
>> };
>> 
>> > src="/struts/dojo/dojo.js">
>> > src="/struts/simple/dojoRequire.js">
>> > src="/struts/ajax/dojoRequire.js">
>> > src="/struts/CommonFunctions.js">
>>
>> .
>>
>>  script type="text/javascript">
>> dojo.require("dojo.widget.DatePicker");
>> 
>> > dojoType="dropdowndatepicker"   
>> id="saveCampaign_campaign_startDate"name="dojo.campaign.startDate"   
>> inputName="campaign.startDate"  saveFormat="rfc">
>>
>> Note that the above div tag is empty. Seems like there should be
>> something
>> in it.
>> The datetimepicker doesn't show up on the page.
>>
>> Am I using the tag wrong? Or might my environment be missing something?
>> Many thanks for any help!
>>
>>   
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/datetimepicker-doesn%27t-show-up-tp16737339p16748386.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: return Result instantiated within Action

2008-04-17 Thread Brad A Cupit
>> Ah, good point.  Yes, please file this as a request, as it
>> should be pretty easy to do and would make things much easier.

done, thanks!

automatically set ActionMapper for ServletRedirectResult
https://issues.apache.org/struts/browse/WW-2598

Brad Cupit
Louisiana State University - UIS

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



Re: logout when using j_security_check

2008-04-17 Thread Laurie Harper

temp temp wrote:

my application uses container managed security , j_security_check,
we  create session before user  login  so i dont want to call session.invalidate 
if users wants to logout is there anything i can do to logout user ?


If you don't invalidate the session, it will still contain any data that 
was put into it while the user was logged in, which could be a security 
hole. In your case, what you probably want to do is invalidate the 
session and then repeat your session initiation logic.


L.


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



Re: JasperReports in Struts2

2008-04-17 Thread Dave Newton
--- aum strut <[EMAIL PROTECTED]> wrote:
> Now I need to implement jasperreports in struts2 application but its not
> working. Currently it is displaying blank report.

Any exceptions?

Without *any* information, as usual, it's impossible to help.

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

Dave


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



Re: Validation of Struts XML files

2008-04-17 Thread Laurie Harper

Looks like a simple versioning error to me; you're doctype declaration:

> >  "-//Apache Software Foundation//DTD Struts Configuration 
1.3//EN"

>  "http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd";>

But you said:

> But, the struts-config_1_3.dtd is not in the struts.jar file (we're
> using Struts 1.2.9)

I wouldn't expect 1.2.9 to contain a 1.3 DTD... Either upgrade to Struts 
 1.3.9 or use the DTD corresponding to the release you are on:


 http://struts.apache.org/dtds/struts-config_1_2.dtd";>

L.

Adam Gordon wrote:
Last night, our company had a maintenance window whereby Internet access 
was shut off from our office to the outside world.  During that time I 
was doing development and attempted to start up our web app in a 
development environment.


I've not seen this error in almost 2 years but it's apparently back:

[org.apache.struts.action.ActionServlet] [handleConfigException] Parsing 
error processing resource path /WEB-INF/struts-optout.xml

java.net.UnknownHostException: jakarta.apache.org
   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
   at java.net.Socket.connect(Socket.java:520)
   at java.net.Socket.connect(Socket.java:470)
   at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
   ...*snip*...

I remember this well.  The problem is that struts-optout.xml has the 
DOCTYPE of:


http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd";>

But, the struts-config_1_3.dtd is not in the struts.jar file (we're 
using Struts 1.2.9) so, apparently in order to validate that the XML 
file is well-formed at webapp start up time, Tomcat feels the need to go 
out and retrieve this DTD - only it can't because Internet access was 
down.  The problem is greatly exacerbated by the fact that Tomcat stops 
processing the loading of struts modules when this one fails essentially 
rendering the web app useless.


I seem to recall playing with turning validation of XML files off, but 
that not being a sufficient solution so I tried adding the DTD into the 
struts JAR file in the same location as the other DTDs:  
org/apache/struts/resources/struts-config_1_x.dtd (where x=0,1,2) but 
that didn't work.


We need to be able to find a solution to where we can host the DTDs 
locally and do not have to rely on a 3rd party server being up in order 
to deploy our web application.  I seem to recall this being an issue 
with the W3C (especally w.r.t. [X]HTML validation in that it results in 
a ton of unnecessary network calls to retrieve DTDs for validation 
rather than web servers hosting the DTDs locally.


I'm sure I'm not the only one to have seen this so any help to resolve 
this would be greatly appreciated.  Thanks.


-- adam



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



JasperReports in Struts2

2008-04-17 Thread aum strut
Hi Friends,

I have tried jasperreports in simple web application using jsp, servlets, it
works fine.
Now I need to implement jasperreports in struts2 application but its not
working. Currently it is displaying blank report.

Please guide me in this regard. Any gud reference related to
struts2+jasperreports will be much appreciated.

Thanks!


Re: Tiles2 runtime definition

2008-04-17 Thread stanlick
Right on Antonio!  Can you tell me how to fish the web context root from the
Preparer?  I need to construct the page location from this and the nextPage
itself.  Is there a list of key names someplace?  Finding this bit of data
or that on the stack is typically where productivity takes a nosedive.  I
used this key to get the stack:

stack = (ValueStack)
tilesContext.getRequestScope().get(ServletActionContext.STRUTS_VALUESTACK_KEY);

Thanks brother

On Thu, Apr 17, 2008 at 9:48 AM, Antonio Petrelli <
[EMAIL PROTECTED]> wrote:

> 2008/4/17, stanlick <[EMAIL PROTECTED]>:
> >
> > 
> > 
> > 
>
>
>
> Use a ViewPreparer:
> http://tiles.apache.org/tutorial/advanced/preparer.html
>
> Antonio
>



-- 
Scott
[EMAIL PROTECTED]


Re: return Result instantiated within Action

2008-04-17 Thread Don Brown
On Fri, Apr 18, 2008 at 1:22 AM, Brad A Cupit <[EMAIL PROTECTED]> wrote:
>  I've tried that myself as it seemed a very clean way of returning a
>  result, but I get a NullPointerException since the ActionMapper isn't
>  set on the Result.
>  
>  Can you think of any way that the actionMapper could be set
>  automatically on Result's which are instantiated inside of an Action? If
>  not, should I file this as a feature request?

Ah, good point.  Yes, please file this as a request, as it should be
pretty easy to do and would make things much easier.

Don

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



return Result instantiated within Action

2008-04-17 Thread Brad A Cupit
[creating a new thread so as not to hijack the
"ServletRedirectActionResult - is there a way to set parameters?"
thread]

Don Brown said:
>> The easiest solution is to simply return a
>> ServletActionRedirectResult instance from
>> your action method.

I've tried that myself as it seemed a very clean way of returning a
result, but I get a NullPointerException since the ActionMapper isn't
set on the Result. Now I could instead add:

@Inject
public void setActionMapper(ActionMapper actionMapper) { ... }

to my Action, then return a new ServletActionRedirectResult, but the
calling syntax gets a little messy. Here's an example method in the
Action class:

public Result submit() throws Exception {
ServletActionRedirectResult result = new
ServletActionRedirectResult("actionName").addParameter(
"param1", "${value1}");
result.setActionMapper(actionMapper);
return result;
}

Can you think of any way that the actionMapper could be set
automatically on Result's which are instantiated inside of an Action? If
not, should I file this as a feature request?

p.s. for others reading this, this approach would imply not implementing
the Action interface's execute() method, since it must return a String.
Instead you can just define any zero-arg public method and it can return
either a String or a Result, and your URLs can use the
actionName!method.action style for referencing a particular method on
the Action.

Brad Cupit
Louisiana State University - UIS

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



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

2008-04-17 Thread Brad A Cupit
>> What would be great is if an interceptor would inject all
>> properties that are shared by the previous and the current
>> action (by name? by type?) in the current action, in a similar
>> fashion to HTTP parameter injection.

If you use an ActionChainResult it will automatically do this, but
action chaining is not recommended in favor or redirect-after-post
(a.k.a. POST-redirect-GET).

If such a feature does exist (or were to exist) and copy the properties
from Action1 to Action2 (with a redirect in between) it may actually
cause problems similar to Action chaining: like when your Action is
managed by Spring and Spring creates a CGLIB proxy and certain
properties that are specific to CGLIB are copied from Action1 to Action2
thereby messing up the proxy.  :-(

Brad Cupit
Louisiana State University - UIS


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



Re: double mails

2008-04-17 Thread Vivek Rana
Could it be that you've registered twice under different email addresses 
and the second email server is set to forward the mails to the first? :)


Lalchandra Rampersad wrote:

Most posts arrive to my mailbox twice.  Does anybody know why?

 


Saludos

Lalchandra


  



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



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

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


/Ian

Guillaume Bilodeau wrote:

Hi Ian,

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

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

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

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

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

Cheers,
GB



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


/Ian

Don Brown wrote:


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

Don

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

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

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

 thanks,
 Alex.

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





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

  
  


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






  



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



[OT] Re: double mails

2008-04-17 Thread Dave Newton
--- Lalchandra Rampersad <[EMAIL PROTECTED]> wrote:
> Most posts arrive to my mailbox twice.  Does anybody know why?

I don't know why, but I also get an unusual number of duplicate messages
(same IDs).

Dave


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



double mails

2008-04-17 Thread Lalchandra Rampersad
Most posts arrive to my mailbox twice.  Does anybody know why?

 

Saludos

Lalchandra



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

2008-04-17 Thread Guillaume Bilodeau

Hi Ian,

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

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

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

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

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

Cheers,
GB



Ian Roughley wrote:
> 
> There is also a flash result type / interceptor in webwork - very easy 
> (<2 min) to convert to s2.
> 
> /Ian
> 
> Don Brown wrote:
>> There is the Struts 2 Scope Plugin [1], which does flash scope and a
>> lot more.  Also, the message store interceptor, available in core
>> out-of-the-box, will persist action and error messages across a
>> redirect in a "flash" scope, which is very handy for registering
>> validation errors on a POST but having the response redirect the user
>> to a GET.
>>
>> Don
>>
>> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>>
>> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
>> <[EMAIL PROTECTED]> wrote:
>>   
>>> Flash scope is fairly common nowdays (for displaying messages) I
>>>  wonder if S2 2.011, has anything similar?
>>>
>>>  thanks,
>>>  Alex.
>>>
>>>  -
>>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>> 
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>   
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16744246.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]



Problem: Lost ActionMessages after redirect to another action

2008-04-17 Thread Marc Eckart
Hi,

in some cases I redirect after one action instead to a jsp to another
action.

This works fine, but the action messages and action errors I want to display
are lost.
How can I store them over this action chain?

Best regards,
Marc


RE: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Brad A Cupit
>> You can declare your different interceptor stacks in different
>> packages and then declare the parent package on the action like
>> this:

>> @ParentPackage("packageWithEmptyStack")
>> public class FooAction ...

Guillaume is right. In 2.0.x when Actions are auto-discovered (via the
actionPackages parameter on the FilterDispatcher in web.xml) we have no
way of customizing the xwork package that they are put in.

Instead, you can do exactly what Guillaume suggested, and define an
xwork package with the interceptors that you want to use in struts.xml:












Then use the @ParentPackage("custom-xwork-package") on Action's that you
want this to apply to.

In Struts 2.1 with the convention plugin [1], it looks like we will be
able to customize the xwork package which auto-discovered Actions are
put in, so then you wouldn't need the @ParentPackage annotation.

[1] convention plugin (requires Struts 2.1):
http://cwiki.apache.org/S2PLUGINS/convention-plugin.html

Brad Cupit
Louisiana State University - UIS

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



RE: How to reflect table row data in the text boxes

2008-04-17 Thread Lalchandra Rampersad
You can simply create a javascript function that is called when the onClick
or onSelect event of the table triggered.

Saludos
Lalchandra

-Original Message-
From: Rishi Deepak [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 17, 2008 5:05 AM
To: user@struts.apache.org
Subject: How to reflect table row data in the text boxes

Hi,
My project has the requirement to display the records
in table and when i click on a particular row, the
data would be displayed in the text boxes.

I have applied Struts frame work and data is displayed
in table, now any body can help how to show that data
in textboxes on click to a record in table.

Is there ready made tool or sample code for that.

thanks in advance..
Deepak.


-
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: Tiles2 runtime definition

2008-04-17 Thread Antonio Petrelli
2008/4/17, stanlick <[EMAIL PROTECTED]>:
>
> 
> 
> 



Use a ViewPreparer:
http://tiles.apache.org/tutorial/advanced/preparer.html

Antonio


Re: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Don Brown
The easiest solution is to simply return a ServletActionRedirectResult
instance from your action method.

Don

On Wed, Apr 16, 2008 at 4:33 PM, Alex Shneyderman
<[EMAIL PROTECTED]> wrote:
> I am using 2.0.11 it seems that I can not use action-redirect result
>  type. I need to tag along a request paramter. So my annotation looks
>  like this:
>
>  @Result 
> (name="enterNewContactInfo",value="enterNewContactInfo",type=ServletActionRedirectResult.class,params={"country","AUT"})
>
>  I get a nasty NPE if I add the params. If I remove it everything works fine.
>
>  Another question is how do I set the parameter dynamically ? If I
>  recall correctly WW had a special syntax for it. Something like
>  params={"country","%{country}"}, but with no annotations for
>  course.Any way to do this in S2?
>
>  Here is the stack trace:
>
>  HTTP ERROR: 500
>
>  INTERNAL_SERVER_ERROR
>
>  RequestURI=/**/displayContactInfo.do
>  Caused by:
>
>  java.lang.NullPointerException
> at 
> org.apache.struts2.dispatcher.mapper.DefaultActionMapper.getUriFromActionMapping(DefaultActionMapper.java:466)
> at 
> org.apache.struts2.dispatcher.ServletActionRedirectResult.execute(ServletActionRedirectResult.java:184)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
> at **
> 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 **
> 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.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
> 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.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(Defau

Re: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Guillaume Bilodeau

Hi Alex,

You can declare your different interceptor stacks in different packages and
then declare the parent package on the action like this:

@ParentPackage("packageWithEmptyStack")
public class FooAction ...

Aside from bug WW-2170 and the repeated use of the @ParentPackage
annotation, I prefer working with annotation-based configuration instead of
XML-based.  Overall it's more concise, it's closer to the relevant code and
you don't lose that much flexibility - I haven't yet run into a situation
where I needed to revert to XML-based config.

Cheers,
GB


Alex Shneyderman wrote:
> 
> Thanks, Brad!
> 
>>  Having said all of that, I've been able to get the zero
>>  config/codebehind working and (in Spring 2.5) component scanned Spring
>>  beans so that newly written Actions and DAOs require few annotations and
>>  no xml configuration. What other kind of problems have you had?
> 
> How do I specify an interceptor stack/ref on an action with
> annotations? I have lookup actions that need no stack at all, so I
> created an almost empty stack in my struts.xml. Now, how do I specify
> this on an action without specifying the action in struts.xml?
> 
> I simply find annotation way very much incomplete. Maybe it will get
> there some day but I really need to be in full control of what I can
> specify - just the way I could do with strtus.xml file. I do not want
> to have several strategies to configure my actions on the same project
> ... it's not cool and makes things hard to read/maintain.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ServletRedirectActionResult---is-there-a-way-to-set-parameters--tp16717332p16744232.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]



notification on sccessful with login with j_security_check

2008-04-17 Thread temp temp
is there a way  my application gets notified of successful login using 
j_security_check ?

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Tiles2 runtime definition

2008-04-17 Thread stanlick

I need to set a runtime tiles definition attribute using a value from the
valuestack.  From my research, the tiles-plugin result does not allow
attributes to be configured.  


${nextPage}






Can someone help me navigate this configuration?  I'd rather not duplicate
the tiles definitions when the only variation is the jsp page in the
sequence.

Thanks,
Scott
-- 
View this message in context: 
http://www.nabble.com/Tiles2-runtime-definition-tp16744033p16744033.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: Problem with Select tag

2008-04-17 Thread Milan Milanovic
I solved the problem. It seems that I didn't called this action by using full 
URL with namespace.

--
Sorry, Milan Milanovic


- Original Message 
From: Milan Milanovic <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Thursday, April 17, 2008 3:03:35 PM
Subject: Re: Problem with Select tag

Hi,

what is also wierd, if I put that array in the session in my Action class like 
this (in prepare method):

Map session = ActionContext.getContext().getSession();
session.put("allRoles", allRoles);

and then I change my .jsp to use this array from session:

...


...

I got the same error (as I wrote in the first message), that it cannot locate 
allRoles.

What is the problem ?

--
Thx in advance, Milan Milanovic 


- Original Message 
From: Milan Milanovic <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, April 16, 2008 4:23:03 PM
Subject: Re: Problem with Select tag

Yes, I understand. But if you read my post, EVERYTHING works fine, but when I 
add namespace to package
in struts.xml (and in 





/pages/administration/list.jsp
/pages/administration/list.jsp



...


UserAction.java:
--
public class UserAction extends ActionSupport implements Preparable {
/**
  *
  */
private static final long serialVersionUID = 7654885094460681178L;
private UserService service;
private List users;
private User user;
private String username;
private String [] allRoles;
public UserAction(UserService service) {
  this.service = service;
}
  public String execute() {
  users = service.findAllUsers();
  allRoles = service.getAllRoles(); <- this method works fine, it return an 
array of roles

user = new User();
return Action.SUCCESS;
}

public String save() {
  service.save(user);

  return execute();
}

public void prepare() throws Exception {
  if (username != null)
  if (!username.equals(""))
user = servis.findUserByUsername(username);
}

public void setAllRoles(String [] allRoles) {
  this.allRoles = allRoles;
}

public String [] getAllRoles() {
  return allRoles;
}

// Other getters/setters
}

users.jsp:
--

...






...


--
Thx in advance, Milan Milanovic

- Original Message 
From: Michael Gagnon <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, April 16, 2008 3:38:38 PM
Subject: RE: Problem with Select tag

Can you show your struts xml, calling java action, and resulting jsp code?
I've noticed error messages like that whenever ANYTHING was wrong on a page
with a select box -- completely independent of anything to do with the
select box. So I think whatever you changed MAY have broken something else
and the message may be misleading you.

-Original Message-
From: Milan Milanovic [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 16, 2008 9:28 AM
To: Struts Users Mailing List
Subject: Re: Problem with Select tag

Nobody has an answer to this simple question ? 

As I asked, there is with select's tag "list" attribute, when namespace is
added to the package and to the form tag. It doesn't recognize given array
from the action class anymore. Do I miss something or this is a serious
error in Struts 2 ?

--
Thanks, Milan Milanovic



- Original Message 
From: Milan Milanovic <[EMAIL PROTECTED]>
To: user@struts.apache.org
Sent: Tuesday, April 15, 2008 11:21:37 PM
Subject: Problem with Select tag

Hi,

I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It
works perfectly, but
when I added namespace to the package in struts.xml, which is used in form
where this select tag
is located, I get an error:

"tag 'select', field 'list', id 'roles', name 'user.roles': The requested
list key 'allRoles' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unkown location]"

I should note that I've added this namespace to the form tag too, where
select tag is located. 

How can I solve this problem ? It seems when namespace is added to package,
select's list attribute doesn't recognize correct value stack anymore.

___
Thanks in advance, Milan Milanovic








Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ





Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



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


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu

Re: Trouble executing scripts in returned ajax content

2008-04-17 Thread Jukka Välimaa
Thanks for input,

Yes, I have debug on. Interestingly enough, with firefox it gives me just
this:
DEBUG: Error running scripts from content

However, I just noticed that with IE, I get this:
DEBUG: Error running scripts from content:Could not complete the operation
due to error 80020101

At the moment, I'm working around this problem by writing the scripts I need
to call outside the context I need to fetch by ajax, and calling those
scripts by function calls placed in form onsubmit attributes, for example.
Messy but workable. I'll work on debugging the issue with struts tags later
-- there is no guarantee it's even fixable directly, since I'm using a
snapshot version and not an official distribution.

On Thu, Apr 17, 2008 at 11:19 AM, Jeromy Evans <
[EMAIL PROTECTED]> wrote:

> It looks like you're doing everything okay (and well explained)  If you
> enable debugging do you get any useful feedback ?
> 
>
> The complexity here is that Dojo must parse the response, extract the
> scripts, insert the html in the dom and then execute the scripts.  If you
> include an alert in an inline script and it's still not being executed then
> there's definitely a problem with it completing the last operation.  You may
> have to switched to the uncompressed dojo script to find out where it's
> failing in within the div widget.
>
> Jukka Välimaa wrote:
>
> > Hi everyone,
> >
> > I'm using Struts 2.1's ajax tags to replace content in a section of my
> > page.
> > I have this section enclosed in sx:div tags, like so:
> >
> >  >listenTopics="/reloadContentSection"
> >afterNotifyTopics="/contentSectionLoaded" executeScripts="true"
> >showLoadingText="true" separateScripts="true"
> > indicator="barIndicator">
> >
> > ..
> >
> > 
> >
> > I change the div content by editing its href with javascript and then
> > publishing the topic it's listening to:
> >
> > function reloadContentSection(url){
> >if(!isAnUrl(url)) return false;
> >
> >var contentSection = dojo.widget.byId("pageContentSection");
> >if(contentSection == null) return false;
> >
> >var origHref = contentSection.href;
> >
> >contentSection.href = url;
> >
> >dojo.event.topic.publish('/reloadContentSection', '','');
> >
> >contentSection.href =origHref;
> > }
> >
> > It's working fine otherwise, but I have trouble executing scripts in
> > returned content. I've experimented with different values of
> > executeScripts
> > and separateScripts to no effect. I've even tried to include scripts as
> > a
> > reference to separate javascript library--no better luck there. Even
> > though
> > scripts I write don't work, a datetimepicker in the same returned
> > content,
> > done using ajax tags and of course relying on scripts, works perfectly.
> >
> > When I set separateScripts as false, my scripts are included in
> > generated
> > DOM source, after some scripts by Matt Cruse, which I assume are
> > directly
> > related to struts ajax functionality. Of course, being included doesn't
> > mean
> > that they work.
> >
> > Right now, I've worked around this problem by including the scripts I
> > need
> > in the  page I'm calling ajax from, and not in returned content. I don't
> > think this is good design, and won't work if I need to generate scripts
> > dynamically.
> >
> > Can any of you tell me what's wrong, or how to fix it?
> >
> > Jukka
> >
> >
> >  
> >
> > No virus found in this incoming message.
> > Checked by AVG. Version: 7.5.519 / Virus Database: 269.23.0/1379 -
> > Release Date: 15/04/2008 6:10 PM
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Problem with Select tag

2008-04-17 Thread Milan Milanovic
Hi,

what is also wierd, if I put that array in the session in my Action class like 
this (in prepare method):

Map session = ActionContext.getContext().getSession();
session.put("allRoles", allRoles);

and then I change my .jsp to use this array from session:

...


...

I got the same error (as I wrote in the first message), that it cannot locate 
allRoles.

What is the problem ?

--
Thx in advance, Milan Milanovic 


- Original Message 
From: Milan Milanovic <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, April 16, 2008 4:23:03 PM
Subject: Re: Problem with Select tag

Yes, I understand. But if you read my post, EVERYTHING works fine, but when I 
add namespace to package
in struts.xml (and in 





/pages/administration/list.jsp
/pages/administration/list.jsp



...


UserAction.java:
--
public class UserAction extends ActionSupport implements Preparable {
/**
  *
  */
private static final long serialVersionUID = 7654885094460681178L;
private UserService service;
private List users;
private User user;
private String username;
private String [] allRoles;
public UserAction(UserService service) {
  this.service = service;
}
  public String execute() {
  users = service.findAllUsers();
  allRoles = service.getAllRoles(); <- this method works fine, it return an 
array of roles

user = new User();
return Action.SUCCESS;
}

public String save() {
  service.save(user);

  return execute();
}

public void prepare() throws Exception {
  if (username != null)
  if (!username.equals(""))
user = servis.findUserByUsername(username);
}

public void setAllRoles(String [] allRoles) {
  this.allRoles = allRoles;
}

public String [] getAllRoles() {
  return allRoles;
}

// Other getters/setters
}

users.jsp:
--

...






...


--
Thx in advance, Milan Milanovic

- Original Message 
From: Michael Gagnon <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Wednesday, April 16, 2008 3:38:38 PM
Subject: RE: Problem with Select tag

Can you show your struts xml, calling java action, and resulting jsp code?
I've noticed error messages like that whenever ANYTHING was wrong on a page
with a select box -- completely independent of anything to do with the
select box. So I think whatever you changed MAY have broken something else
and the message may be misleading you.

-Original Message-
From: Milan Milanovic [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 16, 2008 9:28 AM
To: Struts Users Mailing List
Subject: Re: Problem with Select tag

Nobody has an answer to this simple question ? 

As I asked, there is with select's tag "list" attribute, when namespace is
added to the package and to the form tag. It doesn't recognize given array
from the action class anymore. Do I miss something or this is a serious
error in Struts 2 ?

--
Thanks, Milan Milanovic



- Original Message 
From: Milan Milanovic <[EMAIL PROTECTED]>
To: user@struts.apache.org
Sent: Tuesday, April 15, 2008 11:21:37 PM
Subject: Problem with Select tag

Hi,

I'm using Struts 2.0.11.1, and I have wierd problem with select UI tag. It
works perfectly, but
when I added namespace to the package in struts.xml, which is used in form
where this select tag
is located, I get an error:

"tag 'select', field 'list', id 'roles', name 'user.roles': The requested
list key 'allRoles' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or
people.{name} - [unkown location]"

I should note that I've added this namespace to the form tag too, where
select tag is located. 

How can I solve this problem ? It seems when namespace is added to package,
select's list attribute doesn't recognize correct value stack anymore.

___
Thanks in advance, Milan Milanovic








Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ





Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



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


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

Re: struts2: sent value to freemarker template

2008-04-17 Thread zer0

I have the same trouble. Has anyone solve this problem ?
Thanks,


niels-15 wrote:
> 
> I want to pass a value to my fielderror.ftl
> 
> lik this:
> 
> 
>   
> 
> 
> 
> 
> Does someone knows how to retrief the value in de template?
> 
> ${parameters.foo}
> 
> gives me the error:
> freemarker.core.InvalidReferenceException: Expression Expression  
> parameters.foo is undefined
> 

-- 
View this message in context: 
http://www.nabble.com/struts2%3A-sent-value-to-freemarker-template-tp14713516p16743959.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: logout when using j_security_check

2008-04-17 Thread Antonio Petrelli
Rishi
Do not hijack others thread please. Create a new e-mail.

Antonio

2008/4/17, Rishi Deepak <[EMAIL PROTECTED]>:
>
> Hi,
> My project has the requirement to display the records
> in table and when i click on a particular row, the
> data would be displayed in the text boxes.
>
> I have applied Struts frame work and data is displayed
> in table, now any body can help how to show that data
> in textboxes on click to a record in table.
>
> Is there ready made tool or sample code for that.
>
> thanks in advance..
> Deepak.
>
> --- temp temp <[EMAIL PROTECTED]> wrote:
>
> > my application uses container managed security ,
> > j_security_check,
> > we  create session before user  login  so i dont
> > want to call session.invalidate
> > if users wants to logout is there anything i can do
> > to logout user ?
> >
> >
> > -
> > Be a better friend, newshound, and know-it-all with
> > Yahoo! Mobile.  Try it now.
>
>
>
>
>
>   
> 
>
> Be a better friend, newshound, and
>
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


How to reflect table row data in the text boxes

2008-04-17 Thread Rishi Deepak
Hi,
My project has the requirement to display the records
in table and when i click on a particular row, the
data would be displayed in the text boxes.

I have applied Struts frame work and data is displayed
in table, now any body can help how to show that data
in textboxes on click to a record in table.

Is there ready made tool or sample code for that.

thanks in advance..
Deepak.
--- temp temp <[EMAIL PROTECTED]> wrote:

> my application uses container managed security ,
> j_security_check,
> we  create session before user  login  so i dont
> want to call session.invalidate 
> if users wants to logout is there anything i can do
> to logout user ?
> 
>
> -
> Be a better friend, newshound, and know-it-all with
> Yahoo! Mobile.  Try it now.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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



Re: logout when using j_security_check

2008-04-17 Thread Rishi Deepak
Hi,
My project has the requirement to display the records
in table and when i click on a particular row, the
data would be displayed in the text boxes.

I have applied Struts frame work and data is displayed
in table, now any body can help how to show that data
in textboxes on click to a record in table.

Is there ready made tool or sample code for that.

thanks in advance..
Deepak.
--- temp temp <[EMAIL PROTECTED]> wrote:

> my application uses container managed security ,
> j_security_check,
> we  create session before user  login  so i dont
> want to call session.invalidate 
> if users wants to logout is there anything i can do
> to logout user ?
> 
>
> -
> Be a better friend, newshound, and know-it-all with
> Yahoo! Mobile.  Try it now.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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



logout when using j_security_check

2008-04-17 Thread temp temp
my application uses container managed security , j_security_check,
we  create session before user  login  so i dont want to call 
session.invalidate 
if users wants to logout is there anything i can do to logout user ?

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: s2: How do you format a date and use it as a param value in a s:url

2008-04-17 Thread Jeromy Evans

David Harland wrote:

I have an action with a List messages. The
Message class has a Date senddate. In my jsp I am
iterating over the messages and want to create a s:url
with a param of formatedDate but I want to set the
value as a formatted version of senddate. I am
presently adding a getFormattedDate method which is
using SimpleDateFormat("dd/MM/
hh:mm:ss").format(senddate) in the Message class but I
don't want the formatting to be done in the Message.
Is there a more elegant way of doing this in the jsp please?


  ___


This is a common question.  It's something like this:


  
 
  



ie. that's an s:date tag within a s:param tag within an s:url tag.  The 
formatted date is the body of the param tag.


It becomes more complicated when you need a locale dependent date or 
date conversion.


Hope that helps,
Jeromy Evans

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



exception in url tag.

2008-04-17 Thread zubair syed
Hi All,

i have downloaded the 'Struts
2.0.11.1'
distribution and trying to deploy application by following apache struts
tutorial document . I got this exception due to var attribute missing in the
url tag.*

org.apache.jasper.JasperException*: /HelloWorld.jsp(13,8) Attribute var
invalid for tag url according to TLD

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(*
DefaultErrorHandler.java:40*)

at org.apache.jasper.compiler.ErrorDispatcher.dispatch(*
ErrorDispatcher.java:406*)

at org.apache.jasper.compiler.ErrorDispatcher.jspError(*
ErrorDispatcher.java:235*)* ' *

**

I have checked tld in core struts jar and it doen't contain the attribute
'var' for url tag .  Please let me know if am doing something wrong or there
is error in the jar of the latest distribution.

Regards,

Zuber






.


Re: Trouble executing scripts in returned ajax content

2008-04-17 Thread Jeromy Evans
It looks like you're doing everything okay (and well explained)  If you 
enable debugging do you get any useful feedback ?



The complexity here is that Dojo must parse the response, extract the 
scripts, insert the html in the dom and then execute the scripts.  If 
you include an alert in an inline script and it's still not being 
executed then there's definitely a problem with it completing the last 
operation.  You may have to switched to the uncompressed dojo script to 
find out where it's failing in within the div widget.


Jukka Välimaa wrote:

Hi everyone,

I'm using Struts 2.1's ajax tags to replace content in a section of my page.
I have this section enclosed in sx:div tags, like so:



..



I change the div content by editing its href with javascript and then
publishing the topic it's listening to:

function reloadContentSection(url){
if(!isAnUrl(url)) return false;

var contentSection = dojo.widget.byId("pageContentSection");
if(contentSection == null) return false;

var origHref = contentSection.href;

contentSection.href = url;

dojo.event.topic.publish('/reloadContentSection', '','');

contentSection.href =origHref;
}

It's working fine otherwise, but I have trouble executing scripts in
returned content. I've experimented with different values of executeScripts
and separateScripts to no effect. I've even tried to include scripts as a
reference to separate javascript library--no better luck there. Even though
scripts I write don't work, a datetimepicker in the same returned content,
done using ajax tags and of course relying on scripts, works perfectly.

When I set separateScripts as false, my scripts are included in generated
DOM source, after some scripts by Matt Cruse, which I assume are directly
related to struts ajax functionality. Of course, being included doesn't mean
that they work.

Right now, I've worked around this problem by including the scripts I need
in the  page I'm calling ajax from, and not in returned content. I don't
think this is good design, and won't work if I need to generate scripts
dynamically.

Can any of you tell me what's wrong, or how to fix it?

Jukka

  



No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.23.0/1379 - Release Date: 15/04/2008 6:10 PM
  



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



Re: datetimepicker doesn't show up

2008-04-17 Thread Jeromy Evans

It looks right.
Turn on debugging with s:head



and use the FireFox FireBug plugin to determine if it failed to find any 
resources.


The template for the calendar is loaded via an ajax request. If that 
request fails you see nothing.


tristan_colson wrote:

I am trying to use s:datetimepicker.
I have the  in my  section.
I have  like this:
to 

The html renders like this:


// Dojo configuration
djConfig = {
baseRelativePath: "/struts/dojo",
isDebug: false,
bindEncoding: "UTF-8",
debugAtAllCosts: true // not needed, but allows the Venkman debugger
to work with the includes
};






.

 script type="text/javascript">
dojo.require("dojo.widget.DatePicker");

dojoType="dropdowndatepicker"   
id="saveCampaign_campaign_startDate"name="dojo.campaign.startDate"   
inputName="campaign.startDate"  saveFormat="rfc">


Note that the above div tag is empty. Seems like there should be something
in it.
The datetimepicker doesn't show up on the page.

Am I using the tag wrong? Or might my environment be missing something?
Many thanks for any help!

  



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



s2: How do you format a date and use it as a param value in a s:url

2008-04-17 Thread David Harland
I have an action with a List messages. The
Message class has a Date senddate. In my jsp I am
iterating over the messages and want to create a s:url
with a param of formatedDate but I want to set the
value as a formatted version of senddate. I am
presently adding a getFormattedDate method which is
using SimpleDateFormat("dd/MM/
hh:mm:ss").format(senddate) in the Message class but I
don't want the formatting to be done in the Message.
Is there a more elegant way of doing this in the jsp please?


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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



Re: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Alex Shneyderman
Thanks, Brad!

>  Having said all of that, I've been able to get the zero
>  config/codebehind working and (in Spring 2.5) component scanned Spring
>  beans so that newly written Actions and DAOs require few annotations and
>  no xml configuration. What other kind of problems have you had?

How do I specify an interceptor stack/ref on an action with
annotations? I have lookup actions that need no stack at all, so I
created an almost empty stack in my struts.xml. Now, how do I specify
this on an action without specifying the action in struts.xml?

I simply find annotation way very much incomplete. Maybe it will get
there some day but I really need to be in full control of what I can
specify - just the way I could do with strtus.xml file. I do not want
to have several strategies to configure my actions on the same project
... it's not cool and makes things hard to read/maintain.

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