Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to declare functions in jsp

 
rasika gamage
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i declared a function like this
public void createMyCookie(String name,int expires)
{}
here i got an error that " ;" missing

 
spalaniv
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rasika,
<%! public void createMyCookie(String name,int expires) { // code for the method } %>
I think the above will help u.
 
Gus Torreti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
As already told right above, you shold try the code
<%! public void createMyCookie(String name,int expires)
{
// code for the method
}
%>
Please note the code <%! into your page. Also, for your convenience, put all your functions after the < / html > tag.
Regardz,
Gus
------------------
===============
"In the brightest day, in the blackest night,
No evil shall scape my sight.
May those who worship evil's might
beware of the power of my light"
 
rasika gamage
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanka for ur reply.
nice to meet u in saloon
I would like to know sth about u.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic