Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 18 Apr 2008 18:50:41 -0000 Issue 7987

user-digest-help

2008-04-18


Author LoginPost Reply

user Digest 18 Apr 2008 18:50:41 -0000 Issue 7987

Topics (messages 185587 through 185596):

Clarification on Type Conversion?
 185587 by: Griffith, Michael *
 185590 by: Jukka Välimaa
 185591 by: Martin Gainty
 185592 by: Griffith, Michael *
 185593 by: Griffith, Michael *
 185595 by: Jukka Välimaa

Re: Struts2, SiteMesh and Struts Menu
 185588 by: Matthew Seaborn

ParametersInterceptor problem for simple java.util.Date.
 185589 by: sharath karnati

Clearing form value
 185594 by: aum strut
 185596 by: Dave Newton

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_185587.ezm (zipped)
Hello All,



I am having a problem with Struts 2 form submission, because I believe a
related <s:select> field is not being converted correctly. I have read
the documentation at: http://struts.apache.org/2.x/docs/select.html and
http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
understanding that I should not need to provide any custom converter,
that this conversion should be automatic. When I submit the form, I
receive the error: Invalid field value for field "status".



Here is the setup:



I have a form with a <s:select> field:

       <s:select key="form.status" name="status"

                    list="statusList"

                    listKey="id"

                    listValue="description"/>



The action has the method:



       public List<Status> getStatusList(){

               return statusService.findAll();

       }



The model object that status is mapped to looks like this:



@Entity

@Table(name="STATUS")

@Validation

public class Status implements Identifiable, Serializable {



       private static final long serialVersionUID =
-8017026685032314796L;

       private Integer id;

       private String description;



       @Id

       @GeneratedValue(strategy = GenerationType.AUTO)

       @Column(name = "ID", unique = true, nullable= false)

       public Integer getId() {

               return id;

       }

       

       public void setId(Integer id){

               this.id= id;

       }



       @Column(name="DESCRIPTION", nullable= false)

       public String getDescription() {

               return description;

       }



       @RequiredStringValidator(message="Validation Error",
key="validate.notEmpty", trim=true)

       public void setDescription(String description) {

               this.description = description;

       }



I tried creating a mapping properties file called
actionName-conversion.properties:

KeyProperty_StatusList=id

Element_StatusList=Status

CreateIfNull_statusList=true



No avail. I'm sure my problem is obvious, but I can't see it. Any help
or suggestions would be much appreciated...



Thanks in advance!

Michael Griffith






Attachment: user_185590.ezm (zipped)
name="status" means that you are trying to pass the status object itself as
a parameter to a method setStatus. That is not possible--you need to pass
the id of the status if you want to indicate which status the user chose,
like this for example:
<s:select key="form.status" name="id"
  list="statusList"
  listKey="id"
  listValue="description"/>

You also need setId method in the action you submit the form to.

On Fri, Apr 18, 2008 at 5:33 PM, Griffith, Michael * <
Michael.Griffith@(protected):

> Hello All,
>
>
>
> I am having a problem with Struts 2 form submission, because I believe a
> related <s:select> field is not being converted correctly. I have read
> the documentation at: http://struts.apache.org/2.x/docs/select.html and
> http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
> understanding that I should not need to provide any custom converter,
> that this conversion should be automatic. When I submit the form, I
> receive the error: Invalid field value for field "status".
>
>
>
> Here is the setup:
>
>
>
> I have a form with a <s:select> field:
>
>        <s:select key="form.status" name="status"
>
>                     list="statusList"
>
>                     listKey="id"
>
>                     listValue="description"/>
>
>
>
> The action has the method:
>
>
>
>        public List<Status> getStatusList(){
>
>                return statusService.findAll();
>
>        }
>
>
>
> The model object that status is mapped to looks like this:
>
>
>
> @Entity
>
> @Table(name="STATUS")
>
> @Validation
>
> public class Status implements Identifiable, Serializable {
>
>
>
>        private static final long serialVersionUID =
> -8017026685032314796L;
>
>        private Integer id;
>
>        private String description;
>
>
>
>        @Id
>
>        @GeneratedValue(strategy = GenerationType.AUTO)
>
>        @Column(name = "ID", unique = true, nullable= false)
>
>        public Integer getId() {
>
>                return id;
>
>        }
>
>
>
>        public void setId(Integer id){
>
>                this.id= id;
>
>        }
>
>
>
>        @Column(name="DESCRIPTION", nullable= false)
>
>        public String getDescription() {
>
>                return description;
>
>        }
>
>
>
>        @RequiredStringValidator(message="Validation Error",
> key="validate.notEmpty", trim=true)
>
>        public void setDescription(String description) {
>
>                this.description = description;
>
>        }
>
>
>
> I tried creating a mapping properties file called
> actionName-conversion.properties:
>
> KeyProperty_StatusList=id
>
> Element_StatusList=Status
>
> CreateIfNull_statusList=true
>
>
>
> No avail. I'm sure my problem is obvious, but I can't see it. Any help
> or suggestions would be much appreciated...
>
>
>
> Thanks in advance!
>
> Michael Griffith
>
>
>
>
>
>

Attachment: user_185591.ezm (zipped)
Good Afternoon Mike-

Tough to diagnose without seeing the service interface defined in your
action
e.g.
public class HHSAction implements Preparable {
  private HHSService service;
}

package quickstart.service;
import java.util.List;
import quickstart.model.Person;
public interface HHSService
{
  public List<Person> findAll();
  public void save(Person person);
  public Person find(int id);
}

?
Martin-
----- Original Message -----
From: "Griffith, Michael *" <Michael.Griffith@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Friday, April 18, 2008 10:33 AM
Subject: Clarification on Type Conversion?


Hello All,



I am having a problem with Struts 2 form submission, because I believe a
related <s:select> field is not being converted correctly. I have read
the documentation at: http://struts.apache.org/2.x/docs/select.html and
http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
understanding that I should not need to provide any custom converter,
that this conversion should be automatic. When I submit the form, I
receive the error: Invalid field value for field "status".



Here is the setup:



I have a form with a <s:select> field:

       <s:select key="form.status" name="status"

                    list="statusList"

                    listKey="id"

                    listValue="description"/>



The action has the method:



       public List<Status> getStatusList(){

               return statusService.findAll();

       }



The model object that status is mapped to looks like this:



@Entity

@Table(name="STATUS")

@Validation

public class Status implements Identifiable, Serializable {



       private static final long serialVersionUID =
-8017026685032314796L;

       private Integer id;

       private String description;



       @Id

       @GeneratedValue(strategy = GenerationType.AUTO)

       @Column(name = "ID", unique = true, nullable= false)

       public Integer getId() {

               return id;

       }



       public void setId(Integer id){

               this.id= id;

       }



       @Column(name="DESCRIPTION", nullable= false)

       public String getDescription() {

               return description;

       }



       @RequiredStringValidator(message="Validation Error",
key="validate.notEmpty", trim=true)

       public void setDescription(String description) {

               this.description = description;

       }



I tried creating a mapping properties file called
actionName-conversion.properties:

KeyProperty_StatusList=id

Element_StatusList=Status

CreateIfNull_statusList=true



No avail. I'm sure my problem is obvious, but I can't see it. Any help
or suggestions would be much appreciated...



Thanks in advance!

Michael Griffith







Attachment: user_185592.ezm (zipped)
Jukka,

First of all, thanks for the reply. I don't think I made my question clear enough. The form isn't editing the model/object called Status, its editing a model on which Status is an associated object. Such as in this example, where I have a class named Call, that has a field called Status, which is a model object.

Call      Status
-----      -------
id      id  
description    description
dateCreated
status

Given, this -- does your comment still hold?

Thanks!

MG

Doesn't your example indicate that it would set the field called id

-----Original Message-----
From: Jukka Välimaa [mailto:valimaa.jukka@(protected)]
Sent: Friday, April 18, 2008 12:12 PM
To: Struts Users Mailing List
Subject: Re: Clarification on Type Conversion?

name="status" means that you are trying to pass the status object itself as
a parameter to a method setStatus. That is not possible--you need to pass
the id of the status if you want to indicate which status the user chose,
like this for example:
<s:select key="form.status" name="id"
  list="statusList"
  listKey="id"
  listValue="description"/>

You also need setId method in the action you submit the form to.

On Fri, Apr 18, 2008 at 5:33 PM, Griffith, Michael * <
Michael.Griffith@(protected):

> Hello All,
>
>
>
> I am having a problem with Struts 2 form submission, because I believe a
> related <s:select> field is not being converted correctly. I have read
> the documentation at: http://struts.apache.org/2.x/docs/select.html and
> http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
> understanding that I should not need to provide any custom converter,
> that this conversion should be automatic. When I submit the form, I
> receive the error: Invalid field value for field "status".
>
>
>
> Here is the setup:
>
>
>
> I have a form with a <s:select> field:
>
>        <s:select key="form.status" name="status"
>
>                     list="statusList"
>
>                     listKey="id"
>
>                     listValue="description"/>
>
>
>
> The action has the method:
>
>
>
>        public List<Status> getStatusList(){
>
>                return statusService.findAll();
>
>        }
>
>
>
> The model object that status is mapped to looks like this:
>
>
>
> @Entity
>
> @Table(name="STATUS")
>
> @Validation
>
> public class Status implements Identifiable, Serializable {
>
>
>
>        private static final long serialVersionUID =
> -8017026685032314796L;
>
>        private Integer id;
>
>        private String description;
>
>
>
>        @Id
>
>        @GeneratedValue(strategy = GenerationType.AUTO)
>
>        @Column(name = "ID", unique = true, nullable= false)
>
>        public Integer getId() {
>
>                return id;
>
>        }
>
>
>
>        public void setId(Integer id){
>
>                this.id= id;
>
>        }
>
>
>
>        @Column(name="DESCRIPTION", nullable= false)
>
>        public String getDescription() {
>
>                return description;
>
>        }
>
>
>
>        @RequiredStringValidator(message="Validation Error",
> key="validate.notEmpty", trim=true)
>
>        public void setDescription(String description) {
>
>                this.description = description;
>
>        }
>
>
>
> I tried creating a mapping properties file called
> actionName-conversion.properties:
>
> KeyProperty_StatusList=id
>
> Element_StatusList=Status
>
> CreateIfNull_statusList=true
>
>
>
> No avail. I'm sure my problem is obvious, but I can't see it. Any help
> or suggestions would be much appreciated...
>
>
>
> Thanks in advance!
>
> Michael Griffith
>
>
>
>
>
>

Attachment: user_185593.ezm (zipped)
Martin,

First of all, thanks for the reply. The full action is listed below:

I guess what is not clear to me is whether I need to create a
StrutsTypeConverter to convert the selected item from the list back to a
model.

As I have been thrashing about trying to get this to work, I have tried
creating a converter to convert the id passed back to an object...

public class StatusConverter extends StrutsTypeConverter {

 private static final Log _log =
LogFactory.getLog(StatusConverter.class);

 @Override
 public Object convertFromString(Map context, String[] values,
Class toClass) {

    if (values.length > 0 && values[0] != null &&
values[0].trim().length() > 0) {
     Status status= new Status();
     status.setId(new Integer(values[0]));
     return status;
    }
    return null;
 }

 @Override
 public String convertToString(Map context, Object status) {
    if (status instanceof Status) {
       return ((Status)status).getId().toString();
    }
   return "";
 }

}

This seems to work, but only the ID is passed to the converter, which
means I have to look up the reference to the Status object in the
database. This just feels as if I am going down the wrong path. Again,
below is my action. Thanks for any suggestions you might have.

Best Regards,

MG

...

public class CallAction extends BaseCallAction implements
   ServletRequestAware, ModelDriven<Call>, Preparable {

 /**
  *
  */
 private static final long serialVersionUID =
9001475066131203883L;
 private Call Call;
 private HttpServletRequest request;
 CallService CallService;
 UserService userService;
 StatusService statusService;
 
 Integer id;

 public Integer getId() {
   return id;
 }

 public void setId(Integer id) {
   this.id = id;
 }
 
 public String getView() throws Exception{
   return SUCCESS;
 }

 public String list() throws Exception {
   
   List<Call> results= CallService.getCalls();
   request.setAttribute(SEARCH_RESULTS, results);
   return SUCCESS;
 }

 public String execute() throws Exception {
   return SUCCESS;
 }

 public Call getModel() {
   return Call;
 }

 public void prepare() throws Exception {
   if(id == null || id.intValue() == 0){
     PermissionedUser permissionedUser=
this.getAuthenticatedUser();
     Call= new Call();
     Call.setRequestor(permissionedUser.getUser());
   }else{
     Call= CallService.getCall(id);
   }
   request.getSession().setAttribute("Call", Call);
 }
 
 public String update() throws Exception{
   CallService.update(Call);
   return SUCCESS;
 }

 public void setServletRequest(HttpServletRequest request) {
   this.request= request;
 }

 public void setCallService(CallService CallService) {
   this.CallService = CallService;
 }
 
 public void setUserService(UserService userService) {
   this.userService = userService;
 }
 
 public void setStatusService(StatusService statusService){
   this.statusService= statusService;
 }
 
 public List<Status> getStatusList(){
   return statusService.findAll();
 }

}



-----Original Message-----
From: Martin Gainty [mailto:mgainty@(protected)]
Sent: Friday, April 18, 2008 12:22 PM
To: Griffith, Michael *
Cc: Struts Users Mailing List
Subject: Re: Clarification on Type Conversion?

Good Afternoon Mike-

Tough to diagnose without seeing the service interface defined in your
action
e.g.
public class HHSAction implements Preparable {
  private HHSService service;
}

package quickstart.service;
import java.util.List;
import quickstart.model.Person;
public interface HHSService
{
  public List<Person> findAll();
  public void save(Person person);
  public Person find(int id);
}

?
Martin-
----- Original Message -----
From: "Griffith, Michael *" <Michael.Griffith@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Friday, April 18, 2008 10:33 AM
Subject: Clarification on Type Conversion?


Hello All,



I am having a problem with Struts 2 form submission, because I believe a
related <s:select> field is not being converted correctly. I have read
the documentation at: http://struts.apache.org/2.x/docs/select.html and
http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
understanding that I should not need to provide any custom converter,
that this conversion should be automatic. When I submit the form, I
receive the error: Invalid field value for field "status".



Here is the setup:



I have a form with a <s:select> field:

       <s:select key="form.status" name="status"

                    list="statusList"

                    listKey="id"

                    listValue="description"/>



The action has the method:



       public List<Status> getStatusList(){

               return statusService.findAll();

       }



The model object that status is mapped to looks like this:



@Entity

@Table(name="STATUS")

@Validation

public class Status implements Identifiable, Serializable {



       private static final long serialVersionUID =
-8017026685032314796L;

       private Integer id;

       private String description;



       @Id

       @GeneratedValue(strategy = GenerationType.AUTO)

       @Column(name = "ID", unique = true, nullable= false)

       public Integer getId() {

               return id;

       }



       public void setId(Integer id){

               this.id= id;

       }



       @Column(name="DESCRIPTION", nullable= false)

       public String getDescription() {

               return description;

       }



       @RequiredStringValidator(message="Validation Error",
key="validate.notEmpty", trim=true)

       public void setDescription(String description) {

               this.description = description;

       }



I tried creating a mapping properties file called
actionName-conversion.properties:

KeyProperty_StatusList=id

Element_StatusList=Status

CreateIfNull_statusList=true



No avail. I'm sure my problem is obvious, but I can't see it. Any help
or suggestions would be much appreciated...



Thanks in advance!

Michael Griffith







Attachment: user_185595.ezm (zipped)
Yes. Struts calls the setters in the target action based on the name of the
form element. If the name attribute of your select field is 'status', it
will try to call method setStatus, with the value of the form element--in
this case id, as it's the listKey--as the parameter.

On Fri, Apr 18, 2008 at 8:36 PM, Griffith, Michael * <
Michael.Griffith@(protected):

> Jukka,
>
> First of all, thanks for the reply. I don't think I made my question clear
> enough. The form isn't editing the model/object called Status, its editing a
> model on which Status is an associated object. Such as in this example,
> where I have a class named Call, that has a field called Status, which is a
> model object.
>
> Call             Status
> -----             -------
> id               id
> description         description
> dateCreated
> status
>
> Given, this -- does your comment still hold?
>
> Thanks!
>
> MG
>
> Doesn't your example indicate that it would set the field called id
>
> -----Original Message-----
> From: Jukka Välimaa [mailto:valimaa.jukka@(protected)]
> Sent: Friday, April 18, 2008 12:12 PM
> To: Struts Users Mailing List
> Subject: Re: Clarification on Type Conversion?
>
> name="status" means that you are trying to pass the status object itself
> as
> a parameter to a method setStatus. That is not possible--you need to pass
> the id of the status if you want to indicate which status the user chose,
> like this for example:
> <s:select key="form.status" name="id"
>   list="statusList"
>   listKey="id"
>   listValue="description"/>
>
> You also need setId method in the action you submit the form to.
>
> On Fri, Apr 18, 2008 at 5:33 PM, Griffith, Michael * <
> Michael.Griffith@(protected):
>
> > Hello All,
> >
> >
> >
> > I am having a problem with Struts 2 form submission, because I believe a
> > related <s:select> field is not being converted correctly. I have read
> > the documentation at: http://struts.apache.org/2.x/docs/select.html and
> > http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my
> > understanding that I should not need to provide any custom converter,
> > that this conversion should be automatic. When I submit the form, I
> > receive the error: Invalid field value for field "status".
> >
> >
> >
> > Here is the setup:
> >
> >
> >
> > I have a form with a <s:select> field:
> >
> >        <s:select key="form.status" name="status"
> >
> >                     list="statusList"
> >
> >                     listKey="id"
> >
> >                     listValue="description"/>
> >
> >
> >
> > The action has the method:
> >
> >
> >
> >        public List<Status> getStatusList(){
> >
> >                return statusService.findAll();
> >
> >        }
> >
> >
> >
> > The model object that status is mapped to looks like this:
> >
> >
> >
> > @Entity
> >
> > @Table(name="STATUS")
> >
> > @Validation
> >
> > public class Status implements Identifiable, Serializable {
> >
> >
> >
> >        private static final long serialVersionUID =
> > -8017026685032314796L;
> >
> >        private Integer id;
> >
> >        private String description;
> >
> >
> >
> >        @Id
> >
> >        @GeneratedValue(strategy = GenerationType.AUTO)
> >
> >        @Column(name = "ID", unique = true, nullable= false)
> >
> >        public Integer getId() {
> >
> >                return id;
> >
> >        }
> >
> >
> >
> >        public void setId(Integer id){
> >
> >                this.id= id;
> >
> >        }
> >
> >
> >
> >        @Column(name="DESCRIPTION", nullable= false)
> >
> >        public String getDescription() {
> >
> >                return description;
> >
> >        }
> >
> >
> >
> >        @RequiredStringValidator(message="Validation Error",
> > key="validate.notEmpty", trim=true)
> >
> >        public void setDescription(String description) {
> >
> >                this.description = description;
> >
> >        }
> >
> >
> >
> > I tried creating a mapping properties file called
> > actionName-conversion.properties:
> >
> > KeyProperty_StatusList=id
> >
> > Element_StatusList=Status
> >
> > CreateIfNull_statusList=true
> >
> >
> >
> > No avail. I'm sure my problem is obvious, but I can't see it. Any help
> > or suggestions would be much appreciated...
> >
> >
> >
> > Thanks in advance!
> >
> > Michael Griffith
> >
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185588.ezm (zipped)
Discovered it was a simple case of user (i.e. my) error.

The actual problem was "The displayer mapping for the specified MenuDisplayer does not exist." which was causing the JSP to not be rendered and thus resulting in SiteMesh to report the error I detailed previusly.

-----Original Message-----
From: Al Sutton [mailto:al.sutton@(protected)]
Sent: 10 April 2008 16:42
To: Struts Users Mailing List
Subject: Re: Struts2, SiteMesh and Struts Menu

I'm using the combination you mention without any problems.

Check the order you're using the servlet filters in, mine is;


<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class></filter><filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class></filter><filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class></filter><filter> <filter-name>struts-cleanup</filter-name> <url-pattern>/*</url-pattern></filter-mapping><filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern></filter-mapping><filter-mapping> <filter-name>struts</filter-name> <url-pattern>/*</url-pattern></filter-mapping>.... Other filters here .....and for Struts Menu I use the listener; <listener> <listener-class>net.sf.navigator.menu.MenuContextListener</listener-class> </listener>Hope this helps.Al.----- Original Message -----From: Matthew SeabornTo: 'Struts Users Mailing List'Sent: Thursday, April 10, 2008 3:00 PMSubject: Struts2, SiteMesh and Struts MenuHa
s anyone had any experience of using these three together? I have Struts2 and SiteMesh working together happily, but soon as I add Struts Menu I getthe error below.I believe it is due to SiteMesh and not Struts 2 but am not sure on this.Has anyone seen this before?Thanks.javax.servlet.ServletException: Stream closed        org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:515)        org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)        com.opensymphony.module.sitemesh.filter.PageFilter.parsePage (PageFilter.java:119)        com.opensymphony.module.sitemesh.filter.PageFilter.doFilter (PageFilter.java:55)        org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter (ActionContextCleanUp.java:99)root causejava.io.IOException: Stream closed        org.apache.jasper.runtime.JspWriterImpl.ensureOpen (JspWriterImpl.java:203)        org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterIm
pl.java:114)        org.apache.jasper.runtime.JspWriterImpl.flush (JspWriterImpl.java:172)        org.apache.jasper.runtime.JspRuntimeLibrary.include (JspRuntimeLibrary.java:954)        org.apache.jasper.runtime.PageContextImpl.include (PageContextImpl.java:614)        org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute (ServletDispatcherResult.java:119)        org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:178)        com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:348)        com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:253)        org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:50)        org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:504)        org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)        com.opensymphony.modul
e.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)        com.opensymphony.module.sitemesh.filter.PageFilter.doFilter (PageFilter.java:55)        org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter (ActionContextCleanUp.java:99)Matthew SeabornSoftware Architectt   +44(0) 208 484 0729m +44(0) 7949 465 142e  matthew.seaborn@(protected)
nature,is not 100% secure and by communicating with Perform Group by email youconsent to us monitoring and reading any such correspondence.VIRUSES - Although this email message has been scanned for the presence ofcomputer viruses, the sender accepts no liability for any damage sustainedas a result of a computer virus and it is the recipient's responsibility toensure that email is virus free.AUTHORITY - Any views or opinions expressed in this email are solely thoseof the sender and do not necessarily represent those of Perform Group.COPYRIGHT - Copyright of this email and any attachments belongs to PerformGroup, Companies House Registration number 6324278.

________________________________________________________________________

CONFIDENTIALITY - This email and any files transmitted with it, are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If this has come to you in error, you must not copy, distribute, disclose or use any of the information it contains. Please notify the sender immediately and delete them from your system.

SECURITY - Please be aware that communication by email, by its very nature, is not 100% secure and by communicating with Perform Group by email you consent to us monitoring and reading any such correspondence.

VIRUSES - Although this email message has been scanned for the presence of computer viruses, the sender accepts no liability for any damage sustained as a result of a computer virus and it is the recipient’s responsibility to ensure that email is virus free.

AUTHORITY - Any views or opinions expressed in this email are solely those of the sender and do not necessarily represent those of Perform Group.

COPYRIGHT - Copyright of this email and any attachments belongs to Perform Group, Companies House Registration number 6324278.

Attachment: user_185589.ezm (zipped)
<s:form action="save">
<s:textfield id="id" name="id" cssStyle="display:none"/>
Title<s:textfield label="Event Title" name="title"/>
Date<s:textfield label="Event Date" name="date"/> Date (e.g. 24.12.2009)
<s:submit value="Add Event" align="center"/>
</s:form>

When it is calling action setDate(Date date) method it is throwing below error

10:34:06,841 ERROR ParametersInterceptor:204 - ParametersInterceptor - [setParam
eters]: Unexpected Exception caught setting 'date' on 'class events.EventManager
: Error setting expression 'date' with value '[Ljava.lang.String;@(protected)'

I'm having follwoing interceptors in my struts.xml
<interceptors>
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="servlet-config"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="profiling"/>
<interceptor-ref name="scoped-model-driven"/>
<interceptor-ref name="model-driven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="static-params"/>
<interceptor-ref name="params"/>
<interceptor-ref name="conversionError"/>
<interceptor-ref name="validation">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>



Attachment: user_185594.ezm (zipped)
Hi all,

a little point which i want to know.
i have a form by which we can add billing detais in the database

form is working fine, it is adding the value to the database as expected,
the problem whcih i am facing is even after successfully submitting the
values, it is not clearing the form values which has been added

i can clear the fields values using java script,but i want to know is it
possible using Struts2,is theer any was that when ever data is submitted
successfully in the database form fields values should get cleared.


any help in this regard will be much appriciated.


thanks in advance
--aum

Attachment: user_185596.ezm (zipped)
Which version of Struts?

--- aum strut <aum.struts@(protected):

> Hi all,
>
> a little point which i want to know.
> i have a form by which we can add billing detais in the database
>
> form is working fine, it is adding the value to the database as expected,
> the problem whcih i am facing is even after successfully submitting the
> values, it is not clearing the form values which has been added
>
> i can clear the fields values using java script,but i want to know is it
> possible using Struts2,is theer any was that when ever data is submitted
> successfully in the database form fields values should get cleared.
>
>
> any help in this regard will be much appriciated.
>
>
> thanks in advance
> --aum
>

©2008 gg3721.com - Jax Systems, LLC, U.S.A.