Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 28 Mar 2008 15:47:26 -0000 Issue 7949

user-digest-help

2008-03-28


Author LoginPost Reply

user Digest 28 Mar 2008 15:47:26 -0000 Issue 7949

Topics (messages 184757 through 184773):

Re: S2/Sitemesh: How to set the title in a freemarker template?
 184757 by: me
 184759 by: stanlick.gmail.com
 184760 by: me
 184761 by: stanlick.gmail.com
 184762 by: me
 184763 by: stanlick.gmail.com
 184764 by: me
 184765 by: stanlick.gmail.com
 184766 by: me

Re: Message surviving redirect
 184758 by: stanlick.gmail.com

Action Problem ....
 184767 by: Narayana S

Struts 2 vs. Stripes
 184768 by: Asleson, Ryan

Retaining request attributes after redirect
 184769 by: ancatdubher
 184770 by: stanlick.gmail.com
 184771 by: Dave Newton

dojo is not defined error message in firefox console.
 184772 by: sharath karnati

Re: Calling Action on form load
 184773 by: aum strut

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_184757.ezm (zipped)
Hi,

hmmm... do you mean that I should create a template for each site which
has another title?
I think that would be too much. I've got several pages which should get
a title based on information
located in a database.

I thought that there will be a property in the action i have to set or
can I access the
value-stack from the sitemesh-freemarker template?


Marc

stanlick@(protected):
> Hey Marc --
>
> copy that FreeMarker template into your <webroot>/template folder and modify
> it with your desired changes. Struts 2 will grab yours for rendering.
>
>
> On Fri, Mar 28, 2008 at 2:14 AM, me <mlists@(protected):
>
>  
>> Hi,
>>
>> I'm running struts2 with sitemesh. There is a freemarker template
>> defined in the decorators and this template
>> has both variables $title and $body. The body is filled autmatically
>> which is okay. But I want to set the title
>> from the action I've called because I wanted to have the content and the
>> title having a relation to each other
>> (which makes sense, I believe... :) )
>>
>> Thanks for your help.
>>
>> Marc
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
>
>  


Attachment: user_184759.ezm (zipped)
The FreeMarker template can access the property in your action to get the
"action variable" title.

On Fri, Mar 28, 2008 at 3:24 AM, me <mlists@(protected):

> Hi,
>
> hmmm... do you mean that I should create a template for each site which
> has another title?
> I think that would be too much. I've got several pages which should get
> a title based on information
> located in a database.
>
> I thought that there will be a property in the action i have to set or
> can I access the
> value-stack from the sitemesh-freemarker template?
>
>
> Marc
>
> stanlick@(protected):
> > Hey Marc --
> >
> > copy that FreeMarker template into your <webroot>/template folder and
> modify
> > it with your desired changes. Struts 2 will grab yours for rendering.
> >
> >
> > On Fri, Mar 28, 2008 at 2:14 AM, me <mlists@(protected):
> >
> >
> >> Hi,
> >>
> >> I'm running struts2 with sitemesh. There is a freemarker template
> >> defined in the decorators and this template
> >> has both variables $title and $body. The body is filled autmatically
> >> which is okay. But I want to set the title
> >> from the action I've called because I wanted to have the content and
> the
> >> title having a relation to each other
> >> (which makes sense, I believe... :) )
> >>
> >> Thanks for your help.
> >>
> >> Marc
> >>
> >> ---------------------------------------------------------------------
> >> 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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184760.ezm (zipped)
Sorry but I think I miss something. I've got a action which extends
ActionSupport. This Action has got an execute() method
and an title property with the getters and setters.
The action is properly read and executed. But the property wasn't. Is
there anything I have to take care of?
Sorry for my stupid questions.

Marc

stanlick@(protected):
> The FreeMarker template can access the property in your action to get the
> "action variable" title.
>
> On Fri, Mar 28, 2008 at 3:24 AM, me <mlists@(protected):
>
>  
>> Hi,
>>
>> hmmm... do you mean that I should create a template for each site which
>> has another title?
>> I think that would be too much. I've got several pages which should get
>> a title based on information
>> located in a database.
>>
>> I thought that there will be a property in the action i have to set or
>> can I access the
>> value-stack from the sitemesh-freemarker template?
>>
>>
>> Marc
>>
>> stanlick@(protected):
>>  
>>> Hey Marc --
>>>
>>> copy that FreeMarker template into your <webroot>/template folder and
>>>    
>> modify
>>  
>>> it with your desired changes. Struts 2 will grab yours for rendering.
>>>
>>>
>>> On Fri, Mar 28, 2008 at 2:14 AM, me <mlists@(protected):
>>>
>>>
>>>    
>>>> Hi,
>>>>
>>>> I'm running struts2 with sitemesh. There is a freemarker template
>>>> defined in the decorators and this template
>>>> has both variables $title and $body. The body is filled autmatically
>>>> which is okay. But I want to set the title
>>>> from the action I've called because I wanted to have the content and
>>>>      
>> the
>>  
>>>> title having a relation to each other
>>>> (which makes sense, I believe... :) )
>>>>
>>>> Thanks for your help.
>>>>
>>>> Marc
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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_184761.ezm (zipped)
No problem bro

Let's see what you added to your template to fetch the title from action

On Fri, Mar 28, 2008 at 4:18 AM, me <mlists@(protected):

> Sorry but I think I miss something. I've got a action which extends
> ActionSupport. This Action has got an execute() method
> and an title property with the getters and setters.
> The action is properly read and executed. But the property wasn't. Is
> there anything I have to take care of?
> Sorry for my stupid questions.
>
> Marc
>
> stanlick@(protected):
> > The FreeMarker template can access the property in your action to get
> the
> > "action variable" title.
> >
> > On Fri, Mar 28, 2008 at 3:24 AM, me <mlists@(protected):
> >
> >
> >> Hi,
> >>
> >> hmmm... do you mean that I should create a template for each site which
> >> has another title?
> >> I think that would be too much. I've got several pages which should get
> >> a title based on information
> >> located in a database.
> >>
> >> I thought that there will be a property in the action i have to set or
> >> can I access the
> >> value-stack from the sitemesh-freemarker template?
> >>
> >>
> >> Marc
> >>
> >> stanlick@(protected):
> >>
> >>> Hey Marc --
> >>>
> >>> copy that FreeMarker template into your <webroot>/template folder and
> >>>
> >> modify
> >>
> >>> it with your desired changes. Struts 2 will grab yours for rendering.
> >>>
> >>>
> >>> On Fri, Mar 28, 2008 at 2:14 AM, me <mlists@(protected):
> >>>
> >>>
> >>>
> >>>> Hi,
> >>>>
> >>>> I'm running struts2 with sitemesh. There is a freemarker template
> >>>> defined in the decorators and this template
> >>>> has both variables $title and $body. The body is filled autmatically
> >>>> which is okay. But I want to set the title
> >>>> from the action I've called because I wanted to have the content and
> >>>>
> >> the
> >>
> >>>> title having a relation to each other
> >>>> (which makes sense, I believe... :) )
> >>>>
> >>>> Thanks for your help.
> >>>>
> >>>> Marc
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184762.ezm (zipped)

stanlick@(protected):
> No problem bro
>
> Let's see what you added to your template to fetch the title from action
Okay, these are my files:

template.ftl:
--------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>test - ${title}</title>
</head>
<body>
${body}
</body>
</html>
--------------------------------------------------------------

ContactAction:
--------------------------------------------------------------
package isi.services.pages;

import com.opensymphony.xwork2.ActionSupport;


public class ContactAction extends ActionSupport {

String title = "hallo";

public String execute() {
  return "input";
}

public String getTitle() {
  return this.title;
}

public void setTitle(final String value) {
  this.title = value;
}

}
--------------------------------------------------------------


Attachment: user_184763.ezm (zipped)
Try stack.findString('title') instead of ${title}

On Fri, Mar 28, 2008 at 4:57 AM, me <mlists@(protected):

>
> stanlick@(protected):
> > No problem bro
> >
> > Let's see what you added to your template to fetch the title from action
> Okay, these are my files:
>
> template.ftl:
> --------------------------------------------------------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html>
> <head>
>   <title>test - ${title}</title>
> </head>
> <body>
> ${body}
> </body>
> </html>
> --------------------------------------------------------------
>
> ContactAction:
> --------------------------------------------------------------
> package isi.services.pages;
>
> import com.opensymphony.xwork2.ActionSupport;
>
>
> public class ContactAction extends ActionSupport {
>
> String title = "hallo";
>
> public String execute() {
>   return "input";
> }
>
> public String getTitle() {
>   return this.title;
> }
>
> public void setTitle(final String value) {
>   this.title = value;
> }
>
> }
> --------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184764.ezm (zipped)
Great! It works perfectly!

Thank you very much!!!

Marc

stanlick@(protected):
> Try stack.findString('title') instead of ${title}
>
> On Fri, Mar 28, 2008 at 4:57 AM, me <mlists@(protected):
>
>  
>> stanlick@(protected):
>>  
>>> No problem bro
>>>
>>> Let's see what you added to your template to fetch the title from action
>>>    
>> Okay, these are my files:
>>
>> template.ftl:
>> --------------------------------------------------------------
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> <html>
>> <head>
>>   <title>test - ${title}</title>
>> </head>
>> <body>
>> ${body}
>> </body>
>> </html>
>> --------------------------------------------------------------
>>
>> ContactAction:
>> --------------------------------------------------------------
>> package isi.services.pages;
>>
>> import com.opensymphony.xwork2.ActionSupport;
>>
>>
>> public class ContactAction extends ActionSupport {
>>
>> String title = "hallo";
>>
>> public String execute() {
>>   return "input";
>> }
>>
>> public String getTitle() {
>>   return this.title;
>> }
>>
>> public void setTitle(final String value) {
>>   this.title = value;
>> }
>>
>> }
>> --------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
>
>  


Attachment: user_184765.ezm (zipped)
Dude, do you sleep?

On Fri, Mar 28, 2008 at 5:09 AM, me <mlists@(protected):

