struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manoj sinha <manojsinh...@yahoo.com>
Subject Re: Form fields populated from Action class
Date Sun, 01 Apr 2007 05:33:09 GMT
 Action Class:
public HashMap getUserDetails(String loginid)throws Exception{
        UserInfo userInfo=null;
       ..........................
............................
        userInfo = userInfoHome.findByPrimaryKey(loginid);
        
        HashMap userDetails=new HashMap();
            userDetails.put("userName", userInfo.getPassword());
...................Other Codes here...
password=(String)userDetails.get("password");
.............
public String execute()throws Exception{
        userInfoDetails=getUserDetails( loginid);
        return SUCCESS;
    }
private String loginid;
......getter & setter method are......
struts.xml
<action name="userInfo"  class="......" >
            
            <result>/adduser.jsp</result>
           .......
aduser.jsp 
<s:select  list="userId" name="loginid" cssClass="combstyle"  onchange="userList()"/>
......
function userList(){
                document.userInfoForm.action = "userInfo.action";
                document.userInfoForm.submit();
....
Again Thanks
           
Laurie Harper <laurie@holoweb.net> wrote: manoj sinha wrote:
> Hi All,
> My Configuration is Struts2.0.6 , Postgres 8.1
> I have jsp page and it contains drop down list of Log Id and list gets populated from
database.Onselect specific user It should populate other form fields.
> User Details is getting from Action class.This class works fine.
> Now problem:as i select LoginId from drop down it is showing blank page and Exception
on eclipse console 
> ERROR [ParametersInterceptor] ParametersInterceptor - [setParameters]: Unexpected Exception
catched: Error setting expression 'loginid' with value '[Ljava.lang.String;@1c5627c'.
> Any help/suggestion is appreciated.

Looks like your setter is being passed a String array but is expecting 
just a String. Without seeing your action code and associated 
configuration it's difficult to be more specific.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



 
---------------------------------
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message