Author Login
Post Reply
user Digest 15 May 2008 22:09:43 -0000 Issue 8031
Topics (messages 186485 through 186497):
Re: [Struts 2] Pass value between two action classes
186485 by: Milan Milanovic
Struts global-exception and web.xml's error-page
186486 by: Zhang, Larry (L.)
[Struts 2] Video Action
186487 by: Yousri BENDI ABDALLAH
Re: Struts2 Vs ExtJs - support and coexistence?
186488 by: Rafael Antunes
186489 by: Frans Thamura
Re: What is the functionality of struts 2 anchor tag?
186490 by: Laurie Harper
[Struts 2] Simple combobox behaviour
186491 by: Milan Milanovic
186492 by: Felipe Lorenz
186493 by: Milan Milanovic
186494 by: Felipe Lorenz
186495 by: Milan Milanovic
186497 by: Milan Milanovic
Re: Struts 2 - Velocity Templates rendered twice
186496 by: Eric Rank
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_186485.ezm (zipped)Yes, I'm talking about the same action class, but different action methods for both jsp's.
--
Milan
----- Original Message ----
From: Al Sutton <al.sutton@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, May 15, 2008 4:44:52 PM
Subject: Re: [Struts 2] Pass value between two action classes
One class with different action methods is fine, One class with a single
execute method that's recalled is bad.
I think Milan is saying the former, if he is saying the latter then it's not
good due to the extra instructions needed to determine where you're going
from and where you're going to.
Al.
----- Original Message -----
From: "Milan Milanovic" <milanmilanovich@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, May 15, 2008 3:06 PM
Subject: Re: [Struts 2] Pass value between two action classes
Why not ? Different methods are calling different result jsp-s ?
--
Milan
----- Original Message ----
From: Ravichandra C <ravichandrac@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, May 15, 2008 3:52:12 PM
Subject: RE: [Struts 2] Pass value between two action classes
as I see... no!
-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Thursday, May 15, 2008 7:20 PM
To: Struts Users Mailing List
Subject: Re: [Struts 2] Pass value between two action classes
Is a better approach to use one action class with multiple jsp pages ?
--
Thx, Milan
----- Original Message ----
From: Ravichandra C <ravichandrac@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, May 15, 2008 3:44:10 PM
Subject: RE: [Struts 2] Pass value between two action classes
Here we are implementing one action class with multiple methods
providing multiple pages. More like a wizard like functionality....
however I would suggest to break things into multiple actions to the
extent possible. The main disadvantage we our approach was with the
validation layer... all had only one validate method... and we had to go
with interceptors...
-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Thursday, May 15, 2008 7:09 PM
To: Struts Users Mailing List
Subject: Re: [Struts 2] Pass value between two action classes
O.K. Thaks.
But what is general good practice for big forms, two different forms and
actions for
one object like this, or maybe tabbedPanel or something third ? What is
easier to implement
and more efficient ?
--
Thx in advance, Milan Milanovic
----- Original Message ----
From: ravi_eze <ravichandrac@(protected)>
To: user@(protected)
Sent: Thursday, May 15, 2008 7:08:57 AM
Subject: Re: [Struts 2] Pass value between two action classes
quite possible.
for this u need to define the object fruit in session scope. and in 1st
page
say: vitamins, color can be filled. In 2nd page say: weight, age can be
filled and all the time the same object fruit in the session would be
filled.
http://struts.apache.org/2.x/docs/scope-interceptor.html
hope this helps.
ravi
--
http://www.nabble.com/-Struts-2--Pass-value-between-two-action-classes-t
p17234969p17246034.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)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_186486.ezm (zipped)Can anyone let me know the differences between (1) and (2): Thanks
(1) In struts-config.xml
<global-exceptions>
<exception key="someerryorKey"
type="
java.lang.Exception"
handler="com.....handler.MyCustomExceptionHandler"
path="errorPageForward">
</exception>
</global-exceptions>
(2) In web.xml
<error-page>
<exception-type>Exception</exception-type>
<location>/MyError.jsp</location>
</error-page>

