This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes Error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error." Watch "Error." New topic


Mahesh Malviya
Ranch Hand

Joined: Aug 20, 2004
Posts: 39
I have a 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>

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
srinivas chunduru

Joined: Oct 26, 2009
Posts: 1
use value="<%=String.ValueOf(lloanID)%>" in form........u can solve the prob..........
Ankit Garg

Joined: Aug 03, 2008
Posts: 9453

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...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Error.
It's not a secret anymore!