• Post Reply Bookmark Topic Watch Topic
  • New Topic

simple doubt  RSS feed

 
Sangeetha Selvaraj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
iam was trying out a simple example where iam trying to display the multiple choices in a list box with jsp....it gives the following error

Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 5.0\work\Catalina\localhost\murach\org\apache\jsp\email4\show_005fmusic_005fchoices_jsp.java:60: illegal start of expression
<
^
1 error
this is the JSP code...i cant figure out where the mistake is...the string array variable and the syntax seems to be correct
<body>
<%
String firstName = request.getParameter("firstName");
String lastName = request.getParameter("lastName");
String emailAddress = request.getParameter("emailAddress");
%>
<h1>Thanks for joining our email list <%=firstName%></h1>
<%
String[] musicchoice = request.getParameterValues("music");
for(int i = 0; i < musicchoice.length; i++)
{
%>
<%= musicchoice[i] %> <br>
<%
}
<%>
</body>
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an extra "<" at the beginning of the next-to-last line.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!