Attachment:
user_186487.ezm (zipped)Hello ,
I have a problem with the integration of a video (wmv format) within a JSP
page. To that end I use the tag html <object> which allows me to integrate
my video played with Windows Media Player, these videos are stored on an
application server Weblogic 8.1. But I faced the following problem: my tag
object should recover within its attribute "src" a stream obtained from an
action struts 2. If a recovery this flow is done smoothly in the event of a
gif or jpeg image, the same action can not play the video in the drive
(displaying a black screen on the player without the possibility of
reading).
Viewing an image (runs smoothly):
<img src="/DLImage.action?file=chateau.gif" />
Viewing a video:
<object type="video/x-ms-wmv" width="320" height="255">
<param name="src" value="/Download.action?file=test.wmv" />
<param name="autoStart" value="0" />
</ object>
The actions DLImage.action and Download.action make available a flow-type
java.io.FileInputStream from the files stored on the server.
Please give me your comments if you've already encountered a similar problem
or if you have a solution or alternative to propose, I would be grateful!
--
Yousri BENDIABDALLAH

Attachment:
user_186488.ezm (zipped)Example:
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<json:object name="mylink">
<json:array name="mylink" var="obj" items="${linkList}">
<json:object>
<json:property name="idLink" value="${obj.id}" />
<json:property name="name" value="${obj.name}" />
<json:property name="description" value="${obj.description}" />
<json:property name="url" value="${obj.url}" />
<json:property name="categoryName" value="${obj.category.name}"
/>
<json:property name="countryName" value="${obj.country.name}" />
<json:property name="cityUf" value="${obj.city.state.name}" />
<json:property name="address" value="${obj.address}" />
<json:property name="bairro" value="${obj.zone}" />
<json:property name="cityName" value="${obj.city.name}" />
<json:property name="number" value="${obj.number}" />
<json:property name="cityName2" value="${obj.cityname}" />
<json:property name="cep" value="${obj.cep}" />
<json:property name="phone" value="${obj.phone}" />
<json:property name="email" value="${obj.email}" />
<json:property name="enable" value="${obj.enable}" />
<json:property name="idcity" value="${obj.city.id}" />
<json:property name="idcountry" value="${obj.country.id}" />
<json:property name="idcategory" value="${obj.category.id}" />
</json:object>
</json:array>
</json:object>
In ext you have a json object with name mylink with fill values.
2008/5/15 Frans Thamura <frans@(protected)>:
> On Thu, May 15, 2008 at 7:44 PM, Rafael Antunes <rafael.araujodf@(protected)
> >
> wrote:
>
> > You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib "transform"
> > the java object in json objects.
> >
>
> we use the JSON Plugins,
>
> i still dont know how to make the result output as JSON using json-lib
>
> i am know very close the json-lib creator
>
> any glue friend
>
> F
>
--
---------------------------------------------
Rafael Antunes Torquato Araujo

Attachment:
user_186489.ezm (zipped)plz compare with json-plugins
which send the POJO become JSON, without have to code this long lines
F
On Fri, May 16, 2008 at 12:15 AM, Rafael Antunes <rafael.araujodf@(protected)>
wrote:
> Example:
>
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)"%>
>
> <json:object name="mylink">
> <json:array name="mylink" var="obj" items="${linkList}">
> <json:object>
> <json:property name="idLink" value="${obj.id}" />
> <json:property name="name" value="${obj.name}" />
> <json:property name="description" value="${obj.description}" />
> <json:property name="url" value="${obj.url}" />
> <json:property name="categoryName" value="${obj.category.name}"
> />
> <json:property name="countryName" value="${obj.country.name}"
> />
> <json:property name="cityUf" value="${obj.city.state.name}" />
> <json:property name="address" value="${obj.address}" />
> <json:property name="bairro" value="${obj.zone}" />
> <json:property name="cityName" value="${obj.city.name}" />
> <json:property name="number" value="${obj.number}" />
> <json:property name="cityName2" value="${obj.cityname}" />
> <json:property name="cep" value="${obj.cep}" />
> <json:property name="phone" value="${obj.phone}" />
> <json:property name="email" value="${obj.email}" />
> <json:property name="enable" value="${obj.enable}" />
> <json:property name="idcity" value="${obj.city.id}" />
> <json:property name="idcountry" value="${obj.country.id}" />
> <json:property name="idcategory" value="${obj.category.id}" />
> </json:object>
> </json:array>
> </json:object>
>
> In ext you have a json object with name mylink with fill values.
>
> 2008/5/15 Frans Thamura <frans@(protected)>:
>
> > On Thu, May 15, 2008 at 7:44 PM, Rafael Antunes <
> rafael.araujodf@(protected)
> > >
> > wrote:
> >
> > > You need json-lib-*.*.jar and json-taglib*.*.jar, the tag lib
> "transform"
> > > the java object in json objects.
> > >
> >
> > we use the JSON Plugins,
> >
> > i still dont know how to make the result output as JSON using json-lib
> >
> > i am know very close the json-lib creator
> >
> > any glue friend
> >
> > F
> >
>
>
>
> --
>
> ---------------------------------------------
> Rafael Antunes Torquato Araujo
>
--
--
Frans Thamura
Director
Meruvian
Redefining Civilization
Indonesia
Education, Consulting, Networking, Profesional Marketplace, OpenSource
Development and Implementation
Mobile: +62 855 7888 699
Skype: fthamura
YM: fthamura@(protected)
GoogleTalk: frans@(protected)
MSN: fthamura@(protected)
Sun Java Champion
Oracle Ace Director
JEDI Indonesia / JENI Team
JUG Indonesia Founder
jTechnopreneur Community Founder
Blogs:
http://www.jroller.com/fthamura (English)
http://www.nagasakti.or.id/roller/page/fthamura (Indonesia : Motivation Blog
Linkedin: http://www.linkedin.com/in/fthamura

