Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 25 Jul 2008 11:19:04 -0000 Issue 8161

user-digest-help

2008-07-25


Author LoginPost Reply

user Digest 25 Jul 2008 11:19:04 -0000 Issue 8161

Topics (messages 189306 through 189311):

Re: Nothing helps
 189306 by: Lukasz Lenart
 189309 by: Jishnu Viswanath

Re: struts2 validation, tiles definition in input result type, problem!
 189307 by: Halil Aðýn
 189308 by: Lukasz Lenart

something I don't get with i18n in Struts2
 189310 by: mague
 189311 by: Pawe³ Wielgus

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_189306.ezm (zipped)
2008/7/25 holod <serega.sheypak@(protected)>:
>
> attribute "var" doesn't exist in my struts-tags.tld. I'm using the last one
> struts2 pack.

"var" attribute is used as from S2.1 and above which was not released
yet (2.1.2 is beta), the latest release is 2.0.11.2, which version do
you have?

> <s:iterator value="lawDraft.docs" status="document" id="doc">
> </s:property value ="title">
> </s:iterator>

try </s:property value ="doc.title">


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189309.ezm (zipped)
1.If var does not exist u are using struts 2.0.x not 2.1.x

2. Try doing something like this so this
<s:iterator value="lawDraft.docs>
<div>one</div>
</s:iterator>
If one prints atleast one time then you have lawDraft.docs exists as a
List

3.
Say u have a classes

Class LawDraftAction{

LawDraft lawDraft;
//Getter setters
}



Class LawDraft{

List<Document> docs;
//Getter Setter
}

Class Document{

String title;
//Getter Setter again :P
}

Then in jsp you can write

<s:iterator value="lawDraft.docs>
 Document Title: <s:property value="title"/>

</s:iterator>


Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: holod [mailto:serega.sheypak@(protected)]
Sent: Friday, July 25, 2008 2:06 PM
To: user@(protected)
Subject: Nothing helps


attribute "var" doesn't exist in my struts-tags.tld. I'm using the last
one
struts2 pack.

lawDraft.docs returns List with 5 elements.
Simple printing </s:property value="lawDraft.docs"> shows 5 elements

I've tried to invoke method "getTitle()" of class Document which
instances
are in ArrayList:
1.
<s:iterator value="lawDraft.docs" status="document" id="doc">
</s:property value ="title">
</s:iterator>
Nothing, empty string

2.
<s:iterator value="lawDraft.docs" status="document" id="doc">
</s:property value ="%{#doc.title}">
</s:iterator>
Nothing, empty string

Previous actions prints to log fields of objects kept in
Lawdraft.getDocs()
I know, that title is not null or empty.

Can you suggest me something else?
--
http://www.nabble.com/Problem-accessing-iterated-object-%28%3Cs%3Aiterat
or%29-tp18614028p18647504.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)

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.


Attachment: user_189307.ezm (zipped)
Sorry i amde a typo in the previous mail,

ProjectStatus-validation,xml should be replaced with
ProjectStatusAction-validation,xml

2008/7/25 Halil Ağın <halil.agin@(protected)>:

> Hello Dave;
>
> Yes you are right, There is no "ProjectStatus" action defined.
> Now, i change the form action definition to
>
> <s:form action="ProjectStatus_showAddPage"
> ..
>
> and it is ok. validation works, but there is still a problem,
>
> When i request the
> http://localhost:8080/TVQ/ProjectStatus_showAddPage.action (showAddPage
> function is defined in ProjectStatus action class)
>
> it shows the AddPage.jsp (which is expected), but it shows all the
> validation messages at first page load which is not expected.
>
> The correct scenario is that it should show the validation messages after i
> press the add button.
>
>
> Here is my jsp content and struts.xml content, respectively (I do not
> include tiles definition, they works, morover, they are not needed to
> analyze this problem, i think :) )
>
> There is also a validation file named ProjectStatus-validation,xml in the
> directory where ProjectStatusAction.java resides in.
>
> ===========start:AddPage.jsp=============
> <s:form action="ProjectStatus_showAddPage" validate="true"    >
>
> <s:fielderror />
>
> <jsp:include page="AddUpdateTemplate.jsp"/>
> <br/>
>
> <table>
> <tr><td colspan="2"><s:submit  method="add" value="Add" /></td></tr>
> </table>
>
> </s:form>
>
> ===========end :AddPage    =============
>
>
>
> ===========start:struts.xml=============
>    <action name="ProjectStatus_*"
>
> class="tr.com.portakalteknoloji.action.projectstatus.ProjectStatusAction"
>         method="{1}" >
>
>         <result name="{1}" type="tiles" >tvq.projectstatus.{1}</result>
>         <result name="input" type="tiles"
> >tvq.projectstatus.{1}</result>
>         <result name="ADDSUCCEED"
> type="redirect">/ProjectStatus_list.action</result>
>
>      </action>
> ===========end :struts.xml =============
>
>
>
>
>
>
> Regards,
>
>
> -Halil AGIN
>
>
>
> On Thu, Jul 24, 2008 at 6:22 PM, Dave Newton <newton.dave@(protected)>
> wrote:
>
>> Your action is submitting to "ProjectStatus"; is that action defined?
>>
>> Dave
>>
>>
>> --- On Thu, 7/24/08, Halil Ağın <halil.agin@(protected):
>>
>> > From: Halil Ağın <halil.agin@(protected)>
>> > Subject: struts2 validation, tiles definition in input result type,
>> problem!
>> > To: user@(protected)
>> > Date: Thursday, July 24, 2008, 10:58 AM
>> > Hello List;
>> >
>> > I am trying to implement validation in struts2.
>> >
>> > My action is as follow:
>> >
>> > <action name="ProjectStatus_*"
>> >
>> >
>> class="tr.com.portakalteknoloji.action.projectstatus.ProjectStatusAction"
>> >         method="{1}" >
>> >
>> >         <result name="{1}"
>> > type="tiles"
>> > >tvq.projectstatus.{1}</result>
>> >         <result name="input"
>> > type="tiles"
>> > >tvq.projectstatus.{1}</result>
>> >         <result name="error"
>> > type="tiles">tvq.projectstatus.{1}</result>
>> >
>> >         <result name="ADDSUCCEED"
>> > type="redirect">/ProjectStatus_list.action</result>
>> >      </action>
>> >
>> >
>> >
>> > Since when validation process returns false, i want struts
>> > to show the same
>> > page. I search the web, and saw some solution like above.
>> > But, when i try to
>> > implement, i could not succeed.
>> >
>> > Here are my tiles definitions:
>> >
>> > <definition
>> > name="tvq.projectstatus.showAddPage"
>> > extends="tvq.template.default">
>> >      <put-attribute name="title"
>> > value="Add A Project Status" />
>> >      <put-attribute name="content"
>> > value="/jsp/projectstatus/AddPage.jsp"
>> > />
>> >   </definition>
>> >
>> >   <definition
>> > name="tvq.projectstatus.ListPage"
>> > extends="tvq.template.default">
>> >      <put-attribute name="title"
>> > value="Add A Project Status" />
>> >      <put-attribute name="content"
>> > value="/jsp/projectstatus/ListPage.jsp" />
>> >   </definition>
>> >
>> >   <definition name="tvq.projectstatus.list"
>> > extends="tvq.template.default">
>> >      <put-attribute name="title"
>> > value="Add A Project Status" />
>> >      <put-attribute name="content"
>> > value="/jsp/projectstatus/ListPage.jsp" />
>> >   </definition>
>> >
>> >
>> >
>> > I call the page ass follows :
>> > http://localhost:8080/TVQ/ProjectStatus_showAddPage.action
>> >
>> > (the ProjectStatusAction.java has showAddPage, list, and
>> > add functions and
>> > these functions returns the correct strings.)
>> >
>> >
>> > Then, struts looks the action definition and it finds
>> > showAddPage function
>> > in ProjectStatus.
>> >
>> > In result list, there is tvq.projectstatus.showAddPage, and
>> > i have this
>> > definition in my tiles.xml.
>> >
>> > Therefore, it shows the page. The problem occures after i
>> > press the add
>> > button in tvq.projectstatus.showAddPage.
>> >
>> > here is the content of the
>> > tvq.projectstatus.showAddPage(meanly,/jsp/projectstatus/AddPage.jsp)
>> >
>> >
>> >
>> >
>> > <s:form action="ProjectStatus"
>> > validate="true"    >
>> >
>> > <s:fielderror />
>> >
>> > <jsp:include page="AddUpdateTemplate.jsp"/>
>> > <br/>
>> >
>> > <table>
>> > <tr><td colspan="2"><s:submit
>> > method="add" value="Add"
>> > /></td></tr>
>> > </table>
>> >
>> > </s:form>
>> >
>> >
>> >
>> >
>> > And i have a required field validator on a field in my
>> > form(this field is
>> > listed in AddUpdateTemplate.jsp)
>> >
>> >
>> > ProjectStatus action has add function which returns the
>> > "ADDSUCCEED" string
>> > on success.
>> >
>> >
>> > When i press the add button without filling the required
>> > field, there occure
>> > a validation error(which is expected)
>> >
>> > At this level, i expect struts that it enters the input
>> > result which is
>> > defined in my action as a result.
>> >
>> > Here is the result definition.
>> >
>> > <result name="input" type="tiles"
>> > >tvq.projectstatus.{1}</result>
>> >
>> >
>> > I expect the struts to enter in input result, and it does.
>> > but it cannot
>> > produces the tiles definition, it leaves {1} as empty and
>> > produce
>> > "tvq.projectstatus." unlike
>> > "tvq.projectstatus.showAddPage".
>> >
>> > What is the problem, i know i am doing something wrong, i
>> > read the book
>> > "struts2 in action", and searched the web, but
>> > could not find such an
>> > example. Meanly, i am using method action, tiles and
>> > validation together, i
>> > could not find such an example.
>> >
>> >
>> > Please help me,
>> >
>> >
>> > Thanks in advance,
>> >
>> >
>> > -Halil Agin
>> >
>> >
>> > the stack trace is below (i am using global exception
>> > handler, therefore i
>> > copied the html content and paste it here, you may want the
>> > output of error
>> > console, but please be sure that this is the exact error. i
>> > see this error
>> > in the console too)
>> >
>> >
>> > Error Message
>> >
>> > tvq.projectstatus.
>> > ------------------------------
>> > Technical Details
>> >
>> > org.apache.tiles.definition.NoSuchDefinitionException:
>> > tvq.projectstatus. at
>> >
>> org.apache.tiles.impl.BasicTilesContainer.render (BasicTilesContainer.java:394)
>> > at
>> >
>> org.apache.tiles.impl.BasicTilesContainer.render (BasicTilesContainer.java:370)
>> > at
>> >
>> org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
>> > at
>> >
>> org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:186)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:355)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:259)
>> > at
>> >
>> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java:248)
>> > at
>> >
>> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java:49)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java:124)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:170)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:170)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:104)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:84)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:208)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:88)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:127)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept (ProfilingActivationInterceptor.java:104)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:130)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:143)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:137)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:86)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:130)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:176)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
>> > at
>> >
>> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile (UtilTimerStack.java:456)
>> > at
>> >
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:227)
>> > at
>> >
>> org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
>> > at
>> >
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:477)
>> > at
>> >
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:467)
>> > at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>> > at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>> > at
>> >
>> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>> > at
>> >
>> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
>> > at
>> >
>> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>> > at
>> >
>> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>> > at
>> >
>> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>> > at
>> >
>> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
>> > at
>> >
>> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
>> > at
>> >
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>> > at
>> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> > at java.lang.Thread.run (Thread.java:619)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment: user_189308.ezm (zipped)
Do you use xml based validation? If so, name the xml files correctly
according to the name of actions, read [1], section Defining
Validation Rules

ProjectStatusAction-ProjectStatus_updateAddPage-validation.xml


[1] http://struts.apache.org/2.1.2/docs/validation.html

Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189310.ezm (zipped)

Hello all,

Here is my understanding of internationalization in struts 1 & 2 :

In Struts 1.x, it's possible to use something like <bean:message
bundle="myBundle" key="some.key"/> to specify in which resource bundle
"some.key" is to be found.

As the Walking Tour of the Struts 2 MailReader Application explains, "In
Struts 2, message resources are associated with the Action class being
processed". Therefore, when one uses something like <s:text
name="index.login"/> there is no way (as far as I know) to specify the
bundle. It has to be the bundle associated with the action.

Now, here is my problem: I use Tiles in my application and, for example, I
have a tile for a navigation bar. This navigation bar is present on any page
sent to the brother which means that it is generated after every action. In
Strut1, I have a single resource bundle for the navigation bar, and I can
specify it in the jsp file that define the bar. In Struts2 I can see no
other way than duplicating all the keys related to the menu bar in the
resource bundle of every single action.

Such a duplication cannot the normal way of using a modern framework such as
Struts2. So where am I wrong ? What are the best practices in such a case ?

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


Attachment: user_189311.ezm (zipped)
Hi Jean-Philippe

try this:
http://cwiki.apache.org/WW/internationalization.html

Best greetings,
Paweł Wielgus.


On 25/07/2008, mague <jean.philippe.mague@(protected):
>
> Hello all,
>
> Here is my understanding of internationalization in struts 1 & 2 :
>
> In Struts 1.x, it's possible to use something like <bean:message
> bundle="myBundle" key="some.key"/> to specify in which resource bundle
> "some.key" is to be found.
>
> As the Walking Tour of the Struts 2 MailReader Application explains, "In
> Struts 2, message resources are associated with the Action class being
> processed". Therefore, when one uses something like <s:text
> name="index.login"/> there is no way (as far as I know) to specify the
> bundle. It has to be the bundle associated with the action.
>
> Now, here is my problem: I use Tiles in my application and, for example, I
> have a tile for a navigation bar. This navigation bar is present on any page
> sent to the brother which means that it is generated after every action. In
> Strut1, I have a single resource bundle for the navigation bar, and I can
> specify it in the jsp file that define the bar. In Struts2 I can see no
> other way than duplicating all the keys related to the menu bar in the
> resource bundle of every single action.
>
> Such a duplication cannot the normal way of using a modern framework such as
> Struts2. So where am I wrong ? What are the best practices in such a case ?
>
> Jean-Philippe
>
> --
> View this message in context: http://www.nabble.com/something-I-don%27t-get-with-i18n-in-Struts2-tp18649502p18649502.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)
>
>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.