Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP cannot locate a method in a class i have imported

 
tej ko
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting "cannot resolve symbolsymbol : method myMethod()"
location mypackage.Myclass

this is how i am using it
<jsp:useBean id="handler" scope="page" class="mypackage.Myclass"></jsp:useBean>

handler.myMethod();

I have checked million times that package is there, the class is there and the class has the method with exact same signature.

Iam using was 6.0 any clue? this is so trivial but driving me crazy.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tej ko:
this is how i am using it
<jsp:useBean id="handler" scope="page" class="mypackage.Myclass"></jsp:useBean>

handler.myMethod();


Have you also imported the class?

Iam using was 6.0 any clue? this is so trivial but driving me crazy.

6.0 of what?

P.S. Why are you still putting Java code in a JSP? That's terribly old-fashioned.
 
tej ko
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, myClass is the class that has the definition of myMethod.

I am using websphere app server 6.0
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't answer all my questions.
 
tej ko
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know any other way to do it. Yet. I am sure I will learn it but right now I am struggling with basics.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you imported the class?

And please read this article to learn about proper web app structure. You should not be placing Java code in JSPs at this juncture whether you are just learning or not.
 
tej ko
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the help, i found the problem. I has a wrong directory structure in my web app, than the package I had mentioned in my java Editor. I changed the directory structure and the problem is gone.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!