Attachment:
user_186490.ezm (zipped)this.href will give you the href value; I assume what Musachy posted
will give you the OGNL evaluated value. Why can't you use that?
L.
akshi gupta wrote:
> I want to write my custom tag because my aim is to get the href value
> for the authorisation so that I can able to render the link according to
> the conditions.
>
> Thats why I am writing my own custom tag by extending struts anchor tag
> class.
>
> Now can you suggest me how I will get href value in my own custom tag by
> extending struts anchor tag.
>
> Thanks,
> Akshi Gupta.
>
>
> Laurie Harper wrote:
>> As far as I can see, most of that code is redundant; removing all the
>> noise, this would be completely equivalent:
>>
>>
>> package com.axis.tag;
>>
>> import
java.util.Properties;
>> import com.axis.utils.PropertyLoader;
>>
>> public class MyAnchorTag extends AnchorTag {
>> @Override
>> public int doStartTag() throws JspException {
>> Properties props =
>> PropertyLoader.loadPropertiesBundle("resources/permissionParameter");
>> String permission = props.getProperty("permission");
>> System.out.println(" Method :" + permission);
>> if(permission == null){
>> return super.doStartTag();
>> }
>> return SKIP_BODY;
>> }
>> }
>>
>>
>> And that doesn't seem to relate in any way to the question you're
>> asking. In particular, it doesn't use or access the href attribute in
>> any way, nor does it attempt to use the method Musachy mentioned.
>>
>> So, what do you actually want to do, and how is it not working?
>>
>> L.
>>
>> akshi gupta wrote:
>>> Hello,
>>>
>>> I am unable to use this method in my tag handler can you please help
>>> me .. Following is my tag handler code :
>>>
>>> package com.axis.tag;
>>>
>>> import
java.util.Properties;
>>>
>>> import
javax.servlet.http.HttpServletRequest;
>>> import
javax.servlet.http.HttpServletResponse;
>>> import
javax.servlet.jsp.JspException;
>>> import
javax.servlet.jsp.tagext.Tag;
>>> import
javax.servlet.jsp.PageContext;
>>> import
javax.servlet.jsp.tagext.BodyContent;
>>>
>>> import
org.apache.struts2.components.Component;
>>> import org.apache.struts2.views.jsp.ui.AnchorTag;
>>>
>>> import com.axis.utils.PropertyLoader;
>>> import
com.opensymphony.xwork2.util.ValueStack;
>>>
>>> public class MyAnchorTag extends AnchorTag {
>>>
>>> /**
>>> *
>>> */
>>> private static final long serialVersionUID = 1L;
>>> private PageContext pageContext;
>>> private Tag parent;
>>> protected String preInvokeJS;
>>> protected String targets;
>>> protected ValueStack stack ;
>>> public HttpServletRequest req;
>>> public HttpServletResponse res;
>>> @Override
>>> public void doInitBody() throws JspException {
>>> super.doInitBody();
>>> }
>>>
>>> @Override
>>> public void setBodyContent(BodyContent arg0) {
>>> super.setBodyContent(arg0);
>>> }
>>>
>>> @Override
>>> public int doAfterBody() throws JspException {
>>> return super.doAfterBody();
>>> }
>>>
>>> @Override
>>> public int doStartTag() throws JspException {
>>> Properties props =
>>> PropertyLoader.loadPropertiesBundle("resources/permissionParameter");
>>> String permission = props.getProperty("permission");
>>> System.out.println(" Method :" + permission);
>>> if(permission == null){
>>> return super.doStartTag();
>>> }
>>> return SKIP_BODY;
>>> }
>>> @Override
>>> public int doEndTag() throws JspException {
>>> return EVAL_BODY_INCLUDE;
>>> }
>>>
>>> @Override
>>> public Tag getParent() {
>>> return super.getParent();
>>> }
>>> @Override
>>> public Component getComponent() {
>>> // TODO Auto-generated method stub
>>> return super.getComponent();
>>> }
>>>
>>> @Override
>>> public void release() {
>>> super.release();
>>> }
>>>
>>> @Override
>>> public void setPageContext(PageContext pageContext) {
>>> this.pageContext = pageContext;
>>> super.setPageContext(pageContext);
>>> }
>>>
>>> @Override
>>> public void setParent(Tag parent) {
>>> this.parent = parent;
>>> super.setParent(parent);
>>> }
>>>
>>> @Override
>>> public Component getBean(ValueStack stack, HttpServletRequest req,
>>> HttpServletResponse res) {
>>> return super.getBean(stack, req, res);
>>> }
>>> @Override
>>> protected void populateParams() {
>>> // TODO Auto-generated method stub
>>> super.populateParams();
>>> }
>>> }
>>>
>>> Thanks,
>>> Akshi
>>>
>>>
>>> Musachy Barroso wrote:
>>>> In org.apache.struts2.components.Achor
>>>>
>>>> public void evaluateExtraParams() {
>>>> super.evaluateExtraParams();
>>>>
>>>> if (href != null)
>>>> addParameter("href",
>>>> ensureAttributeSafelyNotEscaped(findString(href)));
>>>> }
>>>>
>>>>
>>>> On Fri, May 9, 2008 at 9:59 AM, akshi gupta <akshi@(protected):
>>>>
>>>>> Actually I am writing my own custom tag by extending AnchorTag
>>>>> class because
>>>>> I want "href" value for some business rules thats why I wanthref
>>>>> evaluated
>>>>> value.
>>>>>
>>>>> Now can you tell me from which method href evaluated value is coming?
>>>>>
>>>>> Thanks,
>>>>> Akshi
>>>>>
>>>>>
>>>>> Musachy Barroso wrote:
>>>>>
>>>>>> I am not really sure why you want to know but here is the short
>>>>>> explanation:
>>>>>>
>>>>>> <s:url id="edit" action="edit" method="input" namespace="/">
>>>>>>
>>>>>> This will construct a url like: "/edit.action", and push it into the
>>>>>> stack, associated with the key "edit" (from the "id" attribute).
>>>>>> Later
>>>>>> on
>>>>>>
>>>>>> <s:a href="%{edit}" >Edit</s:a>
>>>>>>
>>>>>> "%{edit}" will be evaluated against the stack and "/edit.action" will
>>>>>> be found, so that is the value that the anchor tag will use on its
>>>>>> href.
>>>>>>
>>>>>> musachy
>>>>>>
>>>>>>
>>>>>> On Fri, May 9, 2008 at 8:59 AM, akshi gupta <akshi@(protected)>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> If we use anchor tag like this :
>>>>>>>
>>>>>>> (ListSuccess.jsp) : ========> <%@(protected)"
>>>>>>> uri="/struts-tags"%>
>>>>>>> .............................
>>>>>>> .............................
>>>>>>> ========> <s:url id="edit" action="edit" method="input"
>>>>>>> namespace="/"
>>>>>>> />
>>>>>>> ========> <s:a href="%{edit}" >Edit</s:a>
>>>>>>>
>>>>>>>
>>>>>>> Now , how href value get parse and get the complete url ?
>>>>>>> Exactly through which method of the AnchorTag.java?
>>>>>>>
>>>>>>> Can anyone please help me out ?
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Akshi
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>>

Attachment:
user_186491.ezm (zipped)Hi,
I have simple class Fruit, that have "id" (long), "name" (String), and "buyers" List of <Person>. In my action class I have Fruit fruit; object with get/set methods.
In my jsp I have combo box defined like this:
<s:select id="buyers" labed="Buyer" list="buyers" name="fruit.buyers" emtpyOption="false" value = "fruit.buyers" hedaerKey="none" multiple="false"/>
and when I sumbit form that contain this combo box, it generates following error:
22:16:18,281 ERROR
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error setting expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'

Attachment:
user_186492.ezm (zipped)You need eht attribute "listKey" where you'll put the Person id!!!
see:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
On Thu, May 15, 2008 at 5:19 PM, Milan Milanovic <milanmilanovich@(protected)>
wrote:
> Hi,
>
> I have simple class Fruit, that have "id" (long), "name" (String), and
> "buyers" List of <Person>. In my action class I have Fruit fruit; object
> with get/set methods.
>
> In my jsp I have combo box defined like this:
>
> <s:select id="buyers" labed="Buyer" list="buyers" name="fruit.buyers"
> emtpyOption="false" value = "fruit.buyers" hedaerKey="none"
> multiple="false"/>
>
> and when I sumbit form that contain this combo box, it generates following
> error:
>
> 22:16:18,281 ERROR
>
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
> 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error setting
> expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'
>
>
>
>

Attachment:
user_186493.ezm (zipped)When I set listKey="fruit.buyers.id", I get a empty combo box, but with correct number of emtpy spaces (in my case 4) ?
--
Thanks, Milan
Felipe Lorenz <felipe.lorenz@(protected)!!!
see:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
On Thu, May 15, 2008 at 5:19 PM, Milan Milanovic
wrote:
> Hi,
>
> I have simple class Fruit, that have "id" (long), "name" (String), and
> "buyers" List of
. In my action class I have Fruit fruit; object
> with get/set methods.
>
> In my jsp I have combo box defined like this:
>
>
> emtpyOption="false" value = "fruit.buyers" hedaerKey="none"
> multiple="false"/>
>
> and when I sumbit form that contain this combo box, it generates following
> error:
>
> 22:16:18,281 ERROR
>
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> ParametersInterceptor - [setParameters]: Unexpected Exception caught setting
> 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error setting
> expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'
>
>
>
>

