Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

info to class from JSP  RSS feed

 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to send three vars from my jsp to my class. When i try to send it it gives me this error:



here is my code


help. please, this has been making me
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic Java.

method setStartDay(int) cannot be referenced from a static context


The method setStartDay() is not a static method.

com.blah.blahblah.TimeHandler.setStartDay(startDay);


is the syntax for a call to a static member of TimeHandler.

You need an instance of a TimeHandler in order to call a non-static method.

this has been making me


Don't get mad, seek knowledge.
[ June 21, 2005: Message edited by: Bear Bibeault ]
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so to make an instance its:



is that correct?
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did the previous, it works, but, it is not sending any values so I have zeros and null's popping up
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At this point, only the author of TimeHandler knows the appropriate protocol for its use.

Keep in mind that JSPs are just short-hand notation for creating a Java class (a servlet, to be exact). All the same rules of Java still apply.

If TimeHandler expects to be initialized in some way, you're going to have to find out what's expected.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!