aspose file tools*
The moose likes Struts and the fly likes Getting an error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting an error" Watch "Getting an error" New topic
Author

Getting an error

Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
Hi,

while iam trying to run following code . I am getting an error.



<html:select property="endYear"name ="customerForm" >
<% Calendar = Calendar.getInstance();
int NUM_YEARS1 = 3; // show 3 years out
int year1 = calendar1.get(java.util.Calendar.YEAR);
for (int i = 0; i < NUM_YEARS1; i++) {
System.out.println("Year = "+year1); %>

<html ption value="<%=year1%>"><%=year1%></html ption>
<% year1++;
} %>


error:



cannot find symbol
symbol : method setValue(int)
location: class org.apache.struts.taglib.html.OptionTag
_jspx_th_html_option_54.setValue(year1);
^
1 error


Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and most people will just go elsewhere. Please read this for more information.

You can go back and change your post to add code tags by clicking the .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
<html:select property="endYear"name ="customerForm" >
<% Calendar = Calendar.getInstance();
int NUM_YEARS1 = 3; // show 3 years out
int year1 = calendar1.get(java.util.Calendar.YEAR);
for (int i = 0; i < NUM_YEARS1; i++) { %>
<html ption value="<%=year1%>"><%=year1%></html ption>
<% year1++;
} %>
</html:select>


error:



cannot find symbol
symbol : method setValue(int)
location: class org.apache.struts.taglib.html.OptionTag
_jspx_th_html_option_54.setValue(year1);
^
1 error
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
Hello Bhaskar,

Simply, the setValue method in the option tag of the html tag library takes a string, and you are giving it an integer. I suggest that you use JSTL with EL instead of scriptlets, so that you won't face type conversion problems like this.


Visit my blog: http://jnassef.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting an error