Attachment:
user_186494.ezm (zipped)Ok.. if i get your idea... the list yout want to put in combobox is
fruit.buyers, hummmm?
Then, try it:
<s:select id="buyers" labed="Buyer" list="buyers" listValue="personName"
listKey="personId" name="fruit.buyers" emtpyOption="false"
hedaerKey="none"/>
if you have the object fruit, then:
<s:select id="buyers" labed="Buyer" list="fruit.buyers"
listValue="personName" listKey="personId" name="fruit.buyers"
emtpyOption="false" hedaerKey="none"/>
maybe the name is not correct. Try chage the attr name to person, for
example.
<s:select id="buyers" labed="Buyer" list="fruit.buyers"
listValue="personName" listKey="personId" name="person" emtpyOption="false"
hedaerKey="none"/>
On Thu, May 15, 2008 at 6:05 PM, Milan Milanovic <milanmilanovich@(protected)>
wrote:
> When I set listKey="fruit.buyers.id", I get a empty combo box, but with
> correct number of emtpy spaces (in my case 4) ?
>
> --
> Thanks, Milan
>
> Felipe Lorenz <felipe.lorenz@(protected)
> "listKey" where you'll put the Person id!!!
>
> see:
>
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
>
> On Thu, May 15, 2008 at 5:19 PM, Milan Milanovic
> wrote:
>
> > Hi,
> >
> > I have simple class Fruit, that have "id" (long), "name" (String), and
> > "buyers" List of
> . In my action class I have Fruit fruit; object
> > with get/set methods.
> >
> > In my jsp I have combo box defined like this:
> >
> >
> > emtpyOption="false" value = "fruit.buyers" hedaerKey="none"
> > multiple="false"/>
> >
> > and when I sumbit form that contain this combo box, it generates
> following
> > error:
> >
> > 22:16:18,281 ERROR
> >
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting
> > 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error
> setting
> > expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'
> >
> >
> >
> >
>
>
>
>
>

Attachment:
user_186495.ezm (zipped)When I removed listKey then it works good. But I now have the same problem with my datetimepicker field. I have "date" attrib (of type
java.util.Date with get/set methods) in my Fruit class. I have defined it in jsp like this:
<s:daettimepicker name="fruit.date" id="fruit.date" displayFormat="dd.MM.yyyy" label="Date" type="date"/>
?
--
Thx, Milan
Felipe Lorenz <felipe.lorenz@(protected)
fruit.buyers, hummmm?
Then, try it:
listKey="personId" name="fruit.buyers" emtpyOption="false"
hedaerKey="none"/>
if you have the object fruit, then:
listValue="personName" listKey="personId" name="fruit.buyers"
emtpyOption="false" hedaerKey="none"/>
maybe the name is not correct. Try chage the attr name to person, for
example.
listValue="personName" listKey="personId" name="person" emtpyOption="false"
hedaerKey="none"/>
On Thu, May 15, 2008 at 6:05 PM, Milan Milanovic
wrote:
> When I set listKey="fruit.buyers.id", I get a empty combo box, but with
> correct number of emtpy spaces (in my case 4) ?
>
> --
> Thanks, Milan
>
> Felipe Lorenz wrote: You need eht attribute
> "listKey" where you'll put the Person id!!!
>
> see:
>
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
>
> On Thu, May 15, 2008 at 5:19 PM, Milan Milanovic
> wrote:
>
> > Hi,
> >
> > I have simple class Fruit, that have "id" (long), "name" (String), and
> > "buyers" List of
> . In my action class I have Fruit fruit; object
> > with get/set methods.
> >
> > In my jsp I have combo box defined like this:
> >
> >
> > emtpyOption="false" value = "fruit.buyers" hedaerKey="none"
> > multiple="false"/>
> >
> > and when I sumbit form that contain this combo box, it generates
> following
> > error:
> >
> > 22:16:18,281 ERROR
> >
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting
> > 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error
> setting
> > expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'
> >
> >
> >
> >
>
>
>
>
>