> Great! It works perfectly!
>
> Thank you very much!!!
>
> Marc
>
> stanlick@(protected):
> > Try stack.findString('title') instead of ${title}
> >
> > On Fri, Mar 28, 2008 at 4:57 AM, me <mlists@(protected):
> >
> >
> >> stanlick@(protected):
> >>
> >>> No problem bro
> >>>
> >>> Let's see what you added to your template to fetch the title from
> action
> >>>
> >> Okay, these are my files:
> >>
> >> template.ftl:
> >> --------------------------------------------------------------
> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> >> <html>
> >> <head>
> >>   <title>test - ${title}</title>
> >> </head>
> >> <body>
> >> ${body}
> >> </body>
> >> </html>
> >> --------------------------------------------------------------
> >>
> >> ContactAction:
> >> --------------------------------------------------------------
> >> package isi.services.pages;
> >>
> >> import com.opensymphony.xwork2.ActionSupport;
> >>
> >>
> >> public class ContactAction extends ActionSupport {
> >>
> >> String title = "hallo";
> >>
> >> public String execute() {
> >>   return "input";
> >> }
> >>
> >> public String getTitle() {
> >>   return this.title;
> >> }
> >>
> >> public void setTitle(final String value) {
> >>   this.title = value;
> >> }
> >>
> >> }
> >> --------------------------------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184766.ezm (zipped)
May be. I haven't done anything with struts 2 and sitemesh until now.
Mostly I had worked with struts 1 but
I had to upgrade now.... (So I'm still a beginner. :) )

stanlick@(protected):
> Dude, do you sleep?
>
> On Fri, Mar 28, 2008 at 5:09 AM, me <mlists@(protected):
>
>  


Attachment: user_184758.ezm (zipped)
Sorry about that! My config specified the interceptor as:

<interceptor-ref name="store">
<param name="operationMode">STORE</param>
</interceptor-ref>

Also, I think you can specify store/retrieve as a request parameter as an
alternative to the XML

On Fri, Mar 28, 2008 at 12:30 AM, Laurie Harper <laurie@(protected):

> He *is* using the store interceptor :-), though apparently it's not
> working. I haven't used it myself but perhaps you can see what's wrong
> in the configuration he posted?
>
> L.
>
> stanlick@(protected):
> > Since "chain" can be a bad design practice, you might want to look at
> the store
> > <http://struts.apache.org/2.x/docs/message-store-interceptor.html
> >interceptor.
> > I have used it successfully.
> >
> > On Thu, Mar 27, 2008 at 4:02 PM, Jiang, Jane (NIH/NCI) [C] <
> > jiangja@(protected):
> >
> >> Instead of type="redirect-action", did you try "chain"?
> >>
> >> -----Original Message-----
> >> From: chubi [mailto:chubi-shuki@(protected)]
> >> Sent: Thursday, March 27, 2008 4:05 PM
> >> To: user@(protected)
> >> Subject: Message surviving redirect
> >>
> >>
> >> Hello,
> >> ----I have posted the same problem in a previous thread, yet got no
> >> reply,
> >> but I'm really stuck with it and spending days trying to solve it, in
> >> vain... ----
> >>
> >> I have two actions: editFeature and saveFeature. Whereas editFeature
> >> should
> >> submit successfuly to saveFeature the latter performs and redirects
> >> transparently to editFeature again. This is ok using redirect-action.
> >>
> >> But in case when validation fails after submission, I get back to
> >> editFeature with all error messages lost.
> >> I read a previous thread talkin about the same problem and giving a
> >> satisfying solution with the store interceptor, though I could not come
> >> to
> >> solve my problem.
> >> Here is my struts actions:
> >> pst: the store interceptor tags do not show correctly in this thread.
> >>
> >> <action name="editFeature"
> >> class="com.intelligile.lms.webapp.action.FeatureAction" method="edit">
> >>                <interceptor-ref name="defaultStack" />
> >>                <interceptor-ref name="store">
> >>                     RETRIEVE
> >>                </interceptor-ref>
> >>        <result>/WEB-INF/pages/featureForm.jsp</result>
> >>        <result name="error">/WEB-INF/pages/featureList.jsp</result>
> >>
> >>     </action>
> >>
> >>     <action name="saveFeature"
> >> class="com.intelligile.lms.webapp.action.FeatureAction" method="save">
> >>                <interceptor-ref name="defaultStack" />
> >>                <interceptor-ref name="store">
> >>                     STORE
> >>                </interceptor-ref>
> >>        <result name="success"
> >> type="redirect">features.html</result>
> >>        <result name="input" type="redirect-action">
> >>                     editFeature.html
> >>                     true
> >>                     ${feature.dkey}
> >>                </result>
> >>     </action>
> >>
> >> Please help me figure out where the problem exists.
> >> Thank you for your support.
> >> Best regards.
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Message-surviving-redirect-tp16332404p16332404.htm
> >> l
> >> 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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184767.ezm (zipped)
Hi,

      i am having one link in a page. when i click on the link, i am
going to the other page with some request level attribute. in the second
page i have one update button, when i press that button, after performing
some action and should return back to the 1st page along with same request
attribute. this is my scenario..

if i am using redirect action, it is not passing request parameters. how to
solve this problem?

Attachment: user_184768.ezm (zipped)

Hello,

My company is considering replacements for Struts 1.x. The finalists
are Struts 2 and Stripes. Not trying to start a flame war here, but can
anybody comment on the relative strengths and weaknesses of Struts 2 vs.
Stripes?

Thank you!!



This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.

Attachment: user_184769.ezm (zipped)

Hi,

I am building a simple registration module. The user accesses /signup.action
to view signup.jsp. This JSP allows him to enter username, password, phone
and address. When submitted, the /createUser.action is invoked. Validation
of form data also happens here. When form data is invalid, I do a redirect:

<action name="createUser">
  <result name="validationFailed" type="action-redirect">signup</result>
</action>

This loses all request attributes.
I can reclaim the error messages by adding the Message Store interceptor.
But I would like to be able to display the Signup.jsp back with all fields
entered by the user. (username, password, phone and address - which are
members of the USER object member on the createUser action)
How do I retain these attributes?

