my dog learned polymorphism
The moose likes Struts and the fly likes html option tag error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html option tag error " Watch "html option tag error " New topic

html option tag error


Joined: Dec 05, 2007
Posts: 17
Hello Expert's
<html ption value="<%=departmentId%>"><%=departmentName%></html ption>
where departmentId is an int.

This code was compiling and running in Orion just fine, however, when trying to access
this page in JBoss, I get the following error:

An error occurred at line: 1,745 in the jsp file: /insurance/jsp/selectTenderType.jsp
| Generated servlet error:
| The method setValue(String) in the type OptionTag is not applicable for the arguments (int)
how to solve this problem.Please help me.Its Urgent.
Joe Ess

Joined: Oct 29, 2001
Posts: 9150

Every question on JavaRanch is "urgent", at least to the person asking it. Please Ease Up.
As for your question, have a look at this post.

[How To Ask Questions On JavaRanch]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try changing <%=departmentId%> to <%= (new Integer(departmentId)).toString%>. That way the argument is a String instead of an integer.
[ February 04, 2008: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

"Rajm mr",
Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages right away. Your account is about to be closed.
I agree. Here's the link:
subject: html option tag error
It's not a secret anymore!