Attachment:
user_186497.ezm (zipped)I'm just not sure when I put listValue = "name" and listKey="id" I get and emtpy combo box with exactly 4 places (it have value option good) ?
One more thing, if I have object Person buyer; in my Fruit class (with get/set methods), and I have Fruit fruit object in my action class, where I also have List<Person>allBuyers in my action class. How can I define combo box so that when buyer is selected, that Person object should be set to my fruit.buyer object ?
--
Thx, Milan
Felipe Lorenz <felipe.lorenz@(protected)
fruit.buyers, hummmm?
Then, try it:
listKey="personId" name="fruit.buyers" emtpyOption="false"
hedaerKey="none"/>
if you have the object fruit, then:
listValue="personName" listKey="personId" name="fruit.buyers"
emtpyOption="false" hedaerKey="none"/>
maybe the name is not correct. Try chage the attr name to person, for
example.
listValue="personName" listKey="personId" name="person" emtpyOption="false"
hedaerKey="none"/>
On Thu, May 15, 2008 at 6:05 PM, Milan Milanovic
wrote:
> When I set listKey="fruit.buyers.id", I get a empty combo box, but with
> correct number of emtpy spaces (in my case 4) ?
>
> --
> Thanks, Milan
>
> Felipe Lorenz wrote: You need eht attribute
> "listKey" where you'll put the Person id!!!
>
> see:
>
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/components/Select.html
>
> On Thu, May 15, 2008 at 5:19 PM, Milan Milanovic
> wrote:
>
> > Hi,
> >
> > I have simple class Fruit, that have "id" (long), "name" (String), and
> > "buyers" List of
> . In my action class I have Fruit fruit; object
> > with get/set methods.
> >
> > In my jsp I have combo box defined like this:
> >
> >
> > emtpyOption="false" value = "fruit.buyers" hedaerKey="none"
> > multiple="false"/>
> >
> > and when I sumbit form that contain this combo box, it generates
> following
> > error:
> >
> > 22:16:18,281 ERROR
> >
com.opensymphony.xwork2.interceptor.ParametersInterceptor:204 -
> > ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting
> > 'fruit.buyers' on class 'com.myproject.actions.FruitAction': Error
> setting
> > expression 'fruit.buyers' with value '[Ljava.lang.String;@(protected)'
> >
> >
> >
> >
>
>
>
>
>

Attachment:
user_186496.ezm (zipped)I don't know if it would help you, but whenever I've had the
phenomenon of repeating content on a page, it is almost always related
to encountering an exception in one of the struts iteration tags. The
first place I look are the log files to see if there's a stack trace.
Hope that helps.
Eric Rank
On May 15, 2008, at 4:56 AM, Canny Duck wrote:
>
> Hi,
>
> I realized a Struts 2 process to create a new contract. As template
> results
> I tried JSP and Velocity. All JSP templates are rendered correct,
> but the
> velocity templates are rendered twice. So I see the same content
> twice on
> the page.
>
> Are there people with similar problems? Does somebody has a solution?
>
> Greets
>
>
> I'm using Struts 2.0.11.
>
> struts.xml:
> ...
> <package name="contract" namespace="/contract" extends="base-package">
>
> <result-types>
> <result-type name="velocity" default="true"
> class="
org.apache.struts2.dispatcher.VelocityResult" />
> </result-types>
>
> <action name="createContract*" class="CreateContractAction"
> method="{1}">
> <interceptor-ref name="conversationStack" />
> <result
> name="input">/WEB-INF/vm/contract/createContract-input.vm</result>
> <result
> name="success">/WEB-INF/vm/contract/createContract-success.vm</result>
> </action>
> </package>
> ...
>
> --
> View this message in context: http://www.nabble.com/Struts-2---Velocity-Templates-rendered-twice-tp17250628p17250628.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)
>