File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method to return a map

 
liliya woland
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this simple code in my jsp page and I'm getting an error
"Syntax error on token "(", ; expected"
where the method starts. I can't see what I'm doing wrong. Can someone please look at this?

if(ownerID != null){
HashMap mapOwner = getContact(ownerID);
}
private HashMap getContact(String id){
HashMap mapContact = new HashMap();

return mapContact;
}
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just like with "normal" Java, you can't just declare a method in the middle of another one.
 
liliya woland
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. I didn't realize the method was inside an if statement.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic