Author Login
Post Reply
user Digest 22 Jul 2008 08:10:44 -0000 Issue 8152
Topics (messages 189127 through 189152):
unwanted field reset after failed validation on submit
189127 by: Tom Vertommen
Re: Execute and wait interceptor and calling an action more than once
189128 by: Burak Doðruöz
189130 by: Jeromy Evans
189131 by: Dave Newton
189132 by: Burak Doðruöz
189134 by: Burak Doðruöz
189135 by: Dave Newton
189136 by: Burak Doðruöz
Re: Multiple unknown handlers?
189129 by: Brad A Cupit
Re: Error global-Forwards
189133 by: Dani
[S2] Conversion validation issue
189137 by: Gabriel Belingueres
189139 by: Lukasz Lenart
Re: issue with ajax submit
189138 by: matthieu martin
need some help regarding Display List and Update In Struts2
189140 by: hisameer
189141 by: Gabriel Belingueres
189145 by: Lukasz Lenart
Dojo javascript errors with ajax theme. please help
189142 by: Pranav
[S2] Unable to access passed parameters in an included file
189143 by: Becky.L.O'Sullivan.mhn.com
189144 by: Dave Newton
189150 by: Pawe³ Wielgus
Re: disabling textfield....problem
189146 by: Narayana S
Setters not working
189147 by: Mendrik.gmx.de
189148 by: Lukasz Lenart
189151 by: Mendrik.gmx.de
189152 by: Mendrik.gmx.de
@Conversion on method of the previous Action field
189149 by: holod
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_189127.ezm (zipped)Hello,
I made a page to update persons(firstname, lastname,...).
What I do is fill a form with the help of ${person.firstname},
${person.lastname},...
The problem I am having is when I submit and validation fails, my fields
(firstname, lastname,...) are being reset, but not to the data the user
entered, but the results of ${person.firstname}, ${person.lastname},...
I am using struts 1.3.8 and a dynavalidatorform,
Anyone knows how to solve this ?

Attachment:
user_189128.ezm (zipped)Thanks for your response,
I think, even with an ajax approach, concurrent requests for same action
would result in unexpected output as these actions are stored by same action
name at background. So in fact this is not a presentation constraint but a
processing constraint. We can neither prevent concurrent submits nor make
them wait for another to finish. They need to work parallelly. So i think
what we need here is a way to store background threads separately possibly
on per-request basis instead of per-session basis?
Thanks.
2008/7/21 Jeromy Evans jeromy.evans@(protected):
>
>
> This is a good candidate for making asynchronous requests via an ajax
> framework. I would drop the frameset and replace it with a few s:div's
> tiggered by s:submit's from the ajax theme. That's much easier than what
> you're attempting and is what those tags are intended for.
>
> Just my 2c.
>
> regards
> Jeromy Evans
>
>

Attachment:
user_189130.ezm (zipped)Burak Doğruöz wrote:
> Thanks for your response,
>
> I think, even with an ajax approach, concurrent requests for same action
> would result in unexpected output as these actions are stored by same action
> name at background. So in fact this is not a presentation constraint but a
> processing constraint. We can neither prevent concurrent submits nor make
> them wait for another to finish. They need to work parallelly. So i think
> what we need here is a way to store background threads separately possibly
> on per-request basis instead of per-session basis?
>
> Thanks.
>
No, all S2 action invocations are in a separate thread (one thread per
request).
Only the ExecAndWaitInterceptor applies constraints because of the way
it waits for a response.

Attachment:
user_189131.ezm (zipped)--- On Mon, 7/21/08, Burak Doğruöz wrote:
> I think, even with an ajax approach, concurrent requests
> for same action would result in unexpected output as these
> actions are stored by same action name at background.
Each request would get its own action instance. The DOM element being updated is defined in the tag; if they're different there shouldn't be any issues.
Dave

Attachment:
user_189132.ezm (zipped)So, how to override this ExecAndWiatInterceptor behaviour? Is it possible to
map by some key other than action name?
If we use wildcards while defining action mapping, can we bypass this
constraint? This way we can call myAction1, myAction2 and myActionRandomN
which trigger myAction.action. Does ExecAndWaitInterceptor store and return
these separately?
Thanks.
2008/7/21 Jeromy Evans
> No, all S2 action invocations are in a separate thread (one thread per
> request).
>
> Only the ExecAndWaitInterceptor applies constraints because of the way it
> waits for a response.
>
>

Attachment:
user_189134.ezm (zipped)The constraint here is about ExecAndWaitInterceptor storing and returning
multiple copies of one certain action. This constraint is already in the
documentation. We are looking for a turn around.
For example if we open 2 browsers (which share the same session) and call
same action (which has ExecAndWaitInterceptor) with different parameters,
there may be no certain result that which browser will show which request.
Thanks
2008/7/21 Dave Newton <newton.dave@(protected)>:
> --- On Mon, 7/21/08, Burak Doğruöz wrote:
> > I think, even with an ajax approach, concurrent requests
> > for same action would result in unexpected output as these
> > actions are stored by same action name at background.
>
> Each request would get its own action instance. The DOM element being
> updated is defined in the tag; if they're different there shouldn't be any
> issues.
>
> Dave
>
>
>

Attachment:
user_189135.ezm (zipped)--- On Mon, 7/21/08, Burak Doğruöz wrote:
> The constraint here is about ExecAndWaitInterceptor storing
> and returning multiple copies of one certain action. This
> constraint is already in the documentation. We are looking
> for a turn around.
I was referring to the better solution, Jeremy's Ajax idea.
> there may be no certain result that which browser will show
> which request.
It may be enough to subclass the interceptor and override getBackgroundProcessName(...) (like to use a request parameter to help form the session key, etc.) but I haven't tried this.
Dave

Attachment:
user_189136.ezm (zipped)I don't think that it can be done with an ajax approach. With ajax or not,
concurrent requests for the same action name returns first action's result.
I tried this simple scenario with an action which outputs its query
parameter. I also added a thread.sleep in execute method to gain extra time
to call the same action more than once.
When i triggered the same action with different parameters in 2 separate
browsers, first one redirected to the wait page as expected. At that point i
triggered the second copy. When they both returned from wait page, both
output were first action's parameter.
I think ajax/div approach would show the same behaviour with the above.
However, the wildcard action mapping seems to separate the wait and returns.
when i mapped the action name like myaction* and called myaction1 and
myaction2 at the same time like before, they seem to return with their
respective results. i guess, this can also be used to separate the key.
Thanks for responses.
2008/7/21 Dave Newton <newton.dave@(protected)>:
> --- On Mon, 7/21/08, Burak Doğruöz wrote:
> > The constraint here is about ExecAndWaitInterceptor storing
> > and returning multiple copies of one certain action. This
> > constraint is already in the documentation. We are looking
> > for a turn around.
>
> I was referring to the better solution, Jeremy's Ajax idea.
>
> > there may be no certain result that which browser will show
> > which request.
>
> It may be enough to subclass the interceptor and override
> getBackgroundProcessName(...) (like to use a request parameter to help form
> the session key, etc.) but I haven't tried this.
>
> Dave
>

Attachment:
user_189129.ezm (zipped)On Sat, Jul 19, 2008 at 9:52 PM, Paul Benedict <pbenedict@(protected)>
wrote:
> Using Struts 2.0.x, is it possible to have multiple unknown handlers?
I am
> using the Codebehind plugin and want to extend it.
On Sat, Jul 19, 2008 at 11:41 PM, Musachy Barroso <musachy@(protected)>
wrote:
> You will need this patch: http://jira.opensymphony.com/browse/XW-640
I wanted to do a similar thing, but Paul brings up a good point. To
extend the Codebehind plugin, it would need to be on the classpath, but
if it's on the classpath, Struts 2 will pick it up as a plugin.
Unfortunately, defining a new unknown handler in struts.xml won't
override what's set by the plugin. The new patch (presumably due in
Struts 2.2?) seems like a nice long term fix though.
A temporary (and very hacky) solution that I can think of is to remove
the struts-plugin.xml file from struts2-codebehind-plugin.jar
This is pretty nasty, but it's probably better than running with a
patched xwork.
Brad Cupit
Louisiana State University - UIS

Attachment:
user_189133.ezm (zipped)Lukasz Lenart escribió:
>> public class MostrarUsuarioAction extends Action {
>>
>
> You have to override execute() method not implement your own method,
> Struts1 will not use it. The deafult implementation just return null,
> so it means, stop processing.
> Change your method name mostrarUsuario() to execute() and should be ok.
>
> If you want to use different methods name's extends DispatchAction and
> add parameter attribute to your config.
>
>
> Regards
>
Thanks for your answer. I have implemented DispatchAction method and it
works fine. As this is my first "big" project in Struts, didn´t know
about these "little details".
One more thing I have learnt ;-)
Best Regards !

Attachment:
user_189137.ezm (zipped)Hi, I'm using Struts 2.1.2:
I have a validation file like this:
<field name="codigoValidacion">
<!--
<field-validator type="conversion" short-circuit="true">
<message key="invalid.fieldvalue.codigoValidacion" />
</field-validator>
-->
<field-validator type="required" short-circuit="true">
<message>El código de validación es requerido</message>
</field-validator>
<field-validator type="int">
<param name="min">1</param>
<message>El código de validación debe ser un número positivo</message>
</field-validator>
</field>
codigoValidacion is an Integer property of the action.
I also have a messages.properties file like with this line:
invalid.fieldvalue.codigoValidacion=El código de validación debe ser un número
The problem is that when there is a conversion error (for example, the
input parameter is the string "x"), there are two error messages on
the input field, and I only want one message.
The current configuration prints:
o El código de validación debe ser un número (fails conversion)
o El código de validación es requerido (fails required validator)
that is, the conversion error is not "short circuited" and the
validations are executed anyway.
If I uncomment the conversion validator above it prints:
o El código de validación debe ser un número (fails conversion)
o El código de validación debe ser un número (fails conversion validator)
I just want to output only the first error line when a conversion error happens.
Is there any way to configure that I can do just that?
IIUC, the ParameterInterceptor javadocs [1] say that the flag
XWorkConverter.REPORT_CONVERSION_ERRORS can be used to not reporting
parameter conversion errors, but setting it in the struts.xml file
like a constant won't work:
<constant name="report.conversion.errors" value="false"/>
though I feel rather unconfortable to disabling this since it force me
to provide conversion validators everywhere anyway.
Also the online guide [2] says:"By default, the conversion interceptor
is included in struts-default.xml in the default stack. To keep
conversion errors from reporting globally, change the interceptor
stack, and add additional validation rules."
Does this means eliminating the "conversionError" interceptor from the
default stack?
Regards,
Gabriel
[1] http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html
[2] http://struts.apache.org/2.1.2/docs/type-conversion.html

Attachment:
user_189139.ezm (zipped)> Does this means eliminating the "conversionError" interceptor from the
> default stack?
Yes ;-)
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_189138.ezm (zipped)2008/7/21 Jeromy Evans <jeromy.evans@(protected)>:
> matthieu martin wrote:
>
>> Hello all.
>>
>> I can't figure out what this message means, or even where does it come
>> from.
>> I have no way to know which request returns this to me ... I'm lost.
>>
>> Is anyone able to help me ?
>>
>>
>
> Dojo uses a technique called IFrame I/O when uploading a file
> asynchronously. Looks to me like you're seeing the response that belongs in
> the hidden iframe. IIRC you'll need to write some javascript to setup Dojo
> for file async uploads. You'll find several old posts here about that. (I
> don't use it myself).
>
> Hi Jeromy,
Thanks a lot for that answer, but how do I get old posts ?
Anyway, with that piece of information I have new stuff to search for,
thanks a lot !
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189140.ezm (zipped)
Hi everyone
I was just going through the nabble.com and I found very nice help about
struts2. Now I need some more help about it. I hope somebody is kind enough
to help me.
My problem is that I have to display all the users from the database and all
the information related to the user(firstName,LastName,EmailAddress,Phone
etc.) in a JSP page one by one by using struts2.
and for each and every user in the list there should be a update and delete
link. If there is no user then nothing should show up. I really don't know
how this should work in the jsp page using struts2. I have got the list in
Action Class of it and the list has name userList which is of type user
object which has all the fields in it.
I don't know how I can display the list into the jsp page. If somebody has
done this already can you please send me the sample code to my email id:
cool_sameer_for_u@(protected)
Also how would I know about which user I want to delete or update,whenever
the user clicks on any one of the link.
Please help me. I need to finish it as soon as I can!:,(
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_189141.ezm (zipped)I recommend using displaytag [1] for showing the user list.
How to know which user you want to delete/update? You need to add a
parameter to the delete/update action URL to identify the specific
user, usually the user's primary key or if your user list is stored in
session scope you could use the index that the user is in that list.
See the <s:url> tag [2] to learn how to build that URL.
[1] http://displaytag.sourceforge.net
[2] http://struts.apache.org/2.1.2/docs/url.html
2008/7/21 hisameer <cool_sameer_for_u@(protected)>:
>
> Hi everyone
>
> I was just going through the nabble.com and I found very nice help about
> struts2. Now I need some more help about it. I hope somebody is kind enough
> to help me.
>
> My problem is that I have to display all the users from the database and all
> the information related to the user(firstName,LastName,EmailAddress,Phone
> etc.) in a JSP page one by one by using struts2.
> and for each and every user in the list there should be a update and delete
> link. If there is no user then nothing should show up. I really don't know
> how this should work in the jsp page using struts2. I have got the list in
> Action Class of it and the list has name userList which is of type user
> object which has all the fields in it.
>
> I don't know how I can display the list into the jsp page. If somebody has
> done this already can you please send me the sample code to my email id:
> cool_sameer_for_u@(protected)
>
> Also how would I know about which user I want to delete or update,whenever
> the user clicks on any one of the link.
>
> Please help me. I need to finish it as soon as I can!:,(
> --
> View this message in context: http://www.nabble.com/need-some-help-regarding-Display-List-and-Update-In-Struts2-tp18579243p18579243.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189145.ezm (zipped) <table>
<tr>
<td><s:text name="label.user.id"/></td>
<td><s:text name="label.user.login"/></td>
<td><s:text name="label.user.firstname"/></td>
<td><s:text name="label.user.lastname"/></td>
</tr>
<s:iterator value="userList" var="user">
<s:url var="editUrl" action="edit">
<s:param name="userId" value="id"/>
</s:url>
<tr>
<td><s:a href="%{editUrl}"><s:property
value="id"/></s:a></td>
<td><s:property value="logon"/></td>
<td><s:property value="firstName"/></td>
<td><s:property value="lastName"/></td>
</tr>
</s:iterator>
</table>
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_189142.ezm (zipped)Hi,
I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
Example are:
../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
../struts/dojo/src/widget/nls/en/TimePicker.js
../struts/dojo/src/widget/nls/en-us/TimePicker.js
../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
Thanks
Pranav

Attachment:
user_189143.ezm (zipped)Hi everyone,
I'm using <s:include> to include a page fragment in Struts 2.1.2.
(also tried with <jsp:include> and the result did not change)
Ensuring the values are passed as Strings using OGNL syntax:
<s:include value="/support/templates/header.jsp">
<s:param name="pageTitle" value="%{'Portal Administration'}" />
<s:param name="nav1" value="%{'portalAdmin'}" />
<s:param name="nav2" value="%{''}" />
</s:include>
I know nav1 makes it into header.jsp as a request parameter because this
snippet yields "nav1 = portalAdmin" (among other things)
<%
java.util.Enumeration e = request.getParameterNames();
while (e.hasMoreElements())
{
String name = (String) e.nextElement();
out.write(" " + name + " = " + request.getParameter(name) +
"<br />");
}
%>
(BTW, I tried removing %{''} from the <s:param> tag and nav1 was null)
In header.jsp I tried getting the value of nav1 using several different
OGNL mechanisms:
Nav 1a: <s:property value="#attr.nav1"/><br />
Nav 1b: <s:property value="%{#attr.nav1}"/><br />
Nav 1c: <s:property value="#attr['nav1']"/><br />
Nav 1d: <s:property value="%{#attr['nav1']}"/><br />
Nav 2a: <s:property value="#parameters.nav1"/><br />
Nav 2b: <s:property value="%{#parameters.nav1}"/><br />
Nav 2c: <s:property value="#parameters['nav1']"/><br />
Nav 2d: <s:property value="%{#parameters['nav1']}"/><br />
In theory all of the above should work because nav1 is a request parameter
and attr looks to request scope after page scope.
However, none of the above tags display the value of nav1.
Of course if I can't even get the value of that parameter my <s:if> logic
won't work.
Feels like I missed something obvious....
---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.
---------------------------------------------------------------------

Attachment:
user_189144.ezm (zipped)--- On Mon, 7/21/08, <Becky.L.O'Sullivan@(protected):
> Feels like I missed something obvious....
The note on [1] where it says that params aren't available on the stack, I think.
I don't recall the reason at the moment, though.
Dave
[1] http://struts.apache.org/2.x/docs/include.html

Attachment:
user_189150.ezm (zipped)Hi ,
maybe try to use tiles for this kind of job.
Did work for me.
Best greetings,
Paweł Wielgus.
On 22/07/2008, Dave Newton <newton.dave@(protected):
> --- On Mon, 7/21/08, <Becky.L.O'Sullivan@(protected):
> > Feels like I missed something obvious....
>
>
> The note on [1] where it says that params aren't available on the stack, I think.
>
> I don't recall the reason at the moment, though.
>
> Dave
>
> [1] http://struts.apache.org/2.x/docs/include.html
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189146.ezm (zipped)Thanks Jishnu,
i applies ReadOnly , is working fine.
Thanks a lot.
On Mon, Jul 21, 2008 at 4:46 PM, Jishnu Viswanath <
jishnu.viswanath@(protected):
> If you still want to send the data, make it read only
>
> Regards,
>
> Jishnu Viswanath
>
> Software Engineer
>
> *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll
>
> Tavant Technologies Inc.,
>
> www.tavant.com
>
> PEOPLE :: PASSION :: EXCELLENCE
>
> -----Original Message-----
> From: ManiKanta G [mailto:manikanta.gade@(protected)]
> Sent: Monday, July 21, 2008 2:42 PM
> To: Struts Users Mailing List
> Subject: Re: disabling textfield....problem
>
> According to html, browser will not send the disabled fields to the
> server along with the request headers. So you've to send that value in
> the form of a hidden value.
>
> Regards,
> ManiKanta
>
>
> Narayana S wrote:
> > Hi,
> >
> > i have a text field, with disabled property set to TRUE, and when
> i
> > coming back to the same page with some error messages for the other
> fields,
> > it is missing the textfield value, it is not retaining like the
> non-disabled
> > fields....
> >
> > where i am missing?
> >
> > plz help me..
> >
> >
>
>
>
>
> ********** DISCLAIMER **********
> Information contained and transmitted by this E-MAIL is proprietary to
> Sify Limited and is intended for use only by the individual or entity to
>
> which it is addressed, and may contain information that is privileged,
> confidential or exempt from disclosure under applicable law. If this is
> a
> forwarded message, the content of this E-MAIL may not have been sent
> with
> the authority of the Company. If you are not the intended recipient, an
> agent of the intended recipient or a person responsible for delivering
> the
> information to the named recipient, you are notified that any use,
> distribution, transmission, printing, copying or dissemination of this
> information in any way or in any manner is strictly prohibited. If you
> have
> received this communication in error, please delete this mail & notify
> us
> immediately at admin@(protected)
> Any comments or statements made in this email are not necessarily those of
> Tavant Technologies.
> The information transmitted is intended only for the person or entity to
> which it is addressed and may
> contain confidential and/or privileged material. If you have received this
> in error, please contact the
> sender and delete the material from any computer. All e-mails sent from or
> to Tavant Technologies
> may be subject to our monitoring procedures.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_189147.ezm (zipped)Hi,
I've set up tomcat 6 with spring 2.5.5, struts 2.0.11 and openJPA. I successfully load the struts spring plugin according to the logs, but for some reasons the setters in my Action classes are all broken.
Basically neither beans get injected nor posted paramaters, nor additional params set through struts.xml.
ParametersInterceptor complains about an unexpected exception, the struts.xml parameter complains about setter cannot be found (but it is there, no typos or anything like that) and all my to-be-injected beans are null.
I was wondering if someone else experienced something similar. I suspect it might be related to loadtimeweaving and proxying for one, but other than that I'm really clueless.
For testing I have a small bean saving an object into the database...which works and tells me that my transaction configuration and jpa enhancing is working prroperly.
But I can't get the struts actions to work.
Any ideas would be highly appreciated,
Andreas
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@(protected)

Attachment:
user_189148.ezm (zipped)Hi,
Could you paste here some examples of your code and config?
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_189151.ezm (zipped)I copied the most relevant pieces into the attached file.
Thanks for your time,
Andreas!
-------- Original-Nachricht --------
> Datum: Tue, 22 Jul 2008 09:26:36 +0200
> Von: "Lukasz Lenart" <lukasz.lenart@(protected)>
> An: "Struts Users Mailing List" <user@(protected)>
> Betreff: Re: Setters not working
> Hi,
>
> Could you paste here some examples of your code and config?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
Relevant spring config:
<tx:annotation-driven transaction-manager="transactionManager" order="10" proxy-target-class="true"/>
<bean id="transactionManager" class="
org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
<property name="dataSource" ref="defaultDataSource"/>
<property name="jpaDialect" ref="jpaDialect"/>
</bean>
<bean id="jpaDialect" class="
org.springframework.orm.jpa.vendor.OpenJpaDialect"/>
<bean id="userService" class="com.gulon.backend.service.UserServiceImpl"/>
<bean class="
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
<bean id="defaultDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="
com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://${database.host}:${database.port}/${database.name}"/>
<property name="properties">
<props>
<prop key="c3p0.acquire_increment">5</prop>
<prop key="c3p0.idle_test_period">100</prop>
<prop key="c3p0.max_size">100</prop>
<prop key="c3p0.max_statements">0</prop>
<prop key="c3p0.min_size">10</prop>
<prop key="user">${database.user}</prop>
<prop key="password">${database.password}</prop>
</props>
</property>
</bean>
<bean id="entityManagerFactory" class="
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="defaultDataSource"/>
<property name="persistenceUnitName" value="gulonPersistence"/>
<property name="jpaVendorAdapter">
<bean class="
org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
<property name="database" value="MYSQL"/>
<property name="showSql" value="true"/>
</bean>
</property>
<property name="jpaPropertyMap">
<map>
<entry key="openjpa.Log" value="DefaultLevel=WARN, Runtime=ERROR, SQL=INFO"/>
</map>
</property>
</bean>
Deployment context:
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Loader loaderClass="
org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"
useSystemClassLoaderAsParent="false"/>
</Context>
Struts.xml:
<struts>
<constant name="struts.locale" value="en_GB"/>
<constant name="struts.custom.i18n.resources" value="messages"/>
<package name="gulon" extends="struts-default">
<result-types>
<result-type name="json" class="com.googlecode.jsonplugin.JSONResult"/>
</result-types>
<default-interceptor-ref name="defaultStack"/>
<global-results>
<result name="error" type="json">
<param name="root">commands</param>
</result>
<result name="input" type="json">
<param name="root">commands</param>
</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="com.gulon.commons.exception.GulonException" result="error"/>
<exception-mapping exception="
com.opensymphony.xwork2.validator.ValidationException" result="input"/>
</global-exception-mappings>
[...]
<action name="storeRegister" class="com.gulon.frontend.web.actions.user.RegisterAction">
<param name="successUrl">welcome.action</param>
<result name="success" type="json">
<param name="root">commands</param>
</result>
</action>
</package>
</struts>
registerAction:
@Validation
public class RegisterAction extends GenericAction {
static Logger LOG = Logger.getLogger(RegisterAction.class);
private String login;
private String password1;
private String password2;
private String email;
private String successUrl;
private UserService userService;
public String getSuccessUrl() {
return successUrl;
}
public void setSuccessUrl(String successUrl) {
this.successUrl = successUrl;
}
@Transactional
public String execute() throws Exception {
User user = new User();
user.setLogin(login);
user.setLastLogin(new Timestamp(new Date().getTime()));
user.setEmail(email);
userService.setPassword(user, password1);
userService.store(user);
if (hasErrors()) {
add(new Errors());
} else {
add(new PageLoad(successUrl));
}
add(new PageLoad(successUrl));
return SUCCESS;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword1() {
return password1;
}
public void setPassword1(String password1) {
this.password1 = password1;
}
public String getPassword2() {
return password2;
}
public void setPassword2(String password2) {
this.password2 = password2;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
}
Runtime libs (spring-tomcat-weaver.jar is in tomcat 6/lib, no javaagent used):
25/03/2008 13:40 4,467 aopalliance-1.0.jar
17/07/2008 08:48 114,916 aspectjrt-1.6.0.jar
17/07/2008 08:48 1,907,848 aspectjweaver-1.6.0.jar
18/07/2008 09:51 20,851 backend-0.0.1-SNAPSHOT.jar
17/07/2008 08:49 610,790 c3p0-0.9.1.2.jar
17/07/2008 08:49 324,238 cglib-nodep-2.1_3.jar
18/07/2008 09:51 5,146 commons-0.0.1-SNAPSHOT.jar
17/07/2008 08:48 46,725 commons-codec-1.3.jar
25/03/2008 11:34 571,259 commons-collections-3.2.jar
17/07/2008 08:49 57,779 commons-fileupload-1.2.1.jar
17/07/2008 08:50 87,776 commons-io-1.3.2.jar
17/07/2008 08:48 261,809 commons-lang-2.4.jar
26/03/2008 17:39 38,015 commons-logging-1.0.4.jar
17/07/2008 08:48 106,911 commons-modeler-2.0.jar
17/07/2008 08:49 62,086 commons-pool-1.3.jar
18/07/2008 09:51 15,807 domainmodel.jar
17/07/2008 08:49 863,477 freemarker-2.3.12.jar
17/07/2008 08:49 31,397 geronimo-jms_1.1_spec-1.0.1.jar
17/07/2008 08:49 52,555 geronimo-jpa_3.0_spec-1.0.jar
17/07/2008 08:49 15,649 geronimo-jta_1.1_spec-1.1.jar
17/07/2008 08:50 38,380 jsonplugin-0.26.jar
17/07/2008 08:50 20,682 jstl-1.1.2.jar
25/03/2008 11:38 121,070 junit-3.8.1.jar
26/03/2008 17:38 367,444 log4j-1.2.14.jar
17/07/2008 08:48 261,174 mx4j-jmx-2.1.1.jar
26/03/2008 17:38 495,944 mysql-connector-java-5.0.4.jar
26/03/2008 17:39 168,081 ognl-2.6.11.jar
17/07/2008 08:49 2,982,446 openjpa-1.1.0.jar
26/03/2008 17:38 52,150 persistence-api-1.0.jar
17/07/2008 08:49 205,877 serp-1.13.1.jar
17/07/2008 08:48 326,477 spring-aop-2.5.5.jar
17/07/2008 08:48 20,530 spring-aspects-2.5.5.jar
17/07/2008 08:48 486,031 spring-beans-2.5.5.jar
17/07/2008 08:48 473,513 spring-context-2.5.5.jar
17/07/2008 08:48 287,235 spring-core-2.5.5.jar
17/07/2008 08:48 130,199 spring-dao-2.0.8.jar
17/07/2008 08:48 226,885 spring-jdbc-2.0.8.jar
17/07/2008 08:48 98,359 spring-jpa-2.0.8.jar
17/07/2008 08:48 374,339 spring-orm-2.5.5.jar
17/07/2008 08:48 67,448 spring-security-acl-2.0.1.jar
17/07/2008 08:48 749,655 spring-security-core-2.0.1.jar
17/07/2008 08:48 19,501 spring-security-taglibs-2.0.1.jar
17/07/2008 08:48 117,045 spring-support-2.0.8.jar
17/07/2008 08:48 231,371 spring-tx-2.5.5.jar
17/07/2008 08:48 193,662 spring-web-2.5.5.jar
17/07/2008 08:50 393,259 standard-1.1.2.jar
17/07/2008 08:49 713,305 struts2-core-2.1.2.jar
17/07/2008 08:50 9,432 struts2-spring-plugin-2.1.2.jar
17/07/2008 08:49 521,827 xwork-2.1.1.jar

Attachment:
user_189152.ezm (zipped)Also wanted to add, that my action gets properly called (execute()). but my debugger shows me none of the setter methods is ever called, which results than in a NPE on the userService.
See file.
-------- Original-Nachricht --------
> Datum: Tue, 22 Jul 2008 09:26:36 +0200
> Von: "Lukasz Lenart" <lukasz.lenart@(protected)>
> An: "Struts Users Mailing List" <user@(protected)>
> Betreff: Re: Setters not working
> Hi,
>
> Could you paste here some examples of your code and config?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Attachment:
user_189149.ezm (zipped)
I have a question, please see code of my action:
public class PrepareLawDraftAction extends ActionSupport{
private LawDraft lawDraft; //has method getDateIntro(), which returns Date
private Date loadDate;
public String execute(){
//...
}
@TypeConversion(converter = "struts2.action.admin.converter.DateConverter")
//coverter presents date as dd.MM.yyyy
public Date getLoadDate() {
return loadDate;
}
}
and my jsp code, which goes after described action?
<s:textfield name="loadDate" label="date of loading" disabled="true"
size="10"/>
<s:datetimepicker label="Date of introduction" name="dateIntro"
displayFormat="dd.MM.yyyy" value="%{lawDraft.dateIntro}" toggleType="fade"
language="RU"/>
And the question:
conversion on loadDate works fine, my jsp is rendered with appropriate
format of date, but how can I apply format to getter getDateIntro of
lawDraft?
I don't want to spread conversion in my project. As i undersand, i can apply
annotation on the getter getDateIntro() of class LawDraft.
But my LawDraft class belongs to EBJ module, and I don't want spread STRUTS2
logic on my business-logic module, it is bad design. That's not right. How
can I overcome this difficulty?
--
Sent from the Struts - User mailing list archive at Nabble.com.