RE: [S2] Datetimepicker in Struts 2.1.0

2007-10-25 Thread Rajagopal_Yendluri
Hi ...

   I am not able to use the datefimepicker, when I use the following
code:




Only Label is displaying no... date and time in JSP..

Regards,
Rajagopal   


-Original Message-
From: Jeromy Evans [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 26, 2007 10:36 AM
To: Struts Users Mailing List
Subject: Re: [S2] Datetimepicker in Struts 2.1.0

Hi Mark,

I'm not sure that it helps, but I'm able to get the datetimepicker to 
work (in JSP) using 
https://svn.apache.org/repos/asf/struts/struts2/trunk @ rev 588199, last

changed 2007-10-25 21:02:52 +1000

The only new issue I did encounter was due to the requirement to enable 
non-US locales through the head tag.

I'm working from a clean build from trunk (mvn clean install -Pall).  
Hope that helps in some way.
regards,
 Jeromy Evans

Mark P Ashworth wrote:
> Good Day,
>
> I am trying to use the 2.1.0 build of the dojo plug-in and I am
getting an
> InvalidReferenceException. The issue
> https://issues.apache.org/struts/browse/WW-1757 helped to resolve the
issue
> on the 2.0.9 build but now even the <@s.dateTimePicker /> or
> <@s.datetimepicker /> does not seem to work.
>
>
> on line 49, column 17 in workitem.ftl s.datetimepicker not found.
> The problematic instruction:
> --
> ==> user-directive s.datetimepicker [on line 49, column 17 in
workitem.ftl]
>  in user-directive s.form [on line 20, column 9 in workitem.ftl]
> --
>
> Java backtrace for programmers:
> --
> freemarker.core.InvalidReferenceException: on line 49, column 17 in
> workitem.ftl s.datetimepicker not found.
>   at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
>   at freemarker.core.Environment.visit(Environment.java:196)
>   at freemarker.core.MixedContent.accept(MixedContent.java:92)
>   


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




DISCLAIMER:
This email (including any attachments) is intended for the sole use of the 
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE 
COMPANY INFORMATION. Any review or reliance by others or copying or 
distribution or forwarding of any or all of the contents in this message is 
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the 
sender by email and delete all copies; your cooperation in this regard is 
appreciated.

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



Re: Highlighting the invalid field

2007-10-25 Thread Jeromy Evans

Hi Ashish,
If you're using Struts 2, and the xhtml/css_xhtml theme, the template 
for each field in the form includes "controlheader-core.ft" that 
provides the logic to include the html to report field errors.


Here is an extract:
<#assign hasFieldErrors = parameters.name?exists && fieldErrors?exists 
&& fieldErrors[parameters.name]?exists/>

<#if hasFieldErrors>  

You have two reasonable ways to enhance this:
option a. create your own template from the original that uses the same 
logic to change the style of the fields in your form when there's an 
error (recommended approach)

See http://struts.apache.org/2.0.9/docs/themes-and-templates.html

option b. This is a bit of a hack, but simple.  Write some javascript 
that gets all labels from the DOM with class errorLabel.  The "for" 
attribute of each label element contains the Id of an element in the 
form with an error.  Change the style of those elements using javascript.


Hope that helps,
Jeromy Evans

ashish agarwal wrote:

Hi All,

I am developing a form using jsp. If validation fails then I want those fields 
to be highlighted . I am able to print error message on top but not able to 
highlight the text( for example UserName(if it contains less characters)). 
Please somebody suggest some solution for this.

Thanks
Ashish



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.11/1093 - Release Date: 25/10/2007 5:38 PM
  



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



Re: [S2] Change struts-default.xml content

2007-10-25 Thread Igor Vlasov

The main goal:
I want to get i18n strings from properties files in UTF-8 encoding. 
The secondary goal:
Load current locale setting from JSTL config variables like 
Config.FMT_LOCALIZATION_CONTEXT and its locale variable value 

Thus I will  use jstl-fmt tags and strust i18n support TOGETHER :clap:


I do not want to override method in actions. I want to change global
behaviour of getting localized string in ONE special component/class.

I think, than I can replace TextProvider with my own implementation that
will read in UTF-8(or convert readed string to UTF-8) and getting current
locale information  from pagecontext(probably)


I looked at  and in also use TextProvider.
 

Don Brown wrote:
> 
> Currently, the TextProvider impl is not pluggable.  Note that Action
> classes themselves can implement TextProvider (and usually do via
> ActionSupport), so they can customize it all they need.
> 
> What is your usecase for having your own TextProvider?  That class is
> only used in a few places, so perhaps what you really need is just to
> override the appropriate methods on your Action.
> 
> Don
> 
> On 10/26/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>>
>> The class
>> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider
>> in method register(...) use this logic for checking
>>
>> if (containerBuilder.contains(ctype, name)) {
>>  Location loc =
>> LocationUtils.getLocation(loadedBeans.get(ctype.getName() + name));
>> if (throwExceptionOnDuplicateBeans) {
>>   throw new ConfigurationException("Bean type " + ctype +
>> "
>> with the name " +
>> name + " has already been loaded by " + loc,
>> child);
>> }
>>  }
>> Thus I CAN NOT register 2 bean with same type and name!!!
>>
>> I can register new TextProvider with defferent name:xxxstruts . But I am
>> not
>> sure that exactly my bean will be used to create an object for
>> TextProvider.
>>
>> At that time there is a bug in XWork 2.0.12.1.0  when TextProvider
>> object is created.
>>
>> I want to investigate the common method for loading my realization of
>> standart bean.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> cilquirm wrote:
>> >
>> > I think the problem might be that there may not be a way to configure a
>> > different TextProvider.
>> >
>> > Consider the object factory example, in this case guice :
>> >
>> > 
>> >
>> >   > > name="guice"
>> > class="com.google.inject.struts2.GuiceObjectFactory"/>
>> >
>> >   
>> >   
>> >
>> > 
>> >
>> >
>> > What this does is create a bean provider with a given name of that
>> type.
>> >
>> > The constant portion is actually the configuration piece.
>> >
>> > I tried looking in the source, but I couldn't find how to configure the
>> > textProvider.
>> > The two pre-configured ones both use the same class so one wouldn't
>> note
>> > any difference.
>> >
>> > Maybe someone on the list can help you out more.
>> >
>> > Apologies,
>> > -a
>> >
>> >
>> >
>> > Igor Vlasov wrote:
>> >>
>> >> This action cause an error.
>> >> I will write in struts.xml:
>> >> 
>> >>
>> >>   > value="false"
>> >> />
>> >>
>> >>   > >> class="karakas.struts.RicoTextProvider" />
>> >>   > >> class="karakas.struts.RicoTextProvider" />
>> >>   
>> >>   .
>> >> 
>> >>
>> >> and use the same type(com.opensymphony.xwork2.TextProvider) and the
>> same
>> >> name(struts) as in struts-defailt.xml
>> >>  Then i recieve an error in tomcat log:
>> >>
>> >>
>> >> Unable to load bean: type:com.opensymphony.xwork2.TextProvider
>> >> class:karakas.struts.RicoTextProvider - bean -
>> >> /web/WEB-INF/classes/struts.xml:10:109
>> >>
>> >> Caused by: Bean type interface com.opensymphony.xwork2.TextProvider
>> with
>> >> the name xwork1 has already been loaded by [unknown location] - bean -
>> >>
>> file:/D:/projects/Karakas1.1/build/web/WEB-INF/classes/struts.xml:10:109
>> >>
>> >>
>> >>
>> >>
>> >> cilquirm wrote:
>> >>>
>> >>> you can redefine it in your struts.xml, much like how you would
>> specify
>> >>> the object factory to override the default object factory .
>> >>>
>> >>> -a
>> >>>
>> >>>
>> >>>
>> >>> Igor Vlasov wrote:
>> 
>>  Hello.
>>  I want to change some information in struts-default.xml.
>> 
>>  I can move it to classes directoty and do any change:-)
>> 
>>  Is there any more sofisticated method to do the same from
>> struts.xml?
>> 
>>  For example i want to change TextProvider:
>>  From
>> >  class="one class" />
>> 
>>  to
>>  >  class="another class" />
>> 
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13420988
>> Sent fr

