• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error.

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a SplitForm.java ActionForm class. I have three variables there. One is long[] lloanID, short[] sseqNo and long luserID.
Here is the class..

package com.uboc.wpm.forms;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
* Form bean for a Struts application.
* Users may access 3 fields on this form:
* <ul>
* <li>luserID - [your comment here]
* <li>lloanID - [your comment here]
* <li>sSeqNo - [your comment here]
* </ul>
* @version 1.0
* @author
*/
public class SplitForm extends ActionForm {

private long luserID;
private long[] lloanID = null;
private short[] sseqNo = null;

/**
* Get luserID
* @return long
*/
public long getLuserID() {
return luserID;
}

/**
* Set luserID
* @param <code>long</code>
*/
public void setLuserID(long l) {
this.luserID = l;
}

/**
* Get lloanID
* @return long[]
*/
public long[] getLloanID() {
return lloanID;
}

/**
* Set lloanID
* @param <code>long[]</code>
*/
public void setLloanID(long[] l) {
this.lloanID = l;
}

/**
* Get sSeqNo
* @return short[]
*/
public short[] getSseqNo() {
return sseqNo;
}

/**
* Set sSeqNo
* @param <code>short[]</code>
*/
public void setSseqNo(short[] s) {
this.sseqNo = s;
}

public void reset(ActionMapping mapping, HttpServletRequest request) {

// Reset values are provided as samples only. Change as appropriate.

luserID = 0;
lloanID = null;
sseqNo = null;

}

public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {

ActionErrors errors = new ActionErrors();
// Validate the fields in your form, adding
// adding each error to this.errors as found, e.g.

// if ((field == null) || (field.length() == 0)) {
// errors.add("field", new org.apache.struts.action.ActionError("error.field.required"));
// }
return errors;

}
}
And the code on jsp page is..
<%long[] lloanID =null;
short[] sseqNo=null;
long luserID=1;
%>

<html:form action="/split">
<html:hidden property="lloanID" value="<%=lloanID%>"/>
<html:hidden property="sSeqNo" value="<%=sseqNo%>"/>
<html:hidden property="luserID" value="<%=luserID%>"/>
<html:submit value="SplitRecord"></html:submit>
<html:reset> </html:reset>
</html:form>

But in jsp I got the error as

JavaCompile: The method setValue(String) in the type BaseInputTag is not applicable for the arguments (long[]).

I could not understand what I have to do for it. Because it is running well for other data type like int and String.
Please help me.

Thanks in advance
Mahesh Malviya
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use value="<%=String.ValueOf(lloanID)%>" in form........u can solve the prob..........
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mahesh please Use A Meaningful Subject Line when you start a topic. Also Use Code Tags when you post a source code. You can edit your message using button and then add code tags and correct the subject line...
 
reply
    Bookmark Topic Watch Topic
  • New Topic