-Thanks, Ancat
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_184770.ezm (zipped)
Have you looked at the chain
<http://struts.apache.org/2.0.11.1/docs/chain-result.html>result type?

On Fri, Mar 28, 2008 at 8:25 AM, ancatdubher <ancatdubher@(protected):

>
> Hi,
>
> I am building a simple registration module. The user accesses
> /signup.action
> to view signup.jsp. This JSP allows him to enter username, password, phone
> and address. When submitted, the /createUser.action is invoked. Validation
> of form data also happens here. When form data is invalid, I do a
> redirect:
>
> <action name="createUser">
>   <result name="validationFailed" type="action-redirect">signup</result>
> </action>
>
> This loses all request attributes.
> I can reclaim the error messages by adding the Message Store interceptor.
> But I would like to be able to display the Signup.jsp back with all fields
> entered by the user. (username, password, phone and address - which are
> members of the USER object member on the createUser action)
> How do I retain these attributes?
>
> -Thanks, Ancat
> --
> View this message in context:
> http://www.nabble.com/Retaining-request-attributes-after-redirect-tp16349672p16349672.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)
>
>


--
Scott
stanlick@(protected)

Attachment: user_184771.ezm (zipped)
--- ancatdubher <ancatdubher@(protected):
> I am building a simple registration module. The user accesses
> /signup.action
> to view signup.jsp. This JSP allows him to enter username, password, phone
> and address. When submitted, the /createUser.action is invoked. Validation
> of form data also happens here. When form data is invalid, I do a redirect:
>
> <action name="createUser">
>   <result name="validationFailed" type="action-redirect">signup</result>
> </action>
>
> This loses all request attributes.
> I can reclaim the error messages by adding the Message Store interceptor.
> But I would like to be able to display the Signup.jsp back with all fields
> entered by the user. (username, password, phone and address - which are
> members of the USER object member on the createUser action)
> How do I retain these attributes?

One option is to create an "input" result for the createUser action, using
the same JSP as the signup action.

> <action name="createUser">
>   <result name="input">[[[Same JSP as signup action]]]</result>
> </action>

The validation interceptor will go to this result by default, and if
configured as the default dispatcher result type, there won't be a redirect,
meaning nothing is lost. This also avoids action chaining, which isn't really
necessary for a one-step signup process.

Dave


Attachment: user_184772.ezm (zipped)
Hi All,
 
  I'm getting below error message for this acrion(http://localhost:7001/hibernate/events/Dojo.action).
 
   dojo is not defined
    dojo.require("dijit.form.Button");
 
  Please find my progrm:
 
<html>
<head>
<s:head theme="ajax" debug="true"/>
<title>TooltipDialog demo</title>
<script type="text/javascript">
  // Dojo configuration
  djConfig = {
  parseOnLoad: true,
    baseRelativePath: "<@(protected)'/>",
    isDebug: true,
    bindEncoding: "${parameters.encoding}",
    debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes    
  };
</script>
<script type="text/javascript"
    src="<@(protected)'/>">
</script>

<link href="<s:url value='/pages/dojoroot/dojo/resources/dojo.css'/>" rel='stylesheet' type='text/css' />
<link href="<s:url value='/pages/dojoroot/dijit/themes/tundra/tundra.css'/>" rel='stylesheet' type='text/css' />      
<script type="text/javascript">
     dojo.require("dijit.Dialog");
       dojo.require("dijit.form.Button");
</script>
 
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" id="helloButton">
               Hello World
               <script type="dojo/method" event="onClick">
                    console.log('you pressed the button');
                    alert("You pressed the button.");
               </script>
 </button>
</body>
</html>
 
  In struts.xml, I configured this program as below
 
   <action name="Dojo">
<result>/pages/test1.jsp</result>
  </action>
 
dojoroot directory is in WEB-INF/pages directory. I'm using 'struts2-core-2.0.11.jar'
 
Please let me know what is wrong in this code and how to correct this problem.
 
Thanks in advance.
 
Regards,
Sharath.

   
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

Attachment: user_184773.ezm (zipped)
Hi Jane,

what i m doing in my action class i am putting the list in the session like
this

Map<String, ArrayList<String>> session = ActionContext.*getContext*
().getSession();

session.put("value",itemCode);
and in my jsp page i m trying to retrieving the values like this:

<s:select label="Select Code" cssClass="large" list="%{#session.value}"

name="code"

headerKey="1"

headerValue="-- Select Item Codet --"

list="ItemCode"

/>
but when ever i m hitting the submitt button it is giving me the exception

tag 'select', field 'list', name 'code': The requested list key 'ItemCode'
could not be resolved as a collection/array/map/enumeration/iterator type.
Example: people or people.{name} - [unknown location]
any suggestion in this regard??

-aum


On 3/27/08, Jiang, Jane (NIH/NCI) [C] <jiangja@(protected):
>
> Aum,
>
> After you retrieve the list in your action, save it in session using
>
> session.put("mySelectionList", list);
>
> Then in your jsp, use the list in session for s:selection.
>
>  <s:select name="mysSelection" cssClass="large" value="selectedValue"
>         list="%{#session.mySelectionList}" listKey="value"
>         listValue="label" />
>
> Hope this helps,
>
> Jane
>
> -----Original Message-----
> From: aum strut [mailto:aum.struts@(protected)]
> Sent: Thursday, March 27, 2008 1:08 PM
> To: Struts Users Mailing List
> Subject: Re: Calling Action on form load
>
> Jane,
>
> can you just give me a brief aidea about (or even if u can a demo code )
> how
> u put ur list in to the action.
>
> that will be of gr8 help
>
> --aum
>
>
> On 3/27/08, Randy Burgess <RBurgess@(protected):
> >
> > Use the <s:action> tag.
> >
> > http://struts.apache.org/2.x/docs/action.html
> >
> > Regards,
> > Randy Burgess
> > Sr. Web Applications Developer
> > Nuvox Communications
> >
> >
> >
> > > From: aum strut <aum.struts@(protected)>
> > > Reply-To: Struts Users Mailing List <user@(protected)>
> > > Date: Thu, 27 Mar 2008 22:04:04 +0530
> > > To: Struts Users Mailing List <user@(protected)>
> > > Subject: Calling Action on form load
> > >
> > > Hi all,
> > >
> > > is it possible to call an action in struts2 everytime when the page
> get
> > > loaded if yes how it is possible.
> > > my problem is i am using <s:select> tag and using a list to pupulate
> > this
> > > drop down this list is coming from the action which i m calling
> before
> > the
> > > page is being displayed.
> > >
> > > the folw is like this:
> > >
> > > if usercall for this JSP page instaed to direct user directly to
> this
> > page
> > > i m calling an action which is preaparing a list for the <s:select>
> tag
> > > and then it is forwarding the user to this page.
> > >
> > > Till now eveything is working fine,but when on this page user is
> > entering
> > > some values in the fields and hitting the submitting
> button,exception is
> > > being thrown which is saying that:
> > >
> > >
> > > select', field 'list', name 'code': The requested list key
> 'ItemCode'
> > could
> > > not be resolved as a collection/array/map/enumeration/iterator type.
> > > Example: people or people.{name} - [unknown location]
> > >
> > > because i thik it is unable to call the action again which is
> returning
> > the
> > > list...is theer any way to call that action each time when user is
> > > submitting the value..
> > >
> > >
> > >
> > > any pointer in this regard will be much appriciated.
> > >
> > > -aum
> >
> >
> >
> > This email and any attachments ("Message") may contain legally
> privileged
> > and/or confidential information. If you are not the addressee, or if
> this
> > Message has been addressed to you in error, you are not authorized to
> read,
> > copy, or distribute it, and we ask that you please delete it
> (including all
> > copies) and notify the sender by return email. Delivery of this
> Message to
> > any person other than the intended recipient(s) shall not be deemed a
> waiver
> > of confidentiality and/or a privilege.
> >
> > ---------------------------------------------------------------------
> > 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)
>
>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.