Re: [S2.1] url action mapping problem (restful)

2007-10-25 Thread Jeromy Evans

Don Brown wrote:

You are correct, #3 isn't possible right now with the rest plugin,
however, it is certainly on the near-term roadmap.  What is needed is
the ability to define wildcards in the namespace, also known as url
templates.  For example, you could do something like
@Namespace("/states/{state}") on your CitiesController class.
  
Thanks Don. That'll be perfect!  I'll keep an eye on the xwork trunk and 
dev list.


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



Re: [S2] Problem while retrieving data from JSP

2007-10-25 Thread Igor Vlasov

I think you must put the ID's in hidden fields and then they will fill up
with id's from your collection on jsp page

In save method  wou will analyse the recieved data.


kaouki wrote:
> 
> Hi,
> I get this bean in my action in order to modify it in my jsp:
> Catalogue {
> Long id;
> String title;
> String description;
> Collection produits
> }
> In this jsp, I have two fieds: title and description, and a table of
> Produit with checkboxes.
> These ones enable the user to remove the products from the catalogue.
> 
> In my save action, I get the catalogue (property of the action) and a
> Long[] (the id of the checked products).
> The problem is that the Products Collection of the Catalogue and its id
> are null.
> 
> So, if I want update some attributes of my bean, I have to put the bean in
> Session ? or all the unchanged attributes in hidden fields ?
> 
> I'm grateful for any input on the matter. Cheers.
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Problem-while-retrieving-data-from-JSP-tf4691128.html#a13421508
Sent from the Struts - User mailing list archive at Nabble.com.


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



Highlighting the invalid field

2007-10-25 Thread ashish agarwal
Hi All,

I am developing a form using jsp. If validation fails then I want those fields 
to be highlighted . I am able to print error message on top but not able to 
highlight the text( for example UserName(if it contains less characters)). 
Please somebody suggest some solution for this.

Thanks
Ashish



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [S2] Change struts-default.xml content

2007-10-25 Thread Don Brown
Currently, the TextProvider impl is not pluggable.  Note that Action
classes themselves can implement TextProvider (and usually do via
ActionSupport), so they can customize it all they need.

What is your usecase for having your own TextProvider?  That class is
only used in a few places, so perhaps what you really need is just to
override the appropriate methods on your Action.

Don

On 10/26/07, Igor Vlasov <[EMAIL PROTECTED]> wrote:
>
> The class com.opensymphony.xwork2.config.providers.XmlConfigurationProvider
> in method register(...) use this logic for checking
>
> if (containerBuilder.contains(ctype, name)) {
>  Location loc =
> LocationUtils.getLocation(loadedBeans.get(ctype.getName() + name));
> if (throwExceptionOnDuplicateBeans) {
>   throw new ConfigurationException("Bean type " + ctype + "
> with the name " +
> name + " has already been loaded by " + loc, child);
> }
>  }
> Thus I CAN NOT register 2 bean with same type and name!!!
>
> I can register new TextProvider with defferent name:xxxstruts . But I am not
> sure that exactly my bean will be used to create an object for TextProvider.
>
> At that time there is a bug in XWork 2.0.12.1.0  when TextProvider
> object is created.
>
> I want to investigate the common method for loading my realization of
> standart bean.
>
>
>
>
>
>
>
>
>
>
>
> cilquirm wrote:
> >
> > I think the problem might be that there may not be a way to configure a
> > different TextProvider.
> >
> > Consider the object factory example, in this case guice :
> >
> > 
> >
> >> name="guice"
> > class="com.google.inject.struts2.GuiceObjectFactory"/>
> >
> >   
> >   
> >
> > 
> >
> >
> > What this does is create a bean provider with a given name of that type.
> >
> > The constant portion is actually the configuration piece.
> >
> > I tried looking in the source, but I couldn't find how to configure the
> > textProvider.
> > The two pre-configured ones both use the same class so one wouldn't note
> > any difference.
> >
> > Maybe someone on the list can help you out more.
> >
> > Apologies,
> > -a
> >
> >
> >
> > Igor Vlasov wrote:
> >>
> >> This action cause an error.
> >> I will write in struts.xml:
> >> 
> >>
> >>    >> />
> >>
> >>    >> class="karakas.struts.RicoTextProvider" />
> >>    >> class="karakas.struts.RicoTextProvider" />
> >>   
> >>   .
> >> 
> >>
> >> and use the same type(com.opensymphony.xwork2.TextProvider) and the same
> >> name(struts) as in struts-defailt.xml
> >>  Then i recieve an error in tomcat log:
> >>
> >>
> >> Unable to load bean: type:com.opensymphony.xwork2.TextProvider
> >> class:karakas.struts.RicoTextProvider - bean -
> >> /web/WEB-INF/classes/struts.xml:10:109
> >>
> >> Caused by: Bean type interface com.opensymphony.xwork2.TextProvider with
> >> the name xwork1 has already been loaded by [unknown location] - bean -
> >> file:/D:/projects/Karakas1.1/build/web/WEB-INF/classes/struts.xml:10:109
> >>
> >>
> >>
> >>
> >> cilquirm wrote:
> >>>
> >>> you can redefine it in your struts.xml, much like how you would specify
> >>> the object factory to override the default object factory .
> >>>
> >>> -a
> >>>
> >>>
> >>>
> >>> Igor Vlasov wrote:
> 
>  Hello.
>  I want to change some information in struts-default.xml.
> 
>  I can move it to classes directoty and do any change:-)
> 
>  Is there any more sofisticated method to do the same from struts.xml?
> 
>  For example i want to change TextProvider:
>  From
>   class="one class" />
> 
>  to
>    class="another class" />
> 
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13420988
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: [S2.1] url action mapping problem (restful)

2007-10-25 Thread Don Brown
You are correct, #3 isn't possible right now with the rest plugin,
however, it is certainly on the near-term roadmap.  What is needed is
the ability to define wildcards in the namespace, also known as url
templates.  For example, you could do something like
@Namespace("/states/{state}") on your CitiesController class.

That feature won't be in Struts 2.1.0 (to be released very soon),
since it will require changes to XWork and 2.1.0 uses the released
XWork 2.1.0, however, I do plan to have it in XWork trunk in the next
few days.

The original Restful2ActionMapper will work with #3, but not #1 as it
will require "/states/" instead of "/states".  That, and it is kinda
hard to use, IMO, requiring a strange incantation of configuration
(and I wrote a good bit of it).

Don

On 10/26/07, Jeromy Evans <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to setup action mappings for URLs similar to the examples below:
>
> 1. GET: /states=>   action = StatesController, method=index()
> 2. GET: /states/ca => action = StatesController, method=show(),
> params=[id=ca]
> 3a. GET: /states/ca/cities/sacramento   => action = StatesController,
> method=show(), params=[id=ca, cities=sacramento]
> OR
> 3b. GET: /states/ca/cities/sacramento   => action = CitiesController,
> method=show(), params=[id=sacramento, states=ca]
>
> The first two URLs are fine with the struts2-rest-plugin and the
> RestActionMapper but I haven't found any combination of namespaces,
> packages or Controllers to get 3a or 3b to work as well.
>
> As far as I can tell from a brief look, the RestActionMapper assumes the
> URI consists only of an optional namespace prefix, action name, optional
> method and optional id.  However the Restful2ActionMapper (which I
> haven't used and presume is superseded) does attempt to extract
> parameters as described at #3.
>
> Can anyone suggest how the packages/namespaces/Controllers(Actions)
> should be setup to get either 3a or 3b to work with the rest plugin in 2.1?
>
> Thanks,
> Jeromy Evans
>
> PS. I also couldn't produce anything equivalent using the SmartUrls-0.18
> plugin with 2.0
>
>
> -
> 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] Change struts-default.xml content

2007-10-25 Thread Igor Vlasov

The class com.opensymphony.xwork2.config.providers.XmlConfigurationProvider
in method register(...) use this logic for checking

if (containerBuilder.contains(ctype, name)) {
 Location loc =
LocationUtils.getLocation(loadedBeans.get(ctype.getName() + name));
if (throwExceptionOnDuplicateBeans) {
  throw new ConfigurationException("Bean type " + ctype + "
with the name " +
name + " has already been loaded by " + loc, child);
} 
 }
Thus I CAN NOT register 2 bean with same type and name!!!

I can register new TextProvider with defferent name:xxxstruts . But I am not
sure that exactly my bean will be used to create an object for TextProvider.

At that time there is a bug in XWork 2.0.12.1.0  when TextProvider
object is created.

I want to investigate the common method for loading my realization of
standart bean.











cilquirm wrote:
> 
> I think the problem might be that there may not be a way to configure a
> different TextProvider.
> 
> Consider the object factory example, in this case guice :
> 
> 
> 
>name="guice"
> class="com.google.inject.struts2.GuiceObjectFactory"/>
> 
>   
>   
> 
> 
> 
> 
> What this does is create a bean provider with a given name of that type.  
> 
> The constant portion is actually the configuration piece.
> 
> I tried looking in the source, but I couldn't find how to configure the
> textProvider.  
> The two pre-configured ones both use the same class so one wouldn't note
> any difference.
> 
> Maybe someone on the list can help you out more.
> 
> Apologies,
> -a
> 
> 
> 
> Igor Vlasov wrote:
>> 
>> This action cause an error.
>> I will write in struts.xml:
>> 
>>   
>>   > />
>>   
>>   > class="karakas.struts.RicoTextProvider" />
>>   > class="karakas.struts.RicoTextProvider" />
>>   
>>   .
>> 
>> 
>> and use the same type(com.opensymphony.xwork2.TextProvider) and the same
>> name(struts) as in struts-defailt.xml 
>>  Then i recieve an error in tomcat log: 
>> 
>> 
>> Unable to load bean: type:com.opensymphony.xwork2.TextProvider
>> class:karakas.struts.RicoTextProvider - bean -
>> /web/WEB-INF/classes/struts.xml:10:109
>> 
>> Caused by: Bean type interface com.opensymphony.xwork2.TextProvider with
>> the name xwork1 has already been loaded by [unknown location] - bean -
>> file:/D:/projects/Karakas1.1/build/web/WEB-INF/classes/struts.xml:10:109
>> 
>> 
>> 
>> 
>> cilquirm wrote:
>>> 
>>> you can redefine it in your struts.xml, much like how you would specify
>>> the object factory to override the default object factory .
>>> 
>>> -a
>>> 
>>> 
>>> 
>>> Igor Vlasov wrote:
 
 Hello.
 I want to change some information in struts-default.xml.
 
 I can move it to classes directoty and do any change:-)
 
 Is there any more sofisticated method to do the same from struts.xml?
 
 For example i want to change TextProvider:
 From 
>>> class="one class" />
 
 to
 >>> class="another class" />
 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13420988
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] Datetimepicker in Struts 2.1.0

2007-10-25 Thread Jeromy Evans

Hi Mark,

I'm not sure that it helps, but I'm able to get the datetimepicker to 
work (in JSP) using 
https://svn.apache.org/repos/asf/struts/struts2/trunk @ rev 588199, last 
changed 2007-10-25 21:02:52 +1000


The only new issue I did encounter was due to the requirement to enable 
non-US locales through the head tag.


I'm working from a clean build from trunk (mvn clean install -Pall).  
Hope that helps in some way.

regards,
Jeromy Evans

Mark P Ashworth wrote:

Good Day,

I am trying to use the 2.1.0 build of the dojo plug-in and I am getting an
InvalidReferenceException. The issue
https://issues.apache.org/struts/browse/WW-1757 helped to resolve the issue
on the 2.0.9 build but now even the <@s.dateTimePicker /> or
<@s.datetimepicker /> does not seem to work.


on line 49, column 17 in workitem.ftl s.datetimepicker not found.
The problematic instruction:
--
==> user-directive s.datetimepicker [on line 49, column 17 in workitem.ftl]
 in user-directive s.form [on line 20, column 9 in workitem.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: on line 49, column 17 in
workitem.ftl s.datetimepicker not found.
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
  



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



Re: [S2] Head parseContent in Struts 2.1.0

2007-10-25 Thread Jeromy Evans

Hi Mark,
No such problem encountered on 
https://svn.apache.org/repos/asf/struts/struts2/trunk @ rev 588199, last 
changed 2007-10-25 21:02:52 +1000

although I'm using JSP.

Just a quick check for a small mistake though: you are using the head 
tag from /struts-dojo-tags rather than /struts-tags aren't you?


ie. JSP:
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
 

cheers,
Jeromy Evans

Mark P Ashworth wrote:

Good Day,


I got the following exception when using the nightly build of the 26 Oct
2007 of core and the latest dojo plugins build from svn. I put the
parseContent in the <@s.head parseContent="false" > and it seems to have
fixed the problem. The documentation seemed to point that the parseContent
was false by default, is this still the case.

Expression parameters.parseContent is undefined on line 45, column 28 in
template/ajax/head.ftl.
The problematic instruction:
--
==> ${parameters.parseContent?string} [on line 45, column 26 in
template/ajax/head.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression
parameters.parseContent is undefined on line 45, column 28 in
template/ajax/head.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at 
freemarker.core.BuiltIn$stringBI._getAsTemplateModel(BuiltIn.java:358)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Regards,
Mark P Ashworth
  



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



[S2.1] url action mapping problem (restful)

2007-10-25 Thread Jeromy Evans

Hi,

I'm trying to setup action mappings for URLs similar to the examples below:

1. GET: /states=>   action = StatesController, method=index()
2. GET: /states/ca => action = StatesController, method=show(), 
params=[id=ca]
3a. GET: /states/ca/cities/sacramento   => action = StatesController, 
method=show(), params=[id=ca, cities=sacramento]

OR
3b. GET: /states/ca/cities/sacramento   => action = CitiesController, 
method=show(), params=[id=sacramento, states=ca]


The first two URLs are fine with the struts2-rest-plugin and the 
RestActionMapper but I haven't found any combination of namespaces, 
packages or Controllers to get 3a or 3b to work as well.


As far as I can tell from a brief look, the RestActionMapper assumes the 
URI consists only of an optional namespace prefix, action name, optional 
method and optional id.  However the Restful2ActionMapper (which I 
haven't used and presume is superseded) does attempt to extract 
parameters as described at #3.


Can anyone suggest how the packages/namespaces/Controllers(Actions) 
should be setup to get either 3a or 3b to work with the rest plugin in 2.1?


Thanks,
Jeromy Evans

PS. I also couldn't produce anything equivalent using the SmartUrls-0.18 
plugin with 2.0



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



[S2] Datetimepicker in Struts 2.1.0

2007-10-25 Thread Mark P Ashworth

Good Day,

I am trying to use the 2.1.0 build of the dojo plug-in and I am getting an
InvalidReferenceException. The issue
https://issues.apache.org/struts/browse/WW-1757 helped to resolve the issue
on the 2.0.9 build but now even the <@s.dateTimePicker /> or
<@s.datetimepicker /> does not seem to work.


on line 49, column 17 in workitem.ftl s.datetimepicker not found.
The problematic instruction:
--
==> user-directive s.datetimepicker [on line 49, column 17 in workitem.ftl]
 in user-directive s.form [on line 20, column 9 in workitem.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: on line 49, column 17 in
workitem.ftl s.datetimepicker not found.
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
-- 
View this message in context: 
http://www.nabble.com/-S2--Datetimepicker-in-Struts-2.1.0-tf4694994.html#a13420348
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] Head parseContent in Struts 2.1.0

2007-10-25 Thread Mark P Ashworth

Good Day,


I got the following exception when using the nightly build of the 26 Oct
2007 of core and the latest dojo plugins build from svn. I put the
parseContent in the <@s.head parseContent="false" > and it seems to have
fixed the problem. The documentation seemed to point that the parseContent
was false by default, is this still the case.

Expression parameters.parseContent is undefined on line 45, column 28 in
template/ajax/head.ftl.
The problematic instruction:
--
==> ${parameters.parseContent?string} [on line 45, column 26 in
template/ajax/head.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression
parameters.parseContent is undefined on line 45, column 28 in
template/ajax/head.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at 
freemarker.core.BuiltIn$stringBI._getAsTemplateModel(BuiltIn.java:358)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Regards,
Mark P Ashworth
-- 
View this message in context: 
http://www.nabble.com/-S2--Head-parseContent-in-Struts-2.1.0-tf4694985.html#a13420317
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts2-spring-plugin-2.0.9.jar

2007-10-25 Thread stanlick

Is there a logical explanation for this struts-plugin.xml file to declare the
stand alone interceptors autowiring and sessionAutowiring which are already
declared identically in struts-default.xml?  I am either missing something
fundamental here or 19 hours is too long to work without ceasing.

Scott
-- 
View this message in context: 
http://www.nabble.com/struts2-spring-plugin-2.0.9.jar-tf4694486.html#a13418846
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S 1.3]IncludeAction or any other Alternative?

2007-10-25 Thread enthucoder

I have a requirement, where on each page load, I hit some Servlet or Action
(Can be modified accordingly). Should i use a IncludeAction here or there is
a better or elegant way to achieve this? 

H.
-- 
View this message in context: 
http://www.nabble.com/-S-1.3-IncludeAction-or-any-other-Alternative--tf4693599.html#a13415790
Sent from the Struts - User mailing list archive at Nabble.com.


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



unit testsing struts 2 code that contains resource calls like getText()

2007-10-25 Thread Session A Mwamufiya
Hi,

Junit is unable to run getText() and retrieve text resources from a package.xml 
file, because it appears to be a functionality that is provided by the 
ActionSupport super class.  Is there a way to setup my Junit test case to be 
able to run that code?  I've setup my test case to use a mock http session 
already, so I'm not sure if this is doable as well.

Thanks,
Session


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



Re: Audit trail - implementation strategies

2007-10-25 Thread Brian Trzupek

We just did the very same thing. Here is how we did it

We are using JPA/Toplink for our database layer, so our  
implementation is highly dependent on that.


We then used an approach based on this blog entry:
http://tapestryofthoughts.blogspot.com/2007/05/glassfish-and-audit- 
logging.html


Our modification to his approach was (well his doesn't compile on our  
version of Toplink , so we changed that):
1) We implemented the PrincipalAware interface for our Action classes  
so that we can use JAAS for authentication and pass the remote User  
identity through to the Audit interface (in the Model) and know who  
actually did the change.
2) We incorporated a 'mode' for audit logging. We have things like  
AUDIT (where that is a interface driven event, like approving  
resource access AUDIT_APPROVE etc), VIEW (where that is another  
interface driven event representing that a user 'saw' something) and  
general field level CRUD operations on the core entities we wanted  
audited.
3) Then we implemented some specific rules where given AUDIT events  
would trigger full field level audits (essentially serializing the  
object) in the case where the rule trigger was an event that would  
'have historical significance'.


I know it sounds a bit gnarly, but is VERY elegant and extensible.  
Give it a whirl and let me know if you need any help.


Thanks,
Brian-

On Oct 25, 2007, at 1:35 PM, wild_oscar wrote:



I want to implement an audit trail in my application. Basically, I  
want to
record every database change, in the form "previous value, new  
value, who

changed it, when".

I want to debate with you the best strategy in terms of  
minimization of data

transfer between the browser and the server and server operations.

The user accesses a page and gets data from the database on a form. He
changes, say, one textfielnd and submits the form.

We now need to see where changes occurred and record them, and  
therefore

need the old values and new values.

What do you think of different approaches to this problem? My  
current ideas

are:

1) Resubmit the first query to get the "oldvalues" on the second  
submission
and then compare with the new values. Problem I see is that we'll  
have one
redundant query on each operation (first query to display values to  
the user
and second query to get the old values again in the database). In  
large

applications, between the 1st and 2nd queries data may have changed.

2) Have a hidden field for each value on the display form with the  
oldValue.
Main problem I see is the increased workload on the jsp page - for  
each

input field we need to manually have a hidden "oldValue" field...

3) Storing the oldObject in session right before the first display  
page.
Workload increases in Session management, to wisely add and remove  
these

objects from session.

Can you share your ideas, point different approaches or suggest  
improvements

on the ones I mentioned?

--
View this message in context: http://www.nabble.com/Audit-trail--- 
implementation-strategies-tf4692772.html#a13413247

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: Audit trail - implementation strategies

2007-10-25 Thread wild_oscar

As a matter of fact, I have implemented an audit trail solution with triggers
in the past. I am trying to think of an alternative in the business layer
now, although implementing it directly in the database is an option if I
find this approach to be too troublesome.


Rod Bollinger wrote:
> 
> Depending on the DB you can implement this using triggers and log your
> audit
> trail directly in the DB itself.
> 
> -Rod
> 
> -Original Message-
> From: wild_oscar [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 25, 2007 14:36
> To: user@struts.apache.org
> Subject: Audit trail - implementation strategies
> 
> 
> I want to implement an audit trail in my application. Basically, I want to
> record every database change, in the form "previous value, new value, who
> changed it, when".
> 
> I want to debate with you the best strategy in terms of minimization of
> data
> transfer between the browser and the server and server operations.
> 
> The user accesses a page and gets data from the database on a form. He
> changes, say, one textfield and submits the form.
> 
> We now need to see where changes occurred and record them, and therefore
> need the old values and new values.
> 
> What do you think of different approaches to this problem? My current
> ideas
> are:
> 
> 1) Resubmit the first query to get the "oldvalues" on the second
> submission
> and then compare with the new values. Problem I see is that we'll have one
> redundant query on each operation (first query to display values to the
> user
> and second query to get the old values again in the database). In large
> applications, between the 1st and 2nd queries data may have changed.
> 
> 2) Have a hidden field for each value on the display form with the
> oldValue.
> Main problem I see is the increased workload on the jsp page - for each
> input field we need to manually have a hidden "oldValue" field...
> 
> 3) Storing the oldObject in session right before the first display page.
> Workload increases in Session management, to wisely add and remove these
> objects from session.
> 
> Can you share your ideas, point different approaches or suggest
> improvements
> on the ones I mentioned?
> 
> -- 
> View this message in context:
> http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html
> #a13413247
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html#a13413561
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: struts-tiles migration issues

2007-10-25 Thread Antonio Petrelli
2007/10/25, Hans Hedung <[EMAIL PROTECTED]>:
> 2.
> No you're absolutely correct about that.
>
> In the was 5.1 log I can read
>
>
>
>
> [2007-10-25 16:53:54:616 CEST] 3dff516d WebGroup I SRVE0180I:
> [StoreMasterWeb.war] [/StoreMasterWeb] [Servlet.LOG]: action: init
>
> [2007-10-25 16:53:55:304 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module ''.
>
> [2007-10-25 16:53:55:569 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module '/store'.
>
> [2007-10-25 16:53:55:726 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module '/admin'.
>
> [2007-10-25 16:53:55:819 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module '/company'.
>
> [2007-10-25 16:53:55:913 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module '/report'.
>
> [2007-10-25 16:53:56:116 CEST] 3dff516d TilesPlugin I
> org.apache.struts.tiles.TilesPlugin Tiles definition
> factory loaded for module '/person'.
>
>
>
>
>
> In was 6.1 it simply says:
>
>
>
> [2007-10-25 09:28:59:821 CEST] 0016 ServletWrappe I SRVE0242I:
> [StoreMaster] [/StoreMasterWeb] [action]: Initialization successful.
>  So the tiles def doesnt seem to get loaded

Probably it's a question of wrong configuration. Can I see the piece
of your struts-config.xml where you configure the Tiles plugin?

Antonio

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



RE: Audit trail - implementation strategies

2007-10-25 Thread Rod Bollinger
Depending on the DB you can implement this using triggers and log your audit
trail directly in the DB itself.

-Rod

-Original Message-
From: wild_oscar [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 25, 2007 14:36
To: user@struts.apache.org
Subject: Audit trail - implementation strategies


I want to implement an audit trail in my application. Basically, I want to
record every database change, in the form "previous value, new value, who
changed it, when".

I want to debate with you the best strategy in terms of minimization of data
transfer between the browser and the server and server operations.

The user accesses a page and gets data from the database on a form. He
changes, say, one textfield and submits the form.

We now need to see where changes occurred and record them, and therefore
need the old values and new values.

What do you think of different approaches to this problem? My current ideas
are:

1) Resubmit the first query to get the "oldvalues" on the second submission
and then compare with the new values. Problem I see is that we'll have one
redundant query on each operation (first query to display values to the user
and second query to get the old values again in the database). In large
applications, between the 1st and 2nd queries data may have changed.

2) Have a hidden field for each value on the display form with the oldValue.
Main problem I see is the increased workload on the jsp page - for each
input field we need to manually have a hidden "oldValue" field...

3) Storing the oldObject in session right before the first display page.
Workload increases in Session management, to wisely add and remove these
objects from session.

Can you share your ideas, point different approaches or suggest improvements
on the ones I mentioned?

-- 
View this message in context:
http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html
#a13413247
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]



Audit trail - implementation strategies

2007-10-25 Thread wild_oscar

I want to implement an audit trail in my application. Basically, I want to
record every database change, in the form "previous value, new value, who
changed it, when".

I want to debate with you the best strategy in terms of minimization of data
transfer between the browser and the server and server operations.

The user accesses a page and gets data from the database on a form. He
changes, say, one textfielnd and submits the form.

We now need to see where changes occurred and record them, and therefore
need the old values and new values.

What do you think of different approaches to this problem? My current ideas
are:

1) Resubmit the first query to get the "oldvalues" on the second submission
and then compare with the new values. Problem I see is that we'll have one
redundant query on each operation (first query to display values to the user
and second query to get the old values again in the database). In large
applications, between the 1st and 2nd queries data may have changed.

2) Have a hidden field for each value on the display form with the oldValue.
Main problem I see is the increased workload on the jsp page - for each
input field we need to manually have a hidden "oldValue" field...

