This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

calling core java(normal) classes from servlets

 
jay thakkar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi pals.... i m new to java n i m trying a thing n stuck up ...

i am trying to call method of normal class from within servlets.. i know this is possible so here is what i did..

LoginForm.java



SimplyHello.java // compilation error

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class SimplyHello extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res)throws IOException,ServletException
{
LoginForm fl = new LoginForm();
fl.getLoginForm();
}
}

both the files are in
cd c:\program files\apache-tomcat-7.0.39\webapps\root
directory..


as public classes are availabe to members of package i shouldnt get compilation error


the error message i get is
SimplyHello.java:10: error: cannot find symbol
LoginForm fl = new LoginForm();
^
symbol: class LoginForm
location: class SimplyHello
SimplyHello.java:10: error: cannot find symbol
LoginForm fl = new LoginForm();
^
symbol: class LoginForm
location: class SimplyHello
2 errors

 
jay thakkar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
please give an example of how it is done..

if path of any file is to be changed.. please mention.... thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Your build classpath is missing the classes. I've moved this to the Beginning Java forum where build and classpath issues are best discussed.
 
jay thakkar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
bear bibeault bro if you know what is the problem then you could have explained me instead of leaving it on others ot explain

i mentioned to give detailed explaination of the problem... you could have explained "build classpath" to me...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
jay thakkar wrote:i mentioned to give detailed explaination of the problem

Everyone here is a volunteer, myself included.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Report post to moderator
jay thakkar wrote:bear bibeault bro if you know what is the problem then you could have explained me instead of leaving it on others ot explain
. . .
There is no need to be rude, thank you very much.
 
Winston Gutkowski
Bartender
Pie
Posts: 10422
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
jay thakkar wrote:i mentioned to give detailed explaination of the problem...

No you didn't; and it's a bit early on in your membership to be dictating to people how they should help you.

This site is not in the practise of simply handing out answers. We much prefer to guide people to their own, which is exactly what Bear was trying to do.

If you have any further questions, I suggest you read the HowToAskQuestionsOnJavaRanch (←click) page first.

Winston
 
fred rosenberger
lowercase baba
Bartender
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
jay thakkar wrote:bear bibeault bro if you know what is the problem then you could have explained me instead of leaving it on others ot explain. i mentioned to give detailed explaination of the problem... you could have explained "build classpath" to me...

1) Maybe Bear doesn't know (although I would bet he does)
2) Maybe Bear didn't have time, because he was too busy trying to explain our rules/policies to members who don't take the time to learn how we do things here.
3) Maybe that is not Bear's (or any other moderator's) job.
4) Maybe your "detailed explaination (sic)" wasn't as detailed or as clear as you think.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Report post to moderator
This correspondence now closed.
 
    Bookmark Topic Watch Topic
  • New Topic