struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KE LI" <hkustli...@gmail.com>
Subject How can these query data be got?
Date Tue, 02 Dec 2008 07:30:52 GMT
Hi All,
  I am quite confusing about this problem:
  Suppose this is an action:
  public class welcome implements Action
  {
       private String param1;
       private String param2;
       private List paramList;

       getters....
       setters....

       public String execute() throws Exception
       {
            paramList = new ArrayList();
            return SUCCESS;
       }
  }

  Then if I input the URL:
xxx/welcome.do?param1=hello&param2=world&paramList=element1&paramList=element2&paramList=...
  I found that param1 will be given the value "hello", param2 will be given
the value "world" but of course paramList will not be given
element1,2,3...etc. I want to ask:
  1. How can Struts2 get this value and give them to the parameters in the
action. As param1 and param2.
  2. How to solve the paramList problem that I can put a list of the same
kind of data into a dynamic list as paramList when I type / click the URL
like the example I gave above?
   PS: This will be used in pagination especially in the "page" tag which I
wrote myself.
   Thanks a lot in advance!
-- 
Best Regards,
Licco

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message