3) Storing the oldObject in session right before the first display page.
Workload increases in Session management, to wisely add and remove these
objects from session.

Can you share your ideas, point different approaches or suggest improvements
on the ones I mentioned?

-- 
View this message in context: 
http://www.nabble.com/Audit-trail---implementation-strategies-tf4692772.html#a13413247
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] - Types in form parameters

2007-10-25 Thread cilquirm

A failed type conversion will incur a field error as well.  




wild_oscar wrote:
> 
> 
> 
> newton.dave wrote:
>> 
>> --- wild_oscar <[EMAIL PROTECTED]> wrote:
>>> In a form I have a parameter passed like:
>>> 
>>> 
>>> 
>>> where sop is of class I created.
>>> 
>>> When I execute the action I get:
>>> 
>>> "No result defined for action myAction and result
>>> input"
>>> 
>>> Does this have to do with the fact that the variable
>>> is of a custom type (and not a string, int, etc)?
>> 
>> Not directly. Most likely it means that validation has
>> failed and S2 is attempting to take you back to the
>> form's "input" page (result).
>> 
>> 
> 
> The point is that I don't have any validation for it. 
> Debugging it I saw I had a FieldError
> 
> "Invalid field value for field oldSop".
> 
> That's why I assumed I couldn't simply send the Sop object back to the
> server.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2Types-in-form-parameters-tf4690260.html#a13409207
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] Change struts-default.xml content

2007-10-25 Thread cilquirm

I think the problem might be that there may not be a way to configure a
different TextProvider.

Consider the object factory example, in this case guice :



  

  
  




What this does is create a bean provider with a given name of that type.  

The constant portion is actually the configuration piece.

I tried looking in the source, but I couldn't find how to configure the
textProvider.  
The two pre-configured ones both use the same class so one wouldn't note any
difference.

Maybe someone on the list can help you out more.

Apologies,
-a



Igor Vlasov wrote:
> 
> This action cause an error.
> I will write in struts.xml:
> 
>   
>    />
>   
>    class="karakas.struts.RicoTextProvider" />
>    class="karakas.struts.RicoTextProvider" />
>   
>   .
> 
> 
> and use the same type(com.opensymphony.xwork2.TextProvider) and the same
> name(struts) as in struts-defailt.xml 
>  Then i recieve an error in tomcat log: 
> 
> 
> Unable to load bean: type:com.opensymphony.xwork2.TextProvider
> class:karakas.struts.RicoTextProvider - bean -
> /web/WEB-INF/classes/struts.xml:10:109
> 
> Caused by: Bean type interface com.opensymphony.xwork2.TextProvider with
> the name xwork1 has already been loaded by [unknown location] - bean -
> file:/D:/projects/Karakas1.1/build/web/WEB-INF/classes/struts.xml:10:109
> 
> 
> 
> 
> cilquirm wrote:
>> 
>> you can redefine it in your struts.xml, much like how you would specify
>> the object factory to override the default object factory .
>> 
>> -a
>> 
>> 
>> 
>> Igor Vlasov wrote:
>>> 
>>> Hello.
>>> I want to change some information in struts-default.xml.
>>> 
>>> I can move it to classes directoty and do any change:-)
>>> 
>>> Is there any more sofisticated method to do the same from struts.xml?
>>> 
>>> For example i want to change TextProvider:
>>> From 
>>>>> class="one class" />
>>> 
>>> to
>>> >> class="another class" />
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2---Change-struts-default.xml-content-tf4684048.html#a13409191
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] [S2.0.9] v. Ajax

2007-10-25 Thread Dave Newton
Okay, thanks.

New project will be in 2.1 anyway, I think, which
gives me a few more options :)

--- Musachy Barroso <[EMAIL PROTECTED]> wrote:

> yup, the href is what counts (or the "action" in the
> enclosing form if
> the submit doesn't have an href)
> 
> musachy
> 
> On 10/24/07, Dave Newton <[EMAIL PROTECTED]>
> wrote:
> > Howdy,
> >
> > If you have an  with "method=''" or
> "name='method:foo'" attributes and set
> "theme='ajax'" is the method attribute/name-thing
> ignored?
> >
> > Thanks,
> > Dave
> >
> >
> >
> >
> >
>
-
> > 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]
> 
> 


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



RE: Problem with ForwardAction after update from Struts 1.2.9 to 1.3.8

2007-10-25 Thread Samuel Fleischle
Yes I´m sure, I only changed the Jars and replaced the contextRelative 
attribute in my JSPs and in my Struts config.

Meanwhile I wrote my own ForwardAction with copy & paste and changed the 
following code:

Current code in ForwardAction:
ActionForward retVal = new ActionForward(path);

My code:
ActionForward retVal = new ActionForward(null, path, false, "");



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict
Sent: Thursday, October 18, 2007 6:07 AM
To: Struts Users Mailing List
Subject: Re: Problem with ForwardAction after update from Struts 1.2.9 to 1.3.8

That sounds like a bug to me. Are you sure this is the behavior and nothing
has changed from your upgrade?

On 10/12/07, Samuel Fleischle <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I updated from Struts 1.2.9 to Struts 1.3.8. Now I have the following
> problem in my ForwardActions. Here is an example of what I want to do:
>
> I have the following code in my admin module:
>
>  parameter="/WEB-INF/pages/admin/index.jsp"/>
>
> In Struts 1.2.9 this code worked fine and if I called the URL
> http://localhost:8080/myapp/admin/index.do I got the correct index.jsp.
> But now in Struts 1.3.8 Struts is going to search for the page
> /admin/WEB-INF/pages/admin/index.jsp because I am in the admin module.
>
> Is here any solution to get Struts 1.3.8 running for my issue?
>
> Regards,
> Sam
>
>
>
> -
> 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] - Types in form parameters

2007-10-25 Thread wild_oscar



newton.dave wrote:
> 
> --- wild_oscar <[EMAIL PROTECTED]> wrote:
>> In a form I have a parameter passed like:
>> 
>> 
>> 
>> where sop is of class I created.
>> 
>> When I execute the action I get:
>> 
>> "No result defined for action myAction and result
>> input"
>> 
>> Does this have to do with the fact that the variable
>> is of a custom type (and not a string, int, etc)?
> 
> Not directly. Most likely it means that validation has
> failed and S2 is attempting to take you back to the
> form's "input" page (result).
> 
> 

The point is that I don't have any validation for it. 
Debugging it I saw I had a FieldError

"Invalid field value for field oldSop".

That's why I assumed I couldn't simply send the Sop object back to the
server.

-- 
View this message in context: 
http://www.nabble.com/-S2Types-in-form-parameters-tf4690260.html#a13408730
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] [S2.0.9] v. Ajax

2007-10-25 Thread Musachy Barroso
yup, the href is what counts (or the "action" in the enclosing form if
the submit doesn't have an href)

musachy

On 10/24/07, Dave Newton <[EMAIL PROTECTED]> wrote:
> Howdy,
>
> If you have an  with "method=''" or "name='method:foo'" 
> attributes and set "theme='ajax'" is the method attribute/name-thing ignored?
>
> Thanks,
> Dave
>
>
>
>
> -
> 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-tiles migration issues

2007-10-25 Thread Hans Hedung


 
 1.It is defined as follows, which works fine i was 5.1. 





  2.No you're 
absolutely correct about that.  In the was 5.1 log I can read

[2007-10-25 16:53:54:616 CEST] 3dff516d WebGroup I SRVE0180I: 
[StoreMasterWeb.war] [/StoreMasterWeb] [Servlet.LOG]: action: init
[2007-10-25 16:53:55:304 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
''.
[2007-10-25 16:53:55:569 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
'/store'.
[2007-10-25 16:53:55:726 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
'/admin'.
[2007-10-25 16:53:55:819 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
'/company'.
[2007-10-25 16:53:55:913 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
'/report'.
[2007-10-25 16:53:56:116 CEST] 3dff516d TilesPlugin I 
org.apache.struts.tiles.TilesPlugin Tiles definition factory loaded for module 
'/person'.
 
 
In was 6.1 it simply says:
 
[2007-10-25 09:28:59:821 CEST] 0016 ServletWrappe I SRVE0242I: 
[StoreMaster] [/StoreMasterWeb] [action]: Initialization successful.
 
So the tiles def doesnt seem to get loaded
3. Where should I add the type='definition' attribute? in the tiles def 
definition?
 
 
Regard
/H  here is complete stacktrace when I try to access the startpage on 6.1 
server.   > Date: Thu, 25 Oct 2007 16:19:59 +0200> From: [EMAIL PROTECTED]> To: 
user@struts.apache.org> Subject: Re: struts-tiles migration issues> > First of 
all it is not the same problem as the TILES-201 issue.> From your stacktrace I 
suppose that you are trying to render the> '.welcomeat' tiles definition. Check 
if:> - you have this definition in your tiles-defs.xml> - Tiles loads correctly 
the Tiles definition files at startup (i.e. check> the log at startup).> - 
possibly, use type='definition' when you put the attribute, if it still> does 
not work.> > Antonio
_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/--Start of DE processing-- = [2007-10-25 09:33:09:590 CEST] , key = 
java.io.FileNotFoundException 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest 573
Exception = java.io.FileNotFoundException
Source = 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest
probeid = 573
Stack Dump = java.io.FileNotFoundException: /.welcome
at 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:362)
at 
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)
at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at 
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at 
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at 
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
at 
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:518)
at 
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:170)
at com.ibm._jsp._index._jspx_meth_logic_forward_0(_index.java:100)
at com.ibm._jsp._index._jspService(_index.java:74)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at 
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
  

Re: Multiple Textboxes with same name.

2007-10-25 Thread Dave Newton
S2 will handle indexed form names properly, so you
could have an action property defined as, say, "List
usernames" and name the form elements "username[0]"
etc.

http://struts.apache.org/2.x/docs/type-conversion.html
may help, towards the bottom.

d.

--- Rajagopal_Yendluri <[EMAIL PROTECTED]>
wrote:

> Hi,
> 
> I Have the following requirement in my project and I
> am new to struts2.
> 
> 
> I have to enter the data for Users: say I want to
> add 10 usernames from
> UI and I want to store all this usernames in
> database.
> 
>   For EX: my UI Looks like this
> 
>   USERNAME: 
>   textbox--
>   textbox--
>   textbox--
> 
> And I have to store all this data in Databsae.
> 
> I know if it is one textbox we have a property in
> action with
> getter/setter methods and we can get the value.
> 
> Let me know how to deal with this kind of form.
> 
> Regards,
> Rajagopal
> 
> 
> 
> DISCLAIMER:
> This email (including any attachments) is intended
> for the sole use of the intended recipient/s and may
> contain material that is CONFIDENTIAL AND PRIVATE
> COMPANY INFORMATION. Any review or reliance by
> others or copying or distribution or forwarding of
> any or all of the contents in this message is
> STRICTLY PROHIBITED. If you are not the intended
> recipient, please contact the sender by email and
> delete all copies; your cooperation in this regard
> is appreciated.
> 
>
-
> 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] - Types in form parameters

2007-10-25 Thread Dave Newton
--- wild_oscar <[EMAIL PROTECTED]> wrote:
> In a form I have a parameter passed like:
> 
> 
> 
> where sop is of class I created.
> 
> When I execute the action I get:
> 
> "No result defined for action myAction and result
> input"
> 
> Does this have to do with the fact that the variable
> is of a custom type (and not a string, int, etc)?

Not directly. Most likely it means that validation has
failed and S2 is attempting to take you back to the
form's "input" page (result).

> An affirmative answer to this question leads me to
> the second question: how does one send custom 
> class variables back to the server?

Even though I didn't give an affirmative answer I'll
answer this anyway.

The only thing a browser can send back to the server
is a string. XWork's type conversion can *convert*
that string into other types: typical conversions are
built-in, yours isn't, so you'd need to create your
own type converter.

That isn't always what you want, though, in which case
you might need to put it in session.

d.


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



struts2 validation - wildcard mappings and the submit tag "method" parameter

2007-10-25 Thread Lindell, Andrew
The problem I'm having is getting validation to run when the wildcard
mapped method is specified in the submit tag method parameter and not in
the form tag action parameter (action-method).

Everything works fine when I set the form action param to specify the
action and method.

 

If the method is specified in the submit tag does it use the same format
for validation files (actionclass-alias-method).

 

Thanks

 

-Andrew

 

 



Re: struts-tiles migration issues

2007-10-25 Thread Antonio Petrelli
First of all it is not the same problem as the TILES-201 issue.
>From your stacktrace I suppose that you are trying to render the
".welcomeat" tiles definition. Check if:
- you have this definition in your tiles-defs.xml
- Tiles loads correctly the Tiles definition files at startup (i.e. check
the log at startup).
- possibly, use type="definition" when you put the attribute, if it still
does not work.

Antonio


[S2] Problem while retrieving data from JSP

2007-10-25 Thread kaouki

Hi,
I get this bean in my action in order to modify it in my jsp:
Catalogue {
Long id;
String title;
String description;
Collection produits
}
In this jsp, I have two fieds: title and description, and a table of Produit
with checkboxes.
These ones enable the user to remove the products from the catalogue.

In my save action, I get the catalogue (property of the action) and a Long[]
(the id of the checked products).
The problem is that the Products Collection of the Catalogue and its id are
null.

So, if I want update some attributes of my bean, I have to put the bean in
Session ? or all the unchanged attributes in hidden fields ?

I'm grateful for any input on the matter. Cheers.
-- 
View this message in context: 
http://www.nabble.com/-S2--Problem-while-retrieving-data-from-JSP-tf4691128.html#a13407615
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts-tiles migration issues

2007-10-25 Thread Hans Hedung










Hello,im having difficulties migrating my 1.1 struts app from websphere 5.1 to 
websphere 6.1.in short, the same difficulties as this post: 
http://issues.apache.org/struts/browse/TILES-201 Im using RAD 
7.0.0.4.Everything works fine on WAS 5.1. Migrating to WAS 6.1 works fine, for 
starters, aswell, and I dont get any error deploying my webapp on the server 
but when I try to access my start page I get the following error_log:  
--Start of DE processing-- = [2007-10-25 09:33:09:590 CEST] , key = 
java.io.FileNotFoundException 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest 
573Exception = java.io.FileNotFoundExceptionSource = 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequestprobeid
 = 573Stack Dump = java.io.FileNotFoundException: /.welcomeat 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:362)at
 
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)at
 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)at
 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)at
 
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)at
 
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)at
 
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)at
 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)at
 
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)at
 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)at
 org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:518)at 
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:170)at 
com.ibm._jsp._index._jspx_meth_logic_forward_0(_index.java:100)at 
com.ibm._jsp._index._jspService(_index.java:74)at 
com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)at 
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)at
 
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)at
 
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)at
 
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)at
 
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)at
 
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)at
 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)at
 
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:472)at
 
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)at
 com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)at 
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)at 
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)at 
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)at 
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)at 
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)at
 
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)at
 
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)at
 
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)at
 
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)at
 
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)at
 
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)at
 
com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)at
 com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)at 
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)at 
com.ibm.io.async.ResultHandler.runEventProcessingL

Multiple Textboxes with same name.

2007-10-25 Thread Rajagopal_Yendluri
Hi,

I Have the following requirement in my project and I am new to struts2.


I have to enter the data for Users: say I want to add 10 usernames from
UI and I want to store all this usernames in database.

For EX: my UI Looks like this

USERNAME: 
textbox--
textbox--
textbox--

And I have to store all this data in Databsae.

I know if it is one textbox we have a property in action with
getter/setter methods and we can get the value.

Let me know how to deal with this kind of form.

Regards,
Rajagopal



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the 
intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE 
COMPANY INFORMATION. Any review or reliance by others or copying or 
distribution or forwarding of any or all of the contents in this message is 
STRICTLY PROHIBITED. If you are not the intended recipient, please contact the 
sender by email and delete all copies; your cooperation in this regard is 
appreciated.

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



XML configuration and performance

2007-10-25 Thread Tomás Pollak
Hello all,

I am currently working on a development project for a web system using
Struts 1.2.9. It is a fairly large system that has been under development
for more than three years now.

During the code-test-and-debug cycle we are forced to restart the server
several times, and we have noticed that reading the XML configuration files
is what takes most of the time ( struts-config.xml, validation.xml and
tiles-defs.xml), approximately 30 secs.

These files are pretty stable now, so having to pay the price to parse the
XML every time seems unnecessary. I was wondering if there is an approach to
configure a Struts application using code instead of XML files. Has anyone
bumped into this problem before?
Is there a tool to transform a Struts/Tiles/Validator XML file into a Java
class that produces the same configuration? I could not find anything in the
documentation.

Thanks in advance,
Tomas


[S2] - Types in form parameters

2007-10-25 Thread wild_oscar

I have quite a elementary question regarding passing parameters to the
server.

In a form I have a parameter passed like:



where sop is of class I created.

When I execute the action I get:

"No result defined for action myAction and result input"

Does this have to do with the fact that the variable is of a custom type
(and not a string, int, etc)?

An affirmative answer to this question leads me to the second question: how
does one send custom class variables back to the server? All I can think of
is putting the variable in Session. What other ways are there ?

Thank you for the input.
-- 
View this message in context: 
http://www.nabble.com/-S2Types-in-form-parameters-tf4690260.html#a13404859
Sent from the Struts - User mailing list archive at Nabble.com.


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



[S2] JasperReports and Struts2 DataSource was null error

2007-10-25 Thread carmi_cd

i'm new in integrating JasperReports and Struts 2..my problem is its always
saying that my datasouce is
null so it displays a pdf file with all the labels in it without anything on
the detail part..my datasource
is an ArrayList of Personnel object, i name it reportData.

here is part of my code..


public class EIS_HR_004_JASPER extends eisSupport {
private String reportId;
private String dateStart = null;
private String dateEnd = null;
private Report thisReport;
private String dateRange;
private ArrayList reportData;

public String execute(ActionMapping mapping,ActionForm form,
HttpServletRequest request, HttpServletResponse response) 
throws Exception {
ReportBean reportBean = new ReportBean(); 
setThisReport(reportBean.getReport(getReportId()));
reportData=new ArrayList();
Personnel p1=new Personnel();
p1.setSurname("De la Cruz");
p1.setFirstname("Juan");
p1.setExamcode("CSC111");
p1.setExamdate("January 1,2003");
Personnel p2=new Personnel();
p2.setSurname("Hepburn");
p2.setFirstname("Audrey");
p2.setExamcode("CSC222");
p2.setExamdate("December 2,2003");

reportData.add(p1);
reportData.add(p2);
  
   return SUCCESS;
}

   public ArrayList getReportData() {
   // setReportData();
return reportData;
}

}


thanks in advance for your help. :-)
-- 
View this message in context: 
http://www.nabble.com/-S2--JasperReports-and-Struts2-DataSource-was-null-error-tf4689733.html#a13403514
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: Why does update action fire on load

2007-10-25 Thread zul;jami

I have two methods in action extending actionsupport in struts2.
WHen I login it should execute only the execute method.BUT
it also fires update another method which I want to call some other time.

THis is my struts.xml
**

   login.jsp
   login.jsp
   /pages/main.jsp

 
/pages/dashboard.jsp

***


Piero Sartini-3 wrote:
> 
> Am Montag, 22. Oktober 2007 13:23:38 schrieb zul;jami:
>> Still I am getting the error,
>> my execute also fires update on load.
>> There is no img tag with empty src attribute
> 
> execute() is triggered when the action is called, not only when you submit 
> your data.
> 
>   Piero
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Why-does-update-action-fire-on-load-tf4670323.html#a13402904
Sent from the Struts - User mailing list archive at Nabble.com.


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



struts2 actionerror & actionmessage

2007-10-25 Thread cuong.van.truong
I have this actions in the same namespace:



example1.jsp





 

doThing

 



 

In a jsp file a form have a action="add" and in the action
class(doThingAction.java) I add a message to actionmessage. The problem
here is the value are not store on the action that it rederected
to(). How can I get the
message that I added to on the first action? Help plz.

